Attribute bot.user.name/ bot.user.discriminator not updating after changing API token
Reproduction Steps
Use the code:
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix=">", self_bot=True)
@bot.event
async def on_ready():
print(f"Logged in as {bot.user.name}#{bot.user.discriminator}")
@bot.command()
async def ping(ctx):
await ctx.send("pong")
bot.run("token")
Run it for the first time with a token, and run it one more time with another token.
Then you'll get two same bot.user.name and bot.user.discriminator printed in the console.
Code
No response
Expected Results
Expected the bot.user.name/ bot.user.discriminator will change with changing the token when on_ready
Actual Results
The bot.user.name/ bot.user.discriminator doesn't change with the token.
System Information
- Python v3.9.6-final
- discord.py-self v1.9.1-final
- aiohttp v3.7.3
- system info: Windows 10 10.0.22000
Checklist
[X] I have searched the open issues for duplicates.
[ ] I have shared the entire traceback.
[X] I am using a user token (and it isn't visible in the code).
Summary
Attribute bot.user.name/ bot.user.discriminator not updating after changing API token
Reproduction Steps
Use the code:
Run it for the first time with a token, and run it one more time with another token. Then you'll get two same
bot.user.name
andbot.user.discriminator
printed in the console.Code
No response
Expected Results
Expected the
bot.user.name
/bot.user.discriminator
will change with changing the token whenon_ready
Actual Results
The
bot.user.name
/bot.user.discriminator
doesn't change with the token.System Information
Checklist