This commit is contained in:
Amazed 2020-09-01 02:09:49 +02:00
parent bca6e5639c
commit 26195846e3

View File

@ -276,7 +276,7 @@ class WynncraftCog(commands.Cog):
await discord_member.add_roles(*roles_to_add) await discord_member.add_roles(*roles_to_add)
all_prof_ids = list(itertools.chain.from_iterable([roles_professions[b] for b in roles_professions])) all_prof_ids = list(itertools.chain.from_iterable([roles_professions[b] for b in roles_professions]))
roles_to_remove = list(filter(lambda role: role.id in all_prof_ids and role.id not in role_id_to_add, discord_member.roles)) roles_to_remove = list(filter(lambda role: role.id in all_prof_ids and role.id not in role_ids_to_add, discord_member.roles))
if roles_to_remove: if roles_to_remove:
await self._log("remove roles: %s" % roles_to_remove) await self._log("remove roles: %s" % roles_to_remove)
await discord_member.remove_roles(*roles_to_remove) await discord_member.remove_roles(*roles_to_remove)