diff --git a/src/Commands/Apps/messageInfo.ts b/src/Commands/Apps/messageInfo.ts index 97620d23..a5555e5d 100644 --- a/src/Commands/Apps/messageInfo.ts +++ b/src/Commands/Apps/messageInfo.ts @@ -79,7 +79,7 @@ export default { collector.on('collect', async i => { if (i.customId === 'serverInfo') { if (!server) { - interaction.reply('Unable to find server!'); + i.update({ content: 'Unable to find server!', embeds: [] }); return; } diff --git a/src/Commands/Main/hub.ts b/src/Commands/Main/hub.ts index e1329374..219c185c 100644 --- a/src/Commands/Main/hub.ts +++ b/src/Commands/Main/hub.ts @@ -284,9 +284,7 @@ export default { async execute(interaction: ChatInputCommandInteraction) { const subcommand = interaction.options.getSubcommand(); const subcommandGroup = interaction.options.getSubcommandGroup(); - const extra = subcommand === 'leave' || subcommand === 'delete' - ? interaction.options.getString('hub', true) - : null; + const extra = interaction.options.getString('hub'); (await import(`../../Scripts/hub/${subcommandGroup || subcommand}`)).default.execute(interaction, extra); }, diff --git a/src/Events/interactionCreate.ts b/src/Events/interactionCreate.ts index 5f97ce48..1fd2e846 100644 --- a/src/Events/interactionCreate.ts +++ b/src/Events/interactionCreate.ts @@ -62,7 +62,8 @@ export default { command.execute(interaction) .catch((e) => { logger.error(e); - captureException(e); + captureException(e, { extra: { command: interaction.commandName } }); + (interaction.replied || interaction.deferred ? interaction.followUp({ content: formatErrorCode(e), ephemeral: true }) : interaction.reply({ content: formatErrorCode(e), ephemeral: true })).catch(() => null);