From 1c34be948afc94ee4650ee34620fe749b95eb0c5 Mon Sep 17 00:00:00 2001 From: janderedev Date: Sat, 19 Mar 2022 21:16:21 +0100 Subject: [PATCH] fix automod rules not working on empty channel arr --- bot/src/bot/modules/antispam.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bot/src/bot/modules/antispam.ts b/bot/src/bot/modules/antispam.ts index 7ddb375..e02fa71 100644 --- a/bot/src/bot/modules/antispam.ts +++ b/bot/src/bot/modules/antispam.ts @@ -31,7 +31,7 @@ async function antispam(message: Message): Promise { if (serverRules.whitelist?.users?.includes(message.author_id)) break; if (message.member?.roles?.filter(r => serverRules.whitelist?.roles?.includes(r)).length) break; if (serverRules.whitelist?.managers !== false && await isModerator(message)) break; - if (rule.channels?.indexOf(message.channel_id) == -1) break; + if (rule.channels?.length && rule.channels.indexOf(message.channel_id) == -1) break; let store = msgCountStore.get(rule.id)!; if (!store.users[message.channel_id]) store.users[message.channel_id] = {}