From 4e93e353259ca3591eaedc01e3172debf9817225 Mon Sep 17 00:00:00 2001 From: Navy Date: Sun, 9 Aug 2020 02:23:19 +0300 Subject: [PATCH] bug fix to db call --- structure/moderation/ModerationManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/structure/moderation/ModerationManager.js b/structure/moderation/ModerationManager.js index 3579775..2b24d55 100644 --- a/structure/moderation/ModerationManager.js +++ b/structure/moderation/ModerationManager.js @@ -330,7 +330,7 @@ class ModerationManager { for(const infraction of infractions) { const expiration = infraction.timestamp + infraction.duration*1000; - if(expiration-currentDate < 0) { + if(expiration-currentDate <= 0) { await resolve(infraction); continue; } @@ -350,7 +350,7 @@ class ModerationManager { async _removeExpiration(expiration) { this.client.logger.debug(`Expired infraction ${expiration.infraction.type} for user ${expiration.infraction.target}.`); - await this.client.storageManager.infractions.updateOne( + await this.client.storageManager.mongodb.infractions.updateOne( { id: expiration.infraction.id }, { callbacked: true } ).catch((e) => {}); //eslint-disable-line no-empty, no-unused-vars, no-empty-function