Jump to content

Best way to get a bot's email from inside script?


Recommended Posts

Posted

Is there any built in way to get the login name (email) of the current bot from inside a script? I did a cursory search of the forums and API and couldn't find anything.

I wrote a custom logger that writes to a new file every time a script is run. I'd like to be able to include the account email of the bot in the name of each log file so I know which account each log file is from. Also in the future, I may use the email to communicate status information about a bot to a server, and a bot's email seems like a good primary key.

Posted
1 hour ago, PlumpRump said:

Is there any built in way to get the login name (email) of the current bot from inside a script? I did a cursory search of the forums and API and couldn't find anything.

I wrote a custom logger that writes to a new file every time a script is run. I'd like to be able to include the account email of the bot in the name of each log file so I know which account each log file is from. Also in the future, I may use the email to communicate status information about a bot to a server, and a bot's email seems like a good primary key.

getBot().getUsername();

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...