From 464fa9f97aca755f8f525a2aa88c32c5923142c5 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 16 Jan 2024 13:06:50 +0000 Subject: [PATCH] fix(aurora): fixed some errors --- aurora/configuration/menus/addrole.py | 6 +++--- aurora/configuration/menus/immune.py | 6 +++--- aurora/configuration/menus/overrides.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/aurora/configuration/menus/addrole.py b/aurora/configuration/menus/addrole.py index 87cc811..b1abaa5 100644 --- a/aurora/configuration/menus/addrole.py +++ b/aurora/configuration/menus/addrole.py @@ -10,15 +10,15 @@ class Addrole(ui.View): self.ctx = ctx @ui.select(cls=ui.RoleSelect, placeholder="Select a role") - async def addrole_select(self, interaction: Interaction, select: ui.RoleSelect,): # pylint: disable=unused-argument + async def addrole_select(self, interaction: Interaction, select: ui.RoleSelect,): 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: + if select.values[0].id in addrole_whitelist: addrole_whitelist.remove(select.values[0].id) else: 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)) + await interaction.message.edit(embed=await addrole(self.ctx), view=Addrole(self.ctx)) diff --git a/aurora/configuration/menus/immune.py b/aurora/configuration/menus/immune.py index 680e53d..496b04e 100644 --- a/aurora/configuration/menus/immune.py +++ b/aurora/configuration/menus/immune.py @@ -10,15 +10,15 @@ class Immune(ui.View): self.ctx = ctx @ui.select(cls=ui.RoleSelect, placeholder="Select a role") - async def immune_select(self, interaction: Interaction, select: ui.RoleSelect,): # pylint: disable=unused-argument + async def immune_select(self, interaction: Interaction, select: ui.RoleSelect,): 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: + if select.values[0].id in immune_roles: immune_roles.remove(select.values[0].id) else: 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)) + await interaction.message.edit(embed=await immune(self.ctx), view=Immune(self.ctx)) diff --git a/aurora/configuration/menus/overrides.py b/aurora/configuration/menus/overrides.py index 7ce1b31..f7abd97 100644 --- a/aurora/configuration/menus/overrides.py +++ b/aurora/configuration/menus/overrides.py @@ -56,7 +56,7 @@ class Overrides(ui.View): await interaction.message.edit(embed=await overrides(self.ctx)) @ui.select(placeholder="Inline Pagesize", options=create_pagesize_options(), row=1) - async def inline_pagesize(self, interaction: Interaction, select: ui.Select,): # pylint: disable=unused-argument + async def inline_pagesize(self, interaction: Interaction, select: ui.Select,): if self.ctx.author != interaction.user: await interaction.response.send_message("You cannot change this setting for other users.", ephemeral=True) return @@ -68,7 +68,7 @@ class Overrides(ui.View): await interaction.message.edit(embed=await overrides(self.ctx)) @ui.select(placeholder="Pagesize", options=create_pagesize_options(), row=2) - async def pagesize(self, interaction: Interaction, select: ui.Select,): # pylint: disable=unused-argument + async def pagesize(self, interaction: Interaction, select: ui.Select,): if self.ctx.author != interaction.user: await interaction.response.send_message("You cannot change this setting for other users.", ephemeral=True) return