aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/commands/utilities/viewraw.ts3
-rw-r--r--src/listeners/client/interactionCreate.ts4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/utilities/viewraw.ts b/src/commands/utilities/viewraw.ts
index f6be382..bc79b7a 100644
--- a/src/commands/utilities/viewraw.ts
+++ b/src/commands/utilities/viewraw.ts
@@ -77,6 +77,7 @@ export default class ViewRawCommand extends BushCommand {
? inspect(JSON.stringify(message.toJSON()))
: inspect(message.toJSON()) || '[No Content]'
: message.content || '[No Content]';
+ const lang = options.json ? 'json' : options.js ? 'js' : undefined;
return (
new MessageEmbed()
.setFooter(message.author.tag, message.author.avatarURL({ dynamic: true }) ?? undefined)
@@ -84,7 +85,7 @@ export default class ViewRawCommand extends BushCommand {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
.setColor(message.member?.roles?.color?.color || util.colors.default)
.setTitle('Raw Message Information')
- .setDescription(await util.codeblock(content, 2048, 'js'))
+ .setDescription(await util.codeblock(content, 2048, lang))
);
}
}
diff --git a/src/listeners/client/interactionCreate.ts b/src/listeners/client/interactionCreate.ts
index f711db1..63775dd 100644
--- a/src/listeners/client/interactionCreate.ts
+++ b/src/listeners/client/interactionCreate.ts
@@ -38,13 +38,13 @@ export default class InteractionCreateListener extends BushListener {
ephemeral: true
});
} else if (interaction.isContextMenu()) {
- if (interaction.id === 'View Raw') {
+ if (interaction.commandName === 'View Raw') {
await interaction.deferReply({ ephemeral: true });
const embed = await ViewRawCommand.getRawData(interaction.options.getMessage('message') as BushMessage, {
json: false,
js: false
});
- return await interaction.reply({ embeds: [embed], ephemeral: true });
+ return await interaction.editReply({ embeds: [embed] });
}
}
}