fixes
This commit is contained in:
parent
74a4c1763f
commit
65a9549b9c
@ -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;
|
||||
|
@ -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');
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user