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

fix automod cooldowns

Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
Tiago R 2024-01-07 20:53:27 +00:00 committed by GitHub
parent 8a4a2d3647
commit 08a19eee81
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 13 deletions

View file

@ -0,0 +1,14 @@
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;
}