Fix NameError and duplicate insertion bug when moving roles.

This commit is contained in:
Rapptz 2018-09-24 23:55:05 -04:00
parent 54e9401a21
commit 77239e4f15

View File

@ -189,7 +189,7 @@ class Role(Hashable):
http = self._state.http
change_range = range(min(self.position, position), max(self.position, position) + 1)
roles = [r.id for r in self.guild.roles[1:] if x.position in change_range]
roles = [r.id for r in self.guild.roles[1:] if r.position in change_range and r.id != self.id]
if self.position > position:
roles.insert(0, self.id)