3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-21 16:55:03 +00:00

fix channel type check

This commit is contained in:
metal 2021-09-01 15:35:20 +00:00 committed by GitHub
parent 4add2c4e10
commit 50eb51cc0e

View file

@ -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<TextChannel | ThreadChannel> = [];
if (channel.type === ChannelTypeStrings.CATEGORY) {