diff --git a/src/structure/components/observers/CommandHandler.js b/src/structure/components/observers/CommandHandler.js index ac3234e..742c069 100644 --- a/src/structure/components/observers/CommandHandler.js +++ b/src/structure/components/observers/CommandHandler.js @@ -151,13 +151,17 @@ class CommandHandler extends Observer { if (response instanceof Message) return; - if(response) { - if (response instanceof MessageEmbed) return invoker.reply({ embeds: [response] }); - if (typeof response === 'string') return invoker.reply({ content: response }); - if (typeof response === 'object') return invoker.reply(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] }); + else if (typeof response === 'string') return invoker.reply({ content: 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}`); + } }