debugging

This commit is contained in:
Erik 2022-07-22 11:43:36 +03:00
parent e6f35b2a76
commit 1a68e23548
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -1,6 +1,7 @@
const { stripIndents } = require('common-tags');
const { User, GuildMember } = require('discord.js');
const { Collection } = require('@discordjs/collection');
const { inspect } = require('util');
const { Emojis, Constants } = require('../../constants');
const { Util, Logger } = require('../../utilities');
@ -439,11 +440,12 @@ class ModerationManager {
if(!infraction) throw new Error('Undefined infraction');
const callBackAt = infraction.timestamp + infraction.duration;
if (callBackAt - currentDate <= 0) {
this.logger.debug(`Expired infraction:\n${inspect(infraction)}`);
await resolve(infraction);
continue;
}
this.logger.debug(`Going to resolve infraction in: ${Math.floor((callBackAt - currentDate) / 1000)} s`);
this.logger.debug(`Going to resolve infraction ${infraction.id} in: ${Math.floor((callBackAt - currentDate) / 1000)} s`);
this.callbacks.set(infraction.id, {
timeout: setTimeout(async () => {