3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-11 21:17:19 +00:00

WIP ModActions

This commit is contained in:
Dragory 2020-07-23 00:37:33 +03:00
parent aef2b4f43a
commit b72a76b27e
25 changed files with 1162 additions and 6 deletions

View file

@ -0,0 +1,20 @@
import { PluginData } from "knub";
import { IgnoredEventType, ModActionsPluginType } from "../types";
import { SECONDS } from "../../../utils";
import { clearIgnoredEvent } from "./clearIgnoredEvents";
const DEFAULT_TIMEOUT = 15 * SECONDS;
export function ignoreEvent(
pluginData: PluginData<ModActionsPluginType>,
type: IgnoredEventType,
userId: string,
timeout = DEFAULT_TIMEOUT,
) {
pluginData.state.ignoredEvents.push({ type, userId });
// Clear after expiry (15sec by default)
setTimeout(() => {
clearIgnoredEvent(pluginData, type, userId);
}, timeout);
}