From 77239e4f1588b7cf99ca54c36665ebfc4ad5bd57 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Mon, 24 Sep 2018 23:55:05 -0400 Subject: [PATCH] Fix NameError and duplicate insertion bug when moving roles. --- discord/role.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/role.py b/discord/role.py index 1068b20b8..b8c2950bd 100644 --- a/discord/role.py +++ b/discord/role.py @@ -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)