Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Missing Permissions" on change_nickname (HAS PERMISSION) #1641

Closed
an0ndev opened this issue Oct 5, 2018 · 9 comments
Closed

"Missing Permissions" on change_nickname (HAS PERMISSION) #1641

an0ndev opened this issue Oct 5, 2018 · 9 comments
Labels
stale This issue is too old.

Comments

@an0ndev
Copy link

an0ndev commented Oct 5, 2018

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.

@Harmon758
Copy link
Contributor

Are you trying to change the nickname of the server owner or someone else with that same role?

@an0ndev
Copy link
Author

an0ndev commented Oct 5, 2018

Are you trying to change the nickname of the server owner or someone else with that same role?

Neither, I'm trying to change the nickname of myself ("Developer" on the role tree)

@Harmon758
Copy link
Contributor

Does the server have Two-Factor Authentication enabled?
If so, does the bot's owner also have Two-Factor Authentication enabled on their account?

@an0ndev
Copy link
Author

an0ndev commented Oct 5, 2018

Does the server have Two-Factor Authentication enabled?
If so, does the bot's owner also have Two-Factor Authentication enabled on their account?

The bot owner has 2FA enabled but I don't believe the server does. I'll check and get back to you.

@Rapptz Rapptz added the stale This issue is too old. label Mar 9, 2019
@Rapptz Rapptz closed this as completed Mar 9, 2019
@rukh-debug
Copy link

I was working on this as well. Find out the bot is not able to change nickname of the admins. Only users who do not have admin privileges are on effect with this.

@TheRockettek
Copy link

Please dont necro year old issue, also the bot cant change stuff for people with a higher role. Users with a higher role than the bot cant have their names changed by the bot. Thats how permissions work.

@rukh-debug
Copy link

I didn't want to reopen it lel, I was just saying it seems to work like this cuz, the OP didn't said anything at the end.

@an0ndev
Copy link
Author

an0ndev commented 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!

@plooshi
Copy link

plooshi commented Dec 16, 2020

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

Repository owner locked as resolved and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stale This issue is too old.
Projects
None yet
Development

No branches or pull requests

6 participants