Compare commits

..

No commits in common. "0529842b62fdc272870724968883e65b7cedb67c" and "b6b144bb21feb20a6bb3950fbcae629b0a442129" have entirely different histories.

View file

@ -46,9 +46,8 @@ class Forums(commands.Cog):
@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())
match = any(role_id in interaction.user.roles for role_id in await self.config.guild(interaction.channel.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.channel.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="✖️")
@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())
match = any(role_id in interaction.user.roles for role_id in await self.config.guild(interaction.channel.guild).request_roles())
if match or interaction.user.id == interaction.channel.owner.id:
await interaction.response.defer()
await self.msg.delete()
@ -72,7 +71,7 @@ class Forums(commands.Cog):
else:
await interaction.response.send_message(content="You cannot close this thread!", ephemeral=True)
@commands.group(name='forumsconfig', invoke_without_command=True, aliases=['forumconfig'])
@commands.group(name='forumconfig', invoke_without_command=True, aliases=['forumsset'])
@commands.guild_only()
@commands.admin()
async def forumsconfig(self, ctx: commands.Context):