Skip to content

Commit e1d03c7

Browse files
Adding mod channel check suggestion
Co-authored-by: ExampleWasTaken <[email protected]>
1 parent 4f98a3d commit e1d03c7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/commands/moderation/prefixCommands/functions/modifyCategory.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ export async function handleModifyPrefixCommandCategory(interaction: ChatInputCo
6565
const moderator = interaction.user;
6666

6767
//Check if the mod logs channel exists
68-
const modLogsChannel = interaction.guild.channels.resolve(constantsConfig.channels.MOD_LOGS) as TextChannel;
69-
if (!modLogsChannel) {
68+
let modLogsChannel = interaction.guild.channels.resolve(constantsConfig.channels.MOD_LOGS);
69+
if (!modLogsChannel || !modLogsChannel.isTextBased()) {
70+
modLogsChannel = null;
7071
await interaction.followUp({ embeds: [noModLogs], ephemeral: true });
7172
}
7273

0 commit comments

Comments
 (0)