From 4c3c0301125e6835d9408a30d5b0f792c8466383 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 21 Sep 2023 12:28:12 -0400 Subject: [PATCH] fix(suggestions): fixed context menu commands --- suggestions/suggestions.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/suggestions/suggestions.py b/suggestions/suggestions.py index d0ae592..69b3875 100644 --- a/suggestions/suggestions.py +++ b/suggestions/suggestions.py @@ -2,7 +2,7 @@ import datetime import re import typing import discord -from redbot.core import app_commands, Config, checks, commands +from redbot.core import app_commands, Config, checks, commands, bot from redbot.core.bot import Red from redbot.core.utils.chat_formatting import humanize_list @@ -612,10 +612,11 @@ class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."): ) async def on_submit(self, interaction: discord.Interaction): + cog = bot.get_cog('Suggestions') if self.reason.value != "": - await Suggestions._interaction_finish_suggestion(interaction, self.message, True, self.reason.value) + await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, True, self.reason.value) else: - await Suggestions._interaction_finish_suggestion(interaction, self.message, True, None) + await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, True, None) await interaction.response.send_message(content="Suggestion approved!", ephemeral=True) class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."): @@ -632,10 +633,11 @@ class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."): ) async def on_submit(self, interaction: discord.Interaction): + cog = bot.get_cog('Suggestions') if self.reason.value != "": - await Suggestions._interaction_finish_suggestion(interaction, self.message, False, self.reason.value) + await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, False, self.reason.value) else: - await Suggestions._interaction_finish_suggestion(interaction, self.message, False, None) + await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, False, None) await interaction.response.send_message(content="Suggestion denied!", ephemeral=True) @app_commands.context_menu(name="Approve Suggestion")