mirror of
https://github.com/janderedev/automod.git
synced 2024-12-22 10:45:27 +00:00
fix automod rules not working on empty channel arr
This commit is contained in:
parent
9a94e84b54
commit
1c34be948a
|
@ -31,7 +31,7 @@ async function antispam(message: Message): Promise<boolean> {
|
|||
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] = {}
|
||||
|
|
Loading…
Reference in a new issue