diff --git a/.vscode/settings.json b/.vscode/settings.json index a0b6d48..0ba4286 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,6 @@ "python.analysis.diagnosticSeverityOverrides": { "reportOptionalMemberAccess": false, "reportArgumentType": "information", - "reportAttributeAccessIssue": "information" + "reportAttributeAccessIssue": "warning" } } \ No newline at end of file diff --git a/cogs/commands/submission.py b/cogs/commands/submission.py index 4aeefd8..626c391 100644 --- a/cogs/commands/submission.py +++ b/cogs/commands/submission.py @@ -9,6 +9,7 @@ from sqlalchemy.orm import Session from cogs.submission.verification_view import VerificationView from database_setup.sql_data_classes import Category, CategoryGroup, Guild, Submission, engine +from main import logger from utilities.utils import GUILDS, autofill_categories, autofill_groups, submit_score @@ -86,6 +87,14 @@ class SubmissionCog(commands.Cog): "Registered Verification channel does not exist or was never registered. Contact server admins." ) await interaction.response.send_message(error_response, ephemeral=True) + return + + if not isinstance(channel, nextcord.TextChannel): + await interaction.response.send_message("An error happened with submission.") + logger.error( + "Channel id %s in guild %s is does not correspond to a TextChannel.", channel.id, channel.guild.id + ) + return # Send the verification message to admins verification_message = await channel.send(