3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-06 18:47:20 +00:00
zeppelin/backend/src/plugins/Automod/functions/checkCooldown.ts
Tiago R 08a19eee81
fix automod cooldowns
Signed-off-by: GitHub <noreply@github.com>
2024-01-07 20:53:27 +00:00

14 lines
426 B
TypeScript

import { GuildPluginData } from "knub";
import { AutomodContext, AutomodPluginType, TRule } from "../types";
export function checkCooldown(pluginData: GuildPluginData<AutomodPluginType>, rule: TRule, context: AutomodContext) {
const cooldownKey = `${rule.name}-${context.user?.id}`;
if (cooldownKey) {
if (pluginData.state.cooldownManager.isOnCooldown(cooldownKey)) {
return true;
}
}
return false;
}