From 50eb51cc0e7a99b299043e918ced9d123e932737 Mon Sep 17 00:00:00 2001 From: metal Date: Wed, 1 Sep 2021 15:35:20 +0000 Subject: [PATCH] fix channel type check --- .../src/plugins/Automod/actions/setSlowmode.ts | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/backend/src/plugins/Automod/actions/setSlowmode.ts b/backend/src/plugins/Automod/actions/setSlowmode.ts index c9a628d9..8e2a7b70 100644 --- a/backend/src/plugins/Automod/actions/setSlowmode.ts +++ b/backend/src/plugins/Automod/actions/setSlowmode.ts @@ -23,22 +23,8 @@ export const SetSlowmodeAction = automodAction({ } for (const channelId of channels) { const channel = pluginData.guild.channels.cache.get(channelId as Snowflake); - // Only text channels and text channels within categories support slowmodes - if ( - !channel || - !( - [ - ChannelTypeStrings.TEXT, - ChannelTypeStrings.CATEGORY, - ChannelTypeStrings.PUBLIC_THREAD, - ChannelTypeStrings.NEWS_THREAD, - ChannelTypeStrings.PRIVATE_THREAD, - ].includes(channel.type) - ) - ) { - continue; - } + if (!channel?.isText() && channel?.type !== ChannelTypeStrings.CATEGORY) continue; const channelsToSlowmode: Array = []; if (channel.type === ChannelTypeStrings.CATEGORY) {