question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Missing Permissions" on change_nickname (HAS PERMISSION)

See original GitHub issue

This is the code I’m using to attempt to change the nickname of a user: await client.change_nickname(message.author, newnick)

The role is at the top of the role hierarchy and has the necessary permissions to change nicknames: image The role is assigned to the bot: image

And yet discord.py still throws a permission error:

Ignoring exception in on_message
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.5/site-packages/discord/client.py", line 307, in _run_event
    yield from getattr(self, event)(*args, **kwargs)
  File "rankgiver.py", line 28, in on_message
    await client.change_nickname(message.author, newnick)
  File "/home/pi/.local/lib/python3.5/site-packages/discord/client.py", line 1966, in change_nickname
    yield from self.http.change_nickname(member.server.id, member.id, nickname)
  File "/home/pi/.local/lib/python3.5/site-packages/discord/http.py", line 196, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions

Sending messages works just fine. I’m stumped.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
an0ndevcommented, Dec 18, 2019

the OP didn’t said anything at the end

My bad, totally forgot about this. Fairly certain enabling 2FA fixed it in the end. Thanks @Harmon758!

0reactions
guacaplushycommented, Dec 16, 2020

the bot needs to have a higher role than the person you change the nickname for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missing Permissions error when changing nicknames in ...
Good news! Your code isn't the issue. The problem is how your bot role is positioned as well as what permissions it has....
Read more >
Change Nickname Permission Issue : r/discordapp
Make sure these users which are changing their nickname do not have another role which grants them that permission. You should also check...
Read more >
GuildMember#setNickname api is always getting ...
I am sure it should have permissions to change member's nickname, but i always get Missing Permissions with the GuildMember#setNickname.
Read more >
Permissions (extended)
Take all permissions for all roles the guild member has and add them up. ... read or send messages in it, set the...
Read more >
[Solved]-Trouble changing Nickname in Discord.js, giving me ...
[Solved]-Trouble changing Nickname in Discord.js, giving me DiscordAPIError: Missing Permissions-discord.js ... If you are the owner of the server It will give ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found