fix(forums): fixed 400 bad request error if the forum post already has the resolved tag
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled
This commit is contained in:
parent
698ba7645a
commit
0c9dcba375
1 changed files with 5 additions and 1 deletions
|
@ -60,7 +60,11 @@ class Forums(commands.Cog):
|
|||
reason = f"Thread closed by {interaction.user.name} ({interaction.user.id})"
|
||||
await self.msg.edit(content=response_reason, view=None)
|
||||
await self.ctx.message.add_reaction("✅")
|
||||
await interaction.channel.edit(locked=True, archived=True, applied_tags=interaction.channel.applied_tags + [interaction.channel.parent.get_tag(await self.config.guild(interaction.guild).forum_tag())], reason=reason)
|
||||
tag = interaction.channel.parent.get_tag(await self.config.guild(interaction.guild).forum_tag())
|
||||
if tag in interaction.channel.applied_tags:
|
||||
await interaction.channel.edit(locked=True, archived=True, reason=reason)
|
||||
else:
|
||||
await interaction.channel.edit(locked=True, archived=True, applied_tags=interaction.channel.applied_tags + [tag], reason=reason)
|
||||
else:
|
||||
await interaction.response.send_message(content="You cannot close this thread!", ephemeral=True)
|
||||
|
||||
|
|
Loading…
Reference in a new issue