diff --git a/dungeon/dungeon.py b/dungeon/dungeon.py index 993157a..897a715 100644 --- a/dungeon/dungeon.py +++ b/dungeon/dungeon.py @@ -72,8 +72,10 @@ class Dungeon(commands.Cog): if not dungeon_role_obj: return await ctx.send("No dungeon role set.") + #Managed roles CANNOT be removed by the bot. + remaining_roles = [r for r in user.roles if r.managed] try: - await user.edit(roles=[], reason=f"Removing all roles, {ctx.message.author} is banishing user") + await user.edit(roles=remaining_roles, reason=f"Removing all roles, {ctx.message.author} is banishing user") except discord.Forbidden: return await ctx.send( "I need permission to manage roles or the role hierarchy might not allow me to do this. I need a role higher than the person you're trying to banish."