Automod work vol 3

This commit is contained in:
Dragory 2020-07-27 22:19:34 +03:00
parent 0e9f65e0d5
commit 0f0728bc1c
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
18 changed files with 133 additions and 38 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, userId?: string) {
return pluginData.state.recentSpam.find(spam => {
return spam.type === type && spam.userId === userId;
return spam.type === type && (!userId || spam.userIds.includes(userId));
});
}