aboutsummaryrefslogtreecommitdiff
path: root/discord/role.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-01-16 18:19:18 -0500
committerRapptz <[email protected]>2017-01-16 18:19:18 -0500
commitf4cadaf0ccc291f01434d567acde8909b46f218f (patch)
treee7f3d52db1ceda799e3b24fb560c3b935d6d7e32 /discord/role.py
parentFix AutoShardedClient docstring. (diff)
downloaddiscord.py-f4cadaf0ccc291f01434d567acde8909b46f218f.tar.xz
discord.py-f4cadaf0ccc291f01434d567acde8909b46f218f.zip
Fix bug with GuildChannel.edit and Role.edit with positions.
I did not update the HTTP code for these two methods.
Diffstat (limited to 'discord/role.py')
-rw-r--r--discord/role.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/discord/role.py b/discord/role.py
index bb3ba8ec..dd39a02e 100644
--- a/discord/role.py
+++ b/discord/role.py
@@ -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):