3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-14 21:31:50 +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 a017aa7bfe
commit 205f7721ea
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

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;