feat(suggestions): the epheremal "suggestion approved" or "suggestion denied" message will now be deleted after 10 seconds
Some checks reported warnings
Gitea Actions Demo / Explore-Gitea-Actions (push) Has been cancelled

This commit is contained in:
Seaswimmer 2023-09-21 13:01:42 -04:00
parent 694d8d01de
commit 480ff5915f
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -1,8 +1,7 @@
import datetime
import re import re
import typing import typing
import discord import discord
from redbot.core import app_commands, Config, checks, commands from redbot.core import Config, app_commands, checks, commands
from redbot.core.bot import Red from redbot.core.bot import Red
@ -638,7 +637,8 @@ class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."):
await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, True, self.reason.value) await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, True, self.reason.value)
else: else:
await Suggestions._interaction_finish_suggestion(cog, 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) msg = await interaction.response.send_message(content="Suggestion approved!", ephemeral=True)
await msg.delete(10)
class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."): class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."):
def __init__(self, message): def __init__(self, message):
@ -659,7 +659,8 @@ class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."):
await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, False, self.reason.value) await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, False, self.reason.value)
else: else:
await Suggestions._interaction_finish_suggestion(cog, 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) msg: discord.Message = await interaction.response.send_message(content="Suggestion denied!", ephemeral=True)
await msg.delete(10)
@app_commands.context_menu(name="Approve Suggestion") @app_commands.context_menu(name="Approve Suggestion")
async def approve_context(interaction: discord.Interaction, message: discord.Message): async def approve_context(interaction: discord.Interaction, message: discord.Message):