From 55867ea12a5e1677d7931763ca5b8b9596dd2944 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 21 Sep 2023 11:28:05 -0400 Subject: [PATCH] fix(suggestions): hopefully fixed an attributeerror --- suggestions/suggestions.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/suggestions/suggestions.py b/suggestions/suggestions.py index 15d8e35..d0ae592 100644 --- a/suggestions/suggestions.py +++ b/suggestions/suggestions.py @@ -599,9 +599,8 @@ class Suggestions(commands.Cog): ) class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."): - def __init__(self, cog_instance, message): + def __init__(self, message): super().__init__() - self.cog_instance = cog_instance self.message = message reason = discord.ui.TextInput( @@ -614,15 +613,14 @@ class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."): async def on_submit(self, interaction: discord.Interaction): if self.reason.value != "": - await self.cog_instance.interaction_finish_suggestion(interaction, self.message, True, self.reason.value) + await Suggestions._interaction_finish_suggestion(interaction, self.message, True, self.reason.value) else: - await self.cog_instance.interaction_finish_suggestion(interaction, self.message, True, None) + await Suggestions._interaction_finish_suggestion(interaction, self.message, True, None) await interaction.response.send_message(content="Suggestion approved!", ephemeral=True) class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."): - def __init__(self, cog_instance, message): + def __init__(self, message): super().__init__() - self.cog_instance = cog_instance self.message = message reason = discord.ui.TextInput( @@ -635,15 +633,15 @@ class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."): async def on_submit(self, interaction: discord.Interaction): if self.reason.value != "": - await self.cog_instance.interaction_finish_suggestion(interaction, self.message, False, self.reason.value) + await Suggestions._interaction_finish_suggestion(interaction, self.message, False, self.reason.value) else: - await self.cog_instance.interaction_finish_suggestion(interaction, self.message, False, None) + await Suggestions._interaction_finish_suggestion(interaction, self.message, False, None) await interaction.response.send_message(content="Suggestion denied!", ephemeral=True) @app_commands.context_menu(name="Approve Suggestion") async def approve_context(interaction: discord.Interaction, message: discord.Message): - await interaction.response.send_modal(SuggestionApproveModal(Suggestions, message)) + await interaction.response.send_modal(SuggestionApproveModal(message)) @app_commands.context_menu(name="Deny Suggestion") async def deny_context(interaction: discord.Interaction, message: discord.Message): - await interaction.response.send_modal(SuggestionDenyModal(Suggestions, message)) + await interaction.response.send_modal(SuggestionDenyModal(message))