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:
parent
2fa817d27a
commit
ebd18e5374
8 changed files with 43 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue