Browse Source

Disallow duplicates when adding or removing roles.

pull/60/head
Rapptz 9 years ago
parent
commit
070015e408
  1. 4
      discord/client.py

4
discord/client.py

@ -2060,7 +2060,7 @@ class Client:
Adding roles failed. 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) yield from self._replace_roles(member, *new_roles)
@asyncio.coroutine @asyncio.coroutine
@ -2121,7 +2121,7 @@ class Client:
Removing roles failed. 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) yield from self._replace_roles(member, *new_roles)
@asyncio.coroutine @asyncio.coroutine

Loading…
Cancel
Save