bug fix to db call

This commit is contained in:
Erik 2020-08-09 02:23:19 +03:00
parent 19df36319f
commit 4e93e35325

View File

@ -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