From 8c3a21e474ba03897ad5d7d881d1ec09e69202cb Mon Sep 17 00:00:00 2001 From: Philippe Dellaert Date: Sat, 26 Oct 2024 23:48:33 -0700 Subject: [PATCH] Adding mod channel check suggestion Co-authored-by: ExampleWasTaken <58574351+ExampleWasTaken@users.noreply.github.com> --- .../moderation/prefixCommands/functions/setContent.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/moderation/prefixCommands/functions/setContent.ts b/src/commands/moderation/prefixCommands/functions/setContent.ts index 40657081..ba59fae9 100644 --- a/src/commands/moderation/prefixCommands/functions/setContent.ts +++ b/src/commands/moderation/prefixCommands/functions/setContent.ts @@ -191,8 +191,9 @@ export async function handleSetPrefixCommandContent(interaction: ChatInputComman return; } //Check if the mod logs channel exists - const modLogsChannel = interaction.guild.channels.resolve(constantsConfig.channels.MOD_LOGS) as TextChannel; - if (!modLogsChannel) { + let modLogsChannel = interaction.guild.channels.resolve(constantsConfig.channels.MOD_LOGS); + if (!modLogsChannel || !modLogsChannel.isTextBased()) { + modLogsChannel = null; await interaction.followUp({ embeds: [noModLogs], ephemeral: true }); }