diff --git a/cogs/commands/submission.py b/cogs/commands/submission.py index bf53d02..04faf48 100644 --- a/cogs/commands/submission.py +++ b/cogs/commands/submission.py @@ -20,7 +20,7 @@ class SubmissionCog(commands.Cog): return @nextcord.slash_command(guild_ids=GUILDS) - async def submit( + async def submit( # noqa: PLR0913 self, interaction: nextcord.Interaction, 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." ), 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( 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) # 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( "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 verification_message = await channel.send( - files=[await attach.to_file() for attach in interaction.message.attachments], + file=await proof.to_file(), view=VerificationView(), embeds=[self.create_embed(interaction, group_id, category_id, verified_score, username, session)], content=f"Submission from <@{interaction.user.id}>.", @@ -112,6 +115,7 @@ class SubmissionCog(commands.Cog): GuildId=interaction.guild_id, MessageId=verification_message.id, Score=verified_score, + UserId=interaction.user.id, UserName=username, )