fix automod rules not working on empty channel arr

This commit is contained in:
janderedev 2022-03-19 21:16:21 +01:00
parent 9a94e84b54
commit 1c34be948a
No known key found for this signature in database
GPG key ID: 5D5E18ACB990F57A

View file

@ -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] = {}