This commit is contained in:
Amazed 2020-09-01 00:24:03 +02:00
parent 1db2cf35f6
commit c82f6668aa

View File

@ -151,11 +151,11 @@ class WynncraftCog(commands.Cog):
combat_role = guild.get_role(combat_role_id)
if combat_role not in discord_member.roles:
await self._log("Add role: %s" % combat_role)
# await discord_member.add_roles(combat_role)
await discord_member.add_roles(combat_role)
roles_to_remove = filter(lambda role: role.id in roles_combat_level and role.id != combat_role_id, discord_member.roles)
if roles_to_remove:
# await discord_member.remove_roles(roles_to_remove)
await discord_member.remove_roles(roles_to_remove)
await self._log("remove roles: %s" % roles_to_remove)
else:
await self._log("max_combat_lvl_class: %s, discord_member: %s (name: %s)" % (max_combat_lvl_class, discord_member, member_name))