Rapptz / discord.py

An API wrapper for Discord written in Python.
http://discordpy.rtfd.org/en/latest
MIT License
14.94k stars 3.77k forks source link

Change own nickname #992

Closed SIGSTACKFAULT closed 6 years ago

SIGSTACKFAULT commented 6 years ago

A function, say, client.change_own_nick(server, name) that, well, changes the bot's nickname automagically.

Rapptz commented 6 years ago

Just use change_nickname with your own member passed in.

SIGSTACKFAULT commented 6 years ago

How should I get the bot's member? (i.e., the best/correct way)

That was fast

Rapptz commented 6 years ago

http://discordpy.rtfd.io/en/latest/api.html#discord.Server.me

gpriamo commented 6 years ago

I have a question about this topic. I'm following what you told Blacksilver42 and I did the following:

(this is part of a command I created in order to change the Bot's nickname) me = context.message.server.me client.change_nickname(me, "Newnickname")

I get no errors but the bot does not change its nickname and I don't know why (roles allow nickname change and I also tried it by granting Admin privileges to the bot).

Do you have any suggestions for me? Thanks in advance!

Aemisiya commented 6 years ago

You forgot to await change_nickname.

gpriamo commented 6 years ago

Thank you @Vrori . Now it works as it should!

Aemisiya commented 6 years ago

Anytime!

Happy developing.