Add a todo to rework how approval interacts with information.
This commit is contained in:
@@ -20,7 +20,7 @@ class SubmissionCog(commands.Cog):
|
|||||||
return
|
return
|
||||||
|
|
||||||
@nextcord.slash_command(guild_ids=GUILDS)
|
@nextcord.slash_command(guild_ids=GUILDS)
|
||||||
async def submit(
|
async def submit( # noqa: PLR0913
|
||||||
self,
|
self,
|
||||||
interaction: nextcord.Interaction,
|
interaction: nextcord.Interaction,
|
||||||
group_id: str = nextcord.SlashOption(name="group", required=True, description="Group to submit score to."),
|
group_id: str = nextcord.SlashOption(name="group", required=True, description="Group to submit score to."),
|
||||||
@@ -28,6 +28,9 @@ class SubmissionCog(commands.Cog):
|
|||||||
name="category", required=True, description="Category to submit score to."
|
name="category", required=True, description="Category to submit score to."
|
||||||
),
|
),
|
||||||
score: str = nextcord.SlashOption(required=True, description="Score to submit"),
|
score: str = nextcord.SlashOption(required=True, description="Score to submit"),
|
||||||
|
proof: nextcord.Attachment = nextcord.SlashOption(
|
||||||
|
required=False, description="Proof for submission. Only needed if score requires verification."
|
||||||
|
),
|
||||||
username: str = nextcord.SlashOption(
|
username: str = nextcord.SlashOption(
|
||||||
required=False, description="Modified username if submitting under not your discord name."
|
required=False, description="Modified username if submitting under not your discord name."
|
||||||
),
|
),
|
||||||
@@ -58,7 +61,7 @@ class SubmissionCog(commands.Cog):
|
|||||||
category: Category = session.scalar(stmt)
|
category: Category = session.scalar(stmt)
|
||||||
|
|
||||||
# check if verification is required. if no picture, deny
|
# check if verification is required. if no picture, deny
|
||||||
if category.IsValidated and not len(interaction.message.attachments) > 0:
|
if category.IsValidated and proof is None:
|
||||||
await interaction.response.send_message(
|
await interaction.response.send_message(
|
||||||
"This category required verification. Please attach a picture and re-submit.", ephemeral=True
|
"This category required verification. Please attach a picture and re-submit.", ephemeral=True
|
||||||
)
|
)
|
||||||
@@ -98,7 +101,7 @@ class SubmissionCog(commands.Cog):
|
|||||||
|
|
||||||
# Send the verification message to admins
|
# Send the verification message to admins
|
||||||
verification_message = await channel.send(
|
verification_message = await channel.send(
|
||||||
files=[await attach.to_file() for attach in interaction.message.attachments],
|
file=await proof.to_file(),
|
||||||
view=VerificationView(),
|
view=VerificationView(),
|
||||||
embeds=[self.create_embed(interaction, group_id, category_id, verified_score, username, session)],
|
embeds=[self.create_embed(interaction, group_id, category_id, verified_score, username, session)],
|
||||||
content=f"Submission from <@{interaction.user.id}>.",
|
content=f"Submission from <@{interaction.user.id}>.",
|
||||||
@@ -112,6 +115,7 @@ class SubmissionCog(commands.Cog):
|
|||||||
GuildId=interaction.guild_id,
|
GuildId=interaction.guild_id,
|
||||||
MessageId=verification_message.id,
|
MessageId=verification_message.id,
|
||||||
Score=verified_score,
|
Score=verified_score,
|
||||||
|
UserId=interaction.user.id,
|
||||||
UserName=username,
|
UserName=username,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user