diff options
| author | Rapptz <[email protected]> | 2016-01-10 03:19:41 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2016-01-10 03:19:41 -0500 |
| commit | 2c31c466b2337a5449f9cbcdef205f239b9ee9d9 (patch) | |
| tree | 037d5e594d9bf77da7b163ee03601ee8e4677bc3 | |
| parent | [commands] Strip arguments before searching for special cases. (diff) | |
| download | discord.py-2c31c466b2337a5449f9cbcdef205f239b9ee9d9.tar.xz discord.py-2c31c466b2337a5449f9cbcdef205f239b9ee9d9.zip | |
Fix Client.remove_roles to actually remove roles.
| -rw-r--r-- | discord/client.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py index 1c10f2cb..7e49aa89 100644 --- a/discord/client.py +++ b/discord/client.py @@ -2121,9 +2121,12 @@ class Client: """ 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] |