debugging

This commit is contained in:
Erik 2022-07-08 22:07:15 +03:00
parent c46d067c97
commit 5b4efc566f
Signed by untrusted user: Navy.gif
GPG Key ID: 811EC0CD80E7E5FB

View File

@ -151,13 +151,17 @@ class CommandHandler extends Observer {
if (response instanceof Message) return; if (response instanceof Message) return;
if(response) { try { // Temporary -- trying to figure out why the bot sometimes errors with unknown interaction
if (response) {
if (response instanceof MessageEmbed) return invoker.reply({ embeds: [response] }); if (response instanceof MessageEmbed) return invoker.reply({ embeds: [response] });
if (typeof response === 'string') return invoker.reply({ content: response }); else if (typeof response === 'string') return invoker.reply({ content: response });
if (typeof response === 'object') return invoker.reply(response); else if (typeof response === 'object') return invoker.reply(response);
} }
if (!invoker.replied) return invoker.reply({ index: 'O_COMMANDHANDLER_COMMAND_NORESPONSE', ephemeral: !invoker.replied }); if (!invoker.replied) return invoker.reply({ index: 'O_COMMANDHANDLER_COMMAND_NORESPONSE', ephemeral: !invoker.replied });
} catch (err) {
this.logger.error(`Error responding to ${invoker.command.name}:\n${err.stack}`);
}
} }