diff options
| author | Rapptz <[email protected]> | 2015-12-18 20:13:04 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2015-12-18 20:13:04 -0500 |
| commit | 070015e408db674a638ba70e3b194a6fbd564a4b (patch) | |
| tree | bec63c079fc11a7525fce0188d9f143db7563d09 | |
| parent | Fix Client.replace_roles having hashable errors. (diff) | |
| download | discord.py-070015e408db674a638ba70e3b194a6fbd564a4b.tar.xz discord.py-070015e408db674a638ba70e3b194a6fbd564a4b.zip | |
Disallow duplicates when adding or removing roles.
| -rw-r--r-- | discord/client.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/client.py b/discord/client.py index b5b822a9..5cf0ac13 100644 --- a/discord/client.py +++ b/discord/client.py @@ -2060,7 +2060,7 @@ class Client: Adding roles failed. """ - new_roles = [role.id for role in itertools.chain(member.roles, roles)] + new_roles = {role.id for role in itertools.chain(member.roles, roles)} yield from self._replace_roles(member, *new_roles) @asyncio.coroutine @@ -2121,7 +2121,7 @@ class Client: Removing roles failed. """ - new_roles = [role.id for role in roles] + new_roles = {role.id for role in roles} yield from self._replace_roles(member, *new_roles) @asyncio.coroutine |