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:
parent
4add2c4e10
commit
50eb51cc0e
1 changed files with 1 additions and 15 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue