From 209c32b3bf03ca4b70cb9dc79a4a71cfc988a1cb Mon Sep 17 00:00:00 2001 From: Philippe Dellaert Date: Sat, 26 Oct 2024 23:43:12 -0700 Subject: [PATCH] Adding mod channel check suggestion Co-authored-by: ExampleWasTaken <58574351+ExampleWasTaken@users.noreply.github.com> --- .../moderation/prefixCommands/functions/addCommand.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/moderation/prefixCommands/functions/addCommand.ts b/src/commands/moderation/prefixCommands/functions/addCommand.ts index ebcbe8a6..1e2c1ebd 100644 --- a/src/commands/moderation/prefixCommands/functions/addCommand.ts +++ b/src/commands/moderation/prefixCommands/functions/addCommand.ts @@ -130,8 +130,9 @@ export async function handleAddPrefixCommand(interaction: ChatInputCommandIntera } //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 }); }