feat(suggestions): added more checking to approve/deny to prevent them from being used on random messages
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
298bf8a3dc
commit
694d8d01de
1 changed files with 8 additions and 2 deletions
|
@ -663,8 +663,14 @@ class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."):
|
|||
|
||||
@app_commands.context_menu(name="Approve Suggestion")
|
||||
async def approve_context(interaction: discord.Interaction, message: discord.Message):
|
||||
await interaction.response.send_modal(SuggestionApproveModal(message))
|
||||
if message.author.id == interaction.client.user.id and len(message.embeds) == 1 and message.embeds[0].title.startswith('Suggestion #'):
|
||||
await interaction.response.send_modal(SuggestionApproveModal(message))
|
||||
else:
|
||||
await interaction.response.send_message(content="This is not a suggestion!", ephemeral=True)
|
||||
|
||||
@app_commands.context_menu(name="Deny Suggestion")
|
||||
async def deny_context(interaction: discord.Interaction, message: discord.Message):
|
||||
await interaction.response.send_modal(SuggestionDenyModal(message))
|
||||
if message.author.id == interaction.client.user.id and len(message.embeds) == 1 and message.embeds[0].title.startswith('Suggestion #'):
|
||||
await interaction.response.send_modal(SuggestionDenyModal(message))
|
||||
else:
|
||||
await interaction.response.send_message(content="This is not a suggestion!", ephemeral=True)
|
||||
|
|
Loading…
Reference in a new issue