3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-24 01:55:03 +00:00

debug: re-enable Automod with extra profiling

This commit is contained in:
Dragory 2021-10-05 23:49:00 +03:00
parent 2fa817d27a
commit ebd18e5374
8 changed files with 43 additions and 8 deletions

View file

@ -1,13 +1,17 @@
import { GuildPluginData } from "knub";
import { RecentActionType } from "../constants";
import { AutomodPluginType } from "../types";
import { startProfiling } from "../../../utils/easyProfiler";
export function findRecentSpam(
pluginData: GuildPluginData<AutomodPluginType>,
type: RecentActionType,
identifier?: string,
) {
return pluginData.state.recentSpam.find((spam) => {
const stopProfiling = startProfiling(pluginData.getKnubInstance().profiler, "automod:fns:findRecentSpam");
const result = pluginData.state.recentSpam.find((spam) => {
return spam.type === type && (!identifier || spam.identifiers.includes(identifier));
});
stopProfiling();
return result;
}