Skip to content

Commit

Permalink
fix(msgInfo): changed reportNotEnabled error msg to ephemeral
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-737 committed Jan 7, 2024
1 parent 9e1a466 commit 0d7d5fe
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/commands/context-menu/messageInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,17 @@ export default class MessageInfo extends BaseCommand {
}

case 'report': {
if (!originalMsg.hub?.logChannels?.reports) {
return await interaction.reply({
embeds: [
simpleEmbed(
t({ phrase: 'msgInfo.report.notEnabled', locale: interaction.user.locale }),
),
],
ephemeral: true,
});
}

const modal = new ModalBuilder()
.setCustomId(new CustomID('msgInfoModal:report', [messageId]).toString())
.setTitle('Report Message')
Expand Down Expand Up @@ -308,6 +319,7 @@ export default class MessageInfo extends BaseCommand {
embeds: [
simpleEmbed(t({ phrase: 'msgInfo.report.notEnabled', locale: interaction.user.locale })),
],
ephemeral: true,
});
}

Expand All @@ -327,7 +339,12 @@ export default class MessageInfo extends BaseCommand {

await interaction.reply({
embeds: [
simpleEmbed(t({ phrase: 'msgInfo.report.success', locale: interaction.user.locale }, { emoji: emojis.yes })),
simpleEmbed(
t(
{ phrase: 'msgInfo.report.success', locale: interaction.user.locale },
{ emoji: emojis.yes },
),
),
],
ephemeral: true,
});
Expand Down

0 comments on commit 0d7d5fe

Please sign in to comment.