mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +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
|
@ -1,7 +1,12 @@
|
|||
import { GuildPluginData } from "knub";
|
||||
import { AutomodContext, AutomodPluginType } from "../types";
|
||||
import { startProfiling } from "../../../utils/easyProfiler";
|
||||
|
||||
export function clearRecentActionsForMessage(pluginData: GuildPluginData<AutomodPluginType>, context: AutomodContext) {
|
||||
const stopProfiling = startProfiling(
|
||||
pluginData.getKnubInstance().profiler,
|
||||
"automod:fns:clearRecentActionsForMessage",
|
||||
);
|
||||
const message = context.message!;
|
||||
const globalIdentifier = message.user_id;
|
||||
const perChannelIdentifier = `${message.channel_id}-${message.user_id}`;
|
||||
|
@ -9,4 +14,5 @@ export function clearRecentActionsForMessage(pluginData: GuildPluginData<Automod
|
|||
pluginData.state.recentActions = pluginData.state.recentActions.filter((act) => {
|
||||
return act.identifier !== globalIdentifier && act.identifier !== perChannelIdentifier;
|
||||
});
|
||||
stopProfiling();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue