I want to make a command that changes a nickname to a specific user (Let it be Example # 1234). This command accepts an argument in which a new nickname must be entered, to which the old nickname must be changed - g!Chnick "ExampleNick". I do not know how to change the nickname to users of the Discord server, I tried it through the Guild class, I tried it through the Member class. (Sorry for bad english)
It's not hard! For example you can use:
@client.command(pass_context=True)
async def chnick(ctx, member: discord.Member, nick):
await member.edit(nick=nick)
await ctx.send(f'Nickname was changed for {member.mention} ')
Don't forget a important thing, bot MUST have a permission for changing nicknames and can't change server owner nickname. Test it on other bots or members of server
My advice for you is reading discord.py documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With