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:
parent
08a19eee81
commit
eff3b0cd56
2 changed files with 3 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue