feat(suggestions): added jump link to context menu commands
Some checks failed
Pylint / Pylint (3.11.2) (push) Failing after 10s

This commit is contained in:
Seaswimmer 2023-09-23 16:02:19 -04:00
parent 609682bef5
commit 792848699b
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -609,6 +609,7 @@ class Suggestions(commands.Cog):
await self.config.custom("SUGGESTION", server, suggestion_id).denied.set(
True
)
return nmsg
class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."):
def __init__(self, message):
@ -626,10 +627,10 @@ class SuggestionApproveModal(discord.ui.Modal, title="Approving suggestion..."):
async def on_submit(self, interaction: discord.Interaction):
cog = interaction.client.get_cog('Suggestions')
if self.reason.value != "":
await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, True, self.reason.value)
nmsg = await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, True, self.reason.value)
else:
await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, True, None)
msg = await interaction.response.send_message(content="Suggestion approved!", ephemeral=True)
nmsg = await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, True, None)
msg = await interaction.response.send_message(content=f"Suggestion approved!\nJump Link: {nmsg.jump_url}", ephemeral=True)
await msg.delete(10)
class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."):
@ -648,10 +649,10 @@ class SuggestionDenyModal(discord.ui.Modal, title="Denying suggestion..."):
async def on_submit(self, interaction: discord.Interaction):
cog = interaction.client.get_cog('Suggestions')
if self.reason.value != "":
await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, False, self.reason.value)
nmsg = await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, False, self.reason.value)
else:
await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, False, None)
msg: discord.Message = await interaction.response.send_message(content="Suggestion denied!", ephemeral=True)
nmsg = await Suggestions._interaction_finish_suggestion(cog, interaction, self.message, False, None)
msg: discord.Message = await interaction.response.send_message(content=f"Suggestion denied!\nJump Link: {nmsg.jump_url}", ephemeral=True)
await msg.delete(10)
@app_commands.context_menu(name="Approve Suggestion")