3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-25 02:25:01 +00:00

Merge branch 'ZeppelinBot:master' into master

This commit is contained in:
srqc 2022-12-15 14:22:39 -05:00 committed by GitHub
commit 2f7554365c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -161,7 +161,7 @@ export class GuildCounters extends BaseGuildRepository {
}
const decayAmountToApply = Math.round((diffFromLastDecayMs / decayPeriodMs) * decayAmount);
if (decayAmountToApply === 0) {
if (decayAmountToApply === 0 || Number.isNaN(decayAmountToApply)) {
return;
}

View file

@ -203,6 +203,10 @@ export const CountersPlugin = zeppelinGuildPlugin<CountersPluginType>()({
const decay = counter.decay;
const decayPeriodMs = convertDelayStringToMS(decay.every)!;
if (decayPeriodMs === 0) {
continue;
}
pluginData.state.decayTimers.push(
setInterval(() => {
decayCounter(pluginData, counterName, decayPeriodMs, decay.amount);