Skip to content

Commit

Permalink
Adding mod channel check suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: ExampleWasTaken <[email protected]>
  • Loading branch information
pdellaert and ExampleWasTaken authored Oct 27, 2024
1 parent e625074 commit 75afd64
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ export async function handleDeletePrefixCommand(interaction: ChatInputCommandInt
const moderator = interaction.user;

//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 });
}

Expand Down

0 comments on commit 75afd64

Please sign in to comment.