I
I
Igromik2020-06-04 13:37:29
Python
Igromik, 2020-06-04 13:37:29

How to change username with discord bot in python?

There is this code:

Client = commands.Bot(command_prefix='!')
@client.command(pass_context=True)
async def nick(ctx, member: discord.Member, nickname):
  await member.edit(nick=nickname)


It throws this error (All permissions have been granted):
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions


What to do? Help me please

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
REzebro, 2020-06-04
@REzebro

You have everything written in error. "Missing Permissions" - the bot has no rights to change the nickname
What rights were given when adding to the server?

T
tixonochek, 2021-01-24
@tixonochek

Igromik, the role of the bot must be higher than the role of the participant whose nickname you need to change. One administrator right is not enough!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question