3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-07-06 18:47:20 +00:00

almeida fixes

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

View file

@ -5,10 +5,6 @@ import { AutomodContext, AutomodPluginType, TRule } from "../types";
export function applyCooldown(pluginData: GuildPluginData<AutomodPluginType>, rule: TRule, context: AutomodContext) {
const cooldownKey = `${rule.name}-${context.user?.id}`;
if (cooldownKey) {
const cooldownTime = convertDelayStringToMS(rule.cooldown, "s");
if (cooldownTime) {
pluginData.state.cooldownManager.setCooldown(cooldownKey, cooldownTime);
}
}
const cooldownTime = convertDelayStringToMS(rule.cooldown, "s");
if (cooldownTime) pluginData.state.cooldownManager.setCooldown(cooldownKey, cooldownTime);
}

View file

@ -4,11 +4,5 @@ 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;
return pluginData.state.cooldownManager.isOnCooldown(cooldownKey);
}