mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-13 21:35:02 +00:00
debug: re-enable Automod with extra profiling
This commit is contained in:
parent
2d012bc5cf
commit
53d7491c1b
8 changed files with 43 additions and 8 deletions
backend/src/plugins/Automod/functions
|
@ -1,10 +1,13 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { RECENT_SPAM_EXPIRY_TIME } from "../constants";
|
||||
import { AutomodPluginType } from "../types";
|
||||
import { startProfiling } from "../../../utils/easyProfiler";
|
||||
|
||||
export function clearOldRecentSpam(pluginData: GuildPluginData<AutomodPluginType>) {
|
||||
const stopProfiling = startProfiling(pluginData.getKnubInstance().profiler, "automod:fns:clearOldRecentSpam");
|
||||
const now = Date.now();
|
||||
pluginData.state.recentSpam = pluginData.state.recentSpam.filter((spam) => {
|
||||
return spam.timestamp + RECENT_SPAM_EXPIRY_TIME > now;
|
||||
});
|
||||
stopProfiling();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue