From c134a3ed181e285cd52501a8210811e99d12f8ce Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Mon, 12 Aug 2024 17:42:46 -0400 Subject: [PATCH] fix(aurora): maybe fixed a TypeError? --- aurora/menus/types.py | 16 ++++++++-------- aurora/utilities/config.py | 4 ++-- aurora/utilities/factory.py | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/aurora/menus/types.py b/aurora/menus/types.py index 8946c28..3850a6a 100644 --- a/aurora/menus/types.py +++ b/aurora/menus/types.py @@ -23,8 +23,8 @@ class Types(ui.View): 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.custom("type", interaction.guild.id, self.type.key).show_in_history() - await config.custom("type", interaction.guild.id, self.type.key).show_in_history.set(not current_setting) + current_setting = await config.custom("types", interaction.guild.id, self.type.key).show_in_history() + await config.custom("types", interaction.guild.id, self.type.key).show_in_history.set(not current_setting) await interaction.message.edit(embed=await type_embed(self.ctx, self.type)) @ui.button(label="Show Moderator", style=ButtonStyle.green, row=0) @@ -33,8 +33,8 @@ class Types(ui.View): 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.custom("type", interaction.guild.id, self.type.key).show_moderator() - await config.custom("type", interaction.guild.id, self.type.key).show_moderator.set(not current_setting) + current_setting = await config.custom("types", interaction.guild.id, self.type.key).show_moderator() + await config.custom("types", interaction.guild.id, self.type.key).show_moderator.set(not current_setting) await interaction.message.edit(embed=await type_embed(self.ctx, self.type)) @ui.button(label="Use Discord Permissions", style=ButtonStyle.green, row=0) @@ -43,8 +43,8 @@ class Types(ui.View): 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.custom("type", interaction.guild.id, self.type.key).use_discord_permissions() - await config.custom("type", interaction.guild.id, self.type.key).use_discord_permissions.set(not current_setting) + current_setting = await config.custom("types", interaction.guild.id, self.type.key).use_discord_permissions() + await config.custom("types", interaction.guild.id, self.type.key).use_discord_permissions.set(not current_setting) await interaction.message.edit(embed=await type_embed(self.ctx, self.type)) @ui.button(label="DM Users", style=ButtonStyle.green, row=0) @@ -53,6 +53,6 @@ class Types(ui.View): 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.custom("type", interaction.guild.id, self.type.key).dm_users() - await config.custom("type", interaction.guild.id, self.type.key).dm_users.set(not current_setting) + current_setting = await config.custom("types", interaction.guild.id, self.type.key).dm_users() + await config.custom("types", interaction.guild.id, self.type.key).dm_users.set(not current_setting) await interaction.message.edit(embed=await type_embed(self.ctx, self.type)) diff --git a/aurora/utilities/config.py b/aurora/utilities/config.py index 5fa9f19..068cb20 100644 --- a/aurora/utilities/config.py +++ b/aurora/utilities/config.py @@ -35,5 +35,5 @@ def register_config(config_obj: Config): "dm_users": bool, } - config_obj.init_custom("type", 2) - config_obj.register_custom("type", **moderation_type) + config_obj.init_custom("types", 2) + config_obj.register_custom("types", **moderation_type) diff --git a/aurora/utilities/factory.py b/aurora/utilities/factory.py index dc38918..6bc5cd3 100644 --- a/aurora/utilities/factory.py +++ b/aurora/utilities/factory.py @@ -549,10 +549,10 @@ async def type_embed(ctx: commands.Context, moderation_type = Type) -> Embed: """Generates a configuration menu field value for a guild's settings.""" type_settings = { - "show_in_history": await config.custom("type", ctx.guild.id, moderation_type.key).show_in_history(), - "show_moderator": await config.custom("type", ctx.guild.id, moderation_type.key).show_moderator(), - "use_discord_permissions": await config.custom("type", ctx.guild.id, moderation_type.key).use_discord_permissions(), - "dm_users": await config.custom("type", ctx.guild.id, moderation_type.key).dm_users(), + "show_in_history": await config.custom("types", ctx.guild.id, moderation_type.key).show_in_history(), + "show_moderator": await config.custom("types", ctx.guild.id, moderation_type.key).show_moderator(), + "use_discord_permissions": await config.custom("types", ctx.guild.id, moderation_type.key).use_discord_permissions(), + "dm_users": await config.custom("types", ctx.guild.id, moderation_type.key).dm_users(), } guild_str = [