From 840eca6608536500faa4bd2115af1005c399b0c6 Mon Sep 17 00:00:00 2001 From: Philippe Dellaert Date: Sat, 26 Oct 2024 23:42:57 -0700 Subject: [PATCH] Adding mod channel check suggestion Co-authored-by: ExampleWasTaken <58574351+ExampleWasTaken@users.noreply.github.com> --- .../moderation/prefixCommands/functions/deleteVersion.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/moderation/prefixCommands/functions/deleteVersion.ts b/src/commands/moderation/prefixCommands/functions/deleteVersion.ts index 3e9f7644..dc9fbdef 100644 --- a/src/commands/moderation/prefixCommands/functions/deleteVersion.ts +++ b/src/commands/moderation/prefixCommands/functions/deleteVersion.ts @@ -85,8 +85,9 @@ export async function handleDeletePrefixCommandVersion(interaction: ChatInputCom //Check if the mod logs channel exists const modLogsChannel = interaction.guild.channels.resolve(constantsConfig.channels.MOD_LOGS) as TextChannel; - if (!modLogsChannel) { - await interaction.followUp({ embeds: [noModLogs], ephemeral: true }); + let modLogsChannel = interaction.guild.channels.resolve(constantsConfig.channels.MOD_LOGS); + if (!modLogsChannel || !modLogsChannel.isTextBased()) { + modLogsChannel = null; } const existingVersion = await PrefixCommandVersion.findOne({ name: version });