mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-08 10:53:10 +00:00
Fix bug with GuildChannel.edit and Role.edit with positions.
I did not update the HTTP code for these two methods.
This commit is contained in:
@ -175,7 +175,6 @@ class Role(Hashable):
|
||||
return # Save discord the extra request.
|
||||
|
||||
http = self._state.http
|
||||
url = '{0}/{1}/roles'.format(http.GUILDS, self.guild.id)
|
||||
|
||||
change_range = range(min(self.position, position), max(self.position, position) + 1)
|
||||
sorted_roles = sorted((x for x in self.guild.roles if x.position in change_range and x.id != self.id),
|
||||
@ -189,7 +188,7 @@ class Role(Hashable):
|
||||
roles.append(self.id)
|
||||
|
||||
payload = [{"id": z[0], "position": z[1]} for z in zip(roles, change_range)]
|
||||
yield from http.patch(url, json=payload, bucket='move_role')
|
||||
yield from http.move_role_position(role.guild.id, payload)
|
||||
|
||||
@asyncio.coroutine
|
||||
def edit(self, **fields):
|
||||
|
Reference in New Issue
Block a user