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:
parent
a017aa7bfe
commit
205f7721ea
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ export async function runAutomod(pluginData: PluginData<AutomodPluginType>, cont
|
||||||
|
|
||||||
for (const [ruleName, rule] of Object.entries(config.rules)) {
|
for (const [ruleName, rule] of Object.entries(config.rules)) {
|
||||||
if (rule.enabled === false) continue;
|
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)) {
|
if (rule.cooldown && checkAndUpdateCooldown(pluginData, rule, context)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue