3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 00:05:04 +00:00

automod: treat unknown users as bots

Primarily because of webhooks that don't have a real user
associated with them.
This commit is contained in:
Dragory 2020-09-17 22:17:30 +03:00
parent 788ef9954c
commit 46ade30efb

View file

@ -23,7 +23,7 @@ export async function runAutomod(pluginData: PluginData<AutomodPluginType>, cont
for (const [ruleName, rule] of Object.entries(config.rules)) {
if (rule.enabled === false) continue;
if (!rule.affects_bots && user?.bot) continue;
if (!rule.affects_bots && (!user || user.bot)) continue;
if (rule.cooldown && checkAndUpdateCooldown(pluginData, rule, context)) {
return;