Browse Source

Fix changing own nickname without manage_nicknames

Use @me/nick rather than id when changing own nickname - this only
requires change_nicknames rather than manage.
pull/195/head
Khazhismel Kumykov 9 years ago
parent
commit
7bae6dc5bc
  1. 7
      discord/client.py

7
discord/client.py

@ -1424,7 +1424,12 @@ class Client:
Editing the channel failed.
"""
url = '{0}/{1.server.id}/members/{1.id}'.format(endpoints.SERVERS, member)
if member == self.user:
fmt = '{0}/{1.server.id}/members/@me/nick'
else:
fmt = '{0}/{1.server.id}/members/{1.id}'
url = fmt.format(endpoints.SERVERS, member)
payload = {
# oddly enough, this endpoint requires '' to clear the nickname

Loading…
Cancel
Save