"Missing Permissions" on change_nickname (HAS PERMISSION)
See original GitHub issueThis 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: The role is assigned to the bot:
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:
- Created 5 years ago
- Reactions:1
- Comments:9 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
My bad, totally forgot about this. Fairly certain enabling 2FA fixed it in the end. Thanks @Harmon758!
the bot needs to have a higher role than the person you change the nickname for.