Add logging message for admins, trying to move message with buttons.

This commit is contained in:
alwayscompiling
2022-07-03 17:29:39 -04:00
parent 02ba90134e
commit a8aad570d3
+13 -3
View File
@@ -1,5 +1,6 @@
"""View for verification buttons"""
from code import interact
import nextcord
from utilities.utils import submit_score # pylint: disable=import-error
@@ -11,9 +12,10 @@ class VerificationView(nextcord.ui.View):
super().__init__(timeout=None)
@nextcord.ui.button(label="Approve", style=nextcord.ButtonStyle.green, custom_id="approve")
async def approve_button(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
async def approve_button(
self, button: nextcord.ui.Button, interaction: nextcord.Interaction
): # pylint: disable=unused-argument
"""Button for approving score submission."""
await interaction.response.send_message("Approved")
content = interaction.message.content.split(":")
user = content[0]
boss_name = content[1]
@@ -21,8 +23,16 @@ class VerificationView(nextcord.ui.View):
score = content[3]
await submit_score(interaction, user, boss_name, category, score)
await interaction.delete_original_message # TODO doesn't work
await interaction.channel.send(
f"Approved: {boss_name} {category} {user} {score}",
files=[await attch.to_file() for attch in interaction.message.attachments],
)
@nextcord.ui.button(label="Deny", style=nextcord.ButtonStyle.red, custom_id="deny")
async def deny_button(self, button: nextcord.ui.Button, interaction: nextcord.Interaction):
async def deny_button(
self, button: nextcord.ui.Button, interaction: nextcord.Interaction
): # pylint: disable=unused-argument
"""Button for denying score submission."""
await interaction.response.send_message("Denied")
await interaction.delete_original_message