Skip to content

Commit

Permalink
fix: fix bug with messageInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Sep 24, 2023
1 parent 3f9831e commit c19c012
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Commands/Apps/messageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
4 changes: 1 addition & 3 deletions src/Commands/Main/hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
Expand Down
3 changes: 2 additions & 1 deletion src/Events/interactionCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c19c012

Please sign in to comment.