From 78a5103b1fc379f918cae0e9330c1035bac10cfc Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 16 Jan 2024 14:03:58 +0000 Subject: [PATCH] fix(aurora): changed up the guild embed a bit --- aurora/configuration/embed.py | 4 ++-- aurora/configuration/menus/guild.py | 32 ++++++++++++++--------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/aurora/configuration/embed.py b/aurora/configuration/embed.py index e5b3fc2..179b7f5 100644 --- a/aurora/configuration/embed.py +++ b/aurora/configuration/embed.py @@ -71,12 +71,12 @@ async def guild(ctx: commands.Context) -> Embed: '- '+ bold("Ignore Modlog: ") + get_bool_emoji(guild_settings['ignore_modlog']), '- '+ bold("Ignore Other Bots: ") + get_bool_emoji(guild_settings['ignore_other_bots']), '- '+ bold("DM Users: ") + get_bool_emoji(guild_settings['dm_users']), - '- '+ bold("Log Channel: ") + channel, '- '+ bold("Auto Evidence Format: ") + get_bool_emoji(guild_settings['auto_evidenceformat']), '- '+ bold("Ephemeral: ") + get_bool_emoji(guild_settings['history_ephemeral']), '- '+ bold("History Inline: ") + get_bool_emoji(guild_settings['history_inline']), '- '+ bold("History Pagesize: ") + get_pagesize_str(guild_settings['history_pagesize']), - '- '+ bold("History Inline Pagesize: ") + get_pagesize_str(guild_settings['history_inline_pagesize']) + '- '+ bold("History Inline Pagesize: ") + get_pagesize_str(guild_settings['history_inline_pagesize']), + '- '+ bold("Log Channel: ") + channel ] guild_str = '\n'.join(guild_str) diff --git a/aurora/configuration/menus/guild.py b/aurora/configuration/menus/guild.py index 8a489cf..afaaf0e 100644 --- a/aurora/configuration/menus/guild.py +++ b/aurora/configuration/menus/guild.py @@ -11,13 +11,13 @@ class Guild(ui.View): self.ctx = ctx @ui.button(label="Show Moderator", style=ButtonStyle.green, row=0) - async def show_modeartor(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument + async def show_moderator(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument 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 change this setting.", ephemeral=True) return await interaction.response.defer() - current_setting = await config.guild(interaction.guild).show_modeartor - await config.guild(interaction.guild).show_modeartor.set(not current_setting) + current_setting = await config.guild(interaction.guild).show_moderator + await config.guild(interaction.guild).show_moderator.set(not current_setting) await interaction.message.edit(embed=await guild(self.ctx)) @ui.button(label="Use Discord Permissions", style=ButtonStyle.green, row=0) @@ -50,7 +50,7 @@ class Guild(ui.View): await config.guild(interaction.guild).ignore_other_bots.set(not current_setting) await interaction.message.edit(embed=await guild(self.ctx)) - @ui.button(label="DM Users", style=ButtonStyle.green, row=0) + @ui.button(label="DM Users", style=ButtonStyle.green, row=1) async def dm_users(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument 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 change this setting.", ephemeral=True) @@ -60,16 +60,7 @@ class Guild(ui.View): await config.guild(interaction.guild).dm_users.set(not current_setting) await interaction.message.edit(embed=await guild(self.ctx)) - @ui.select(placeholder="Log Channel", cls=ui.ChannelSelect, row=1) - async def log_channel(self, interaction: Interaction, select: ui.ChannelSelect): - 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 change this setting.", ephemeral=True) - return - await interaction.response.defer() - await config.guild(interaction.guild).log_channel.set(select.values[0].id) - await interaction.message.edit(embed=await guild(self.ctx)) - - @ui.button(label="Auto Evidence Format", style=ButtonStyle.green, row=2) + @ui.button(label="Auto Evidence Format", style=ButtonStyle.green, row=1) async def auto_evidenceformat(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument 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 change this setting.", ephemeral=True) @@ -79,7 +70,7 @@ class Guild(ui.View): await config.guild(interaction.guild).auto_evidenceformat.set(not current_setting) await interaction.message.edit(embed=await guild(self.ctx)) - @ui.button(label="Ephemeral", style=ButtonStyle.green, row=2) + @ui.button(label="Ephemeral", style=ButtonStyle.green, row=1) async def ephemeral(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument 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 change this setting.", ephemeral=True) @@ -89,7 +80,7 @@ class Guild(ui.View): await config.guild(interaction.guild).history_ephemeral.set(not current_setting) await interaction.message.edit(embed=await guild(self.ctx)) - @ui.button(label="History Inline", style=ButtonStyle.green, row=2) + @ui.button(label="History Inline", style=ButtonStyle.green, row=1) async def inline(self, interaction: Interaction, button: ui.Button): # pylint: disable=unused-argument 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 change this setting.", ephemeral=True) @@ -99,6 +90,15 @@ class Guild(ui.View): await config.guild(interaction.guild).history_inline.set(not current_setting) await interaction.message.edit(embed=await guild(self.ctx)) + @ui.select(placeholder="Log Channel", cls=ui.ChannelSelect, row=2) + async def log_channel(self, interaction: Interaction, select: ui.ChannelSelect): + 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 change this setting.", ephemeral=True) + return + await interaction.response.defer() + await config.guild(interaction.guild).log_channel.set(select.values[0].id) + await interaction.message.edit(embed=await guild(self.ctx)) + @ui.select(placeholder="History Pagesize", options=create_pagesize_options(), row=3) async def pagesize(self, interaction: Interaction, select: ui.Select,): if not interaction.user.guild_permissions.manage_guild and not interaction.user.guild_permissions.administrator: