This repository has been archived on 2025-06-26. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
l1l1th-old/src/commands/utility/message.js
Ashley Graves 2eaadf2208 booru
2024-10-10 08:34:00 +02:00

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
});
},
};