automod: fix cooldowns applying across rules

This commit is contained in:
Dragory 2021-04-02 17:59:41 +03:00
parent 9ac4e15573
commit 4f66f004d5
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -8,7 +8,7 @@ export function checkAndUpdateCooldown(
rule: TRule,
context: AutomodContext,
) {
const cooldownKey = context.user?.id;
const cooldownKey = `${rule.name}-${context.user?.id}`;
if (cooldownKey) {
if (pluginData.state.cooldownManager.isOnCooldown(cooldownKey)) {