mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
fix(spam): recent actions being considered from all users, not just the author of the message being evaluated
This commit is contained in:
parent
96a9a189e0
commit
01a1f4cbe3
1 changed files with 2 additions and 0 deletions
|
@ -90,6 +90,7 @@ export class SpamPlugin extends Plugin {
|
|||
if (action.timestamp < since) return false;
|
||||
if (action.type !== type) return false;
|
||||
if (action.channelId !== channelId) return false;
|
||||
if (action.userId !== userId) return false;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
@ -99,6 +100,7 @@ export class SpamPlugin extends Plugin {
|
|||
if (action.timestamp < since) return count;
|
||||
if (action.type !== type) return count;
|
||||
if (action.channelId !== channelId) return count;
|
||||
if (action.userId !== userId) return false;
|
||||
return count + action.count;
|
||||
}, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue