From 6ee67f40e70d41761ea9d8aee4e7b1577f9cebe4 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 7 Sep 2023 19:34:46 -0400 Subject: [PATCH] fix(forums): fixed incorrect argument positioning causing errors with buttons --- forums/forums.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/forums/forums.py b/forums/forums.py index 46784c9..5ae5a61 100644 --- a/forums/forums.py +++ b/forums/forums.py @@ -45,10 +45,9 @@ class Forums(commands.Cog): self.config = Config.get_conf(None, cog_name='Forums', identifier=2352711325) @ui.button(label="Yes", style=discord.ButtonStyle.success, emoji="✅") - async def resolved_button_yes(self, button: ui.Button, interaction: discord.Interaction): - match = any(role_id in interaction.user.roles for role_id in await self.config.guild(self.ctx.guild).request_roles()) + async def resolved_button_yes(self, interaction: discord.Interaction, button: ui.Button): + match = any(role_id in interaction.user.roles for role_id in await self.config.guild(interaction.guild).request_roles()) if match or interaction.user.id == interaction.channel.owner.id: - channel = self.ctx.channel await interaction.response.defer() if self.reason: response_reason = f"Thread closed by {interaction.user.mention} with reason: {self.reason}" @@ -56,15 +55,15 @@ class Forums(commands.Cog): else: response_reason = f"Thread closed by {interaction.user.mention}" reason = f"Thread closed by {interaction.user.name} ({interaction.user.id})" - await channel.edit(locked=True, archived=True, applied_tags=channel.applied_tags + await self.config.guild(channel.guild).forum_tag(), reason=reason) + await interaction.channel.edit(locked=True, archived=True, applied_tags=interaction.channel.applied_tags + await self.config.guild(interaction.guild).forum_tag(), reason=reason) await self.msg.edit(content=response_reason, view=None) await self.ctx.message.add_reaction("✅") else: await interaction.response.send_message(content="You cannot close this thread!", ephemeral=True) @ui.button(label="No", style=discord.ButtonStyle.danger, emoji="✖️") - async def resolved_button_no(self, button: ui.Button, interaction: discord.Interaction): - match = any(role_id in interaction.user.roles for role_id in await self.config.guild(self.ctx.guild).request_roles()) + async def resolved_button_no(self, interaction: discord.Interaction, button: ui.Button): + match = any(role_id in interaction.user.roles for role_id in await self.config.guild(interaction.guild).request_roles()) if match or interaction.user.id == interaction.channel.owner.id: await interaction.response.defer() await self.msg.delete()