Reputation: 23
I have a simple issue that I'm yet to figure out, how can I change my bot's own nickname, because I want to display information instead of its nickname continuously.
tried this :
await bot.user.edit(username=price)
but this actually changes the username which is not allowed to be done multiple times.
async def status_update():
while True:
price = str(get_BTC_price(ws))
await bot.user.edit(username=price)
await asyncio.sleep (2)
@bot.event
async def on_ready():
bot.loop.create_task(status_update())
Thanks
Upvotes: 2
Views: 2075
Reputation: 1581
Nicknames are tied to Guild Members. In order to change your bot's nickname, you must
<Member>.edit(nick=nick)
Note that this will only change the nickname for one server. If you wanted it to be global you would have to loop through each guild and perform the operation (expensive). You may want to use the status box instead to convey this information.
Upvotes: 1