mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-06 18:47:20 +00:00
14 lines
426 B
TypeScript
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;
|
|
}
|