28 lines
No EOL
873 B
JavaScript
28 lines
No EOL
873 B
JavaScript
const { ContextMenuCommandBuilder, ApplicationCommandType, InteractionContextType, ApplicationIntegrationType, AttachmentBuilder } = require("discord.js");
|
|
|
|
const data = new ContextMenuCommandBuilder()
|
|
.setName("Message Information")
|
|
.setType(ApplicationCommandType.Message)
|
|
.setContexts([
|
|
InteractionContextType.Guild,
|
|
InteractionContextType.BotDM,
|
|
InteractionContextType.PrivateChannel
|
|
])
|
|
.setIntegrationTypes([
|
|
ApplicationIntegrationType.GuildInstall,
|
|
ApplicationIntegrationType.UserInstall
|
|
]);
|
|
|
|
module.exports = {
|
|
data,
|
|
async execute(interaction) {
|
|
await interaction.reply({
|
|
files: [
|
|
new AttachmentBuilder()
|
|
.setName(interaction.targetMessage.id + ".json")
|
|
.setFile(Buffer.from(JSON.stringify(interaction.targetMessage.toJSON(), null, 4), "utf-8"))
|
|
],
|
|
ephemeral: true
|
|
});
|
|
},
|
|
}; |