From 65a9549b9c2918f9ba737f5734ad5ee24882ff35 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Wed, 3 Aug 2022 11:23:43 +0300 Subject: [PATCH] fixes --- src/structure/components/observers/CommandHandler.js | 11 ++++++----- src/structure/infractions/Ban.js | 2 +- src/structure/interfaces/Setting.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/structure/components/observers/CommandHandler.js b/src/structure/components/observers/CommandHandler.js index 46634bc..ba33de7 100644 --- a/src/structure/components/observers/CommandHandler.js +++ b/src/structure/components/observers/CommandHandler.js @@ -171,11 +171,12 @@ class CommandHandler extends Observer { }); const now = Date.now(); + let debugstr = invoker.command.name; + if (invoker.subcommandGroup) debugstr += ` ${invoker.subcommandGroup.name}`; + if (invoker.subcommand) debugstr += ` ${invoker.subcommand.name}`; + this.logger.info(`[${invoker.type.toUpperCase()}] ${invoker.user.tag} (${invoker.user.id}) is executing ${debugstr} in ${invoker.guild?.name || 'dms'}`); + try { - let debugstr = invoker.command.name; - if (invoker.subcommandGroup) debugstr += ` ${invoker.subcommandGroup.name}`; - if(invoker.subcommand) debugstr += ` ${invoker.subcommand.name}`; - this.logger.info(`[${invoker.type.toUpperCase()}] ${invoker.user.tag} (${invoker.user.id}) is executing ${debugstr} in ${invoker.guild?.name || 'dms'}`); response = await invoker.command.execute(invoker, options); // Settings have a lot of prompts that will skew the resultts if(!(invoker.command instanceof SettingsCommand)) invoker.command.success(now); @@ -184,7 +185,7 @@ class CommandHandler extends Observer { this._generateError(invoker, { error, type: 'command' }); } else { if (!(invoker.command instanceof SettingsCommand)) invoker.command.error(now); - this.logger.error(`Command ${invoker.command.name} errored:\nOptions:\n${Object.keys(options).map((key) => `[${key}: ${options[key]._rawValue}]`).join('\n')}\n${error.stack || error}`); + this.logger.error(`Command ${debugstr} errored:\nOptions:\n${Object.keys(options).map((key) => `[${key}: ${options[key]._rawValue}]`).join('\n')}\n${error.stack || error}`); this._generateError(invoker, { type: 'commandHandler' }); } return; diff --git a/src/structure/infractions/Ban.js b/src/structure/infractions/Ban.js index 161bc18..b9dcd55 100644 --- a/src/structure/infractions/Ban.js +++ b/src/structure/infractions/Ban.js @@ -45,7 +45,7 @@ class BanInfraction extends Infraction { try { await this.guild.members.ban(this.target.id, { reason: this._reason, - days + deleteMessageDays: days }); } catch (error) { return this._fail('INFRACTION_ERROR'); diff --git a/src/structure/interfaces/Setting.js b/src/structure/interfaces/Setting.js index 6c68b3c..ec2984d 100644 --- a/src/structure/interfaces/Setting.js +++ b/src/structure/interfaces/Setting.js @@ -189,7 +189,7 @@ class Setting extends Component { { time, editReply: invoker.replied, embed } ); - if (!response) return { error: true, message: invoker.format('ERR_TIMEOUT') }; + if (!response) return { error: true, content: invoker.format('ERR_TIMEOUT') }; const content = response.content.toLowerCase(); if (invoker.channel.permissionsFor(this.client.user).has('ManageMessages')) await response.delete().catch(() => null);