Add isinstance check for text channel.

This commit is contained in:
2025-02-20 11:08:03 -05:00
parent 1902c486fd
commit d3aaf642bd
2 changed files with 10 additions and 1 deletions
+9
View File
@@ -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(