diff --git a/.vscode/settings.json b/.vscode/settings.json index 1dc3b48..b198242 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,11 +7,12 @@ "imcompiling", "iterrows", "nextcord", - "ondelete" + "ondelete", + "pylance's" ], "python.analysis.diagnosticSeverityOverrides": { "reportOptionalMemberAccess": "warning", "reportArgumentType": "information", "reportAttributeAccessIssue": "warning" } -} \ No newline at end of file +} diff --git a/agon/cogs/commands/submission.py b/agon/cogs/commands/submission.py index 45ff971..88ab031 100644 --- a/agon/cogs/commands/submission.py +++ b/agon/cogs/commands/submission.py @@ -23,7 +23,7 @@ class SubmissionCog(commands.Cog): """Parent slash command for submitting scores. Never called.""" @submit.subcommand(name="int", description="Submit an integer type score.") - async def integer( + async def integer( # noqa: PLR0911, PLR0913 self, interaction: nextcord.Interaction, group_id: str = nextcord.SlashOption(name="group", required=True, description="Group to submit score to."), @@ -53,6 +53,10 @@ class SubmissionCog(commands.Cog): proof (nextcord.Attachment): Is SlashOption. Picture to provide proof of score. username (str, optional): Is SlashOption. Username to associate with the score. """ + if interaction.guild is None or interaction.user is None or interaction.guild_id is None: + # Type checking for pylance's sake. + await interaction.response.send_message("Error with guild or user.", ephemeral=True) + return # fill out username if not passed in if username is None: username = interaction.user.display_name