Is there a way to get bot information using the token in Discord.py?

I am trying to get the bot information via the token in Discord.py, but I do not know if it is possible. I am trying to get the bot name, how many servers, and the client ID in the console.

I have tried looking for other explanations, but they did not work or were for discord.js.

Thank you!

I am pretty sure you can do these:

  • print(bot.user.name)
  • print(len(bot.guilds)
  • print(bot.user.id)
2 Likes

File “/home/container/bot.py”, line 169, in
print(bot.user.name)
AttributeError: ‘NoneType’ object has no attribute ‘name’

make sure it’s in the on_ready function

1 Like

I already have the answer I needed, but thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.