From d8def3cfc8c48a9eeb0a58db8beea74757a24be9 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 16 Jan 2024 13:03:51 +0000 Subject: [PATCH] fix(aurora): fixed a few errors in addrole/immune --- aurora/configuration/menus/addrole.py | 8 ++++---- aurora/configuration/menus/immune.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aurora/configuration/menus/addrole.py b/aurora/configuration/menus/addrole.py index 1d92e57..87cc811 100644 --- a/aurora/configuration/menus/addrole.py +++ b/aurora/configuration/menus/addrole.py @@ -11,14 +11,14 @@ class Addrole(ui.View): @ui.select(cls=ui.RoleSelect, placeholder="Select a role") async def addrole_select(self, interaction: Interaction, select: ui.RoleSelect,): # pylint: disable=unused-argument - if not interaction.user.guild_permissions.manage_guild: + if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator: await interaction.response.send_message("You must have the manage guild permission to add roles to the addrole whitelist.", ephemeral=True) return await interaction.response.defer() addrole_whitelist: list = await config.guild(self.ctx.guild).addrole_whitelist() if select.values[0] in addrole_whitelist: - addrole_whitelist.remove(select.values[0]) + addrole_whitelist.remove(select.values[0].id) else: - addrole_whitelist.append(select.values[0]) - await config.guild(self.ctx.guild).addrole_whitelist.set(int(select.values[0])) + addrole_whitelist.append(select.values[0].id) + await config.guild(self.ctx.guild).addrole_whitelist.set(addrole_whitelist) await interaction.message.edit(embed=await addrole(self.ctx)) diff --git a/aurora/configuration/menus/immune.py b/aurora/configuration/menus/immune.py index a04c741..680e53d 100644 --- a/aurora/configuration/menus/immune.py +++ b/aurora/configuration/menus/immune.py @@ -11,14 +11,14 @@ class Immune(ui.View): @ui.select(cls=ui.RoleSelect, placeholder="Select a role") async def immune_select(self, interaction: Interaction, select: ui.RoleSelect,): # pylint: disable=unused-argument - if not interaction.user.guild_permissions.manage_guild: + if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator: await interaction.response.send_message("You must have the manage guild permission to add immune roles.", ephemeral=True) return await interaction.response.defer() immune_roles: list = await config.guild(self.ctx.guild).immune_roles() if select.values[0] in immune_roles: - immune_roles.remove(select.values[0]) + immune_roles.remove(select.values[0].id) else: - immune_roles.append(select.values[0]) - await config.guild(self.ctx.guild).immune_roles.set(int(select.values[0])) + immune_roles.append(select.values[0].id) + await config.guild(self.ctx.guild).immune_roles.set(immune_roles) await interaction.message.edit(embed=await immune(self.ctx))