automod: tweaks/fixes to spam detection

This commit is contained in:
Dragory 2020-07-30 22:47:33 +03:00
parent 4931c95872
commit 80fb9d7b6b
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
7 changed files with 18 additions and 11 deletions

View file

@ -2,8 +2,8 @@ import { PluginData } from "knub";
import { AutomodPluginType } from "../types";
import { RecentActionType } from "../constants";
export function findRecentSpam(pluginData: PluginData<AutomodPluginType>, type: RecentActionType, userId?: string) {
export function findRecentSpam(pluginData: PluginData<AutomodPluginType>, type: RecentActionType, identifier?: string) {
return pluginData.state.recentSpam.find(spam => {
return spam.type === type && (!userId || spam.userIds.includes(userId));
return spam.type === type && (!identifier || spam.identifiers.includes(identifier));
});
}