mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-23 17:45:03 +00:00
17 lines
637 B
TypeScript
17 lines
637 B
TypeScript
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,
|
|
) {
|
|
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;
|
|
}
|