Skip to content

Commit

Permalink
Fix Client.remove_roles to actually remove roles.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapptz committed Jan 10, 2016
1 parent 50c83b5 commit 2c31c46
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2121,9 +2121,12 @@ def remove_roles(self, member, *roles):
"""
new_roles = [x.id for x in member.roles]
remove = []
for index, role in enumerate(roles):
if role.id in new_roles:
for role in roles:
try:
index = new_roles.index(role.id)
remove.append(index)
except ValueError:
continue

for index in reversed(remove):
del new_roles[index]
Expand Down

0 comments on commit 2c31c46

Please sign in to comment.