3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-16 22:55:03 +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:
Miikka 2018-08-03 11:23:08 +03:00 committed by GitHub
parent f165c906ad
commit 46ba73c6e6

View file

@ -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);
}