@@ -1,35 +1,34 @@
|
||||
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits, userMention } = require("discord.js");
|
||||
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits, userMention} = require('discord.js');
|
||||
|
||||
module.exports = {
|
||||
name: "congratsmessage",
|
||||
description: "Congratulate a user.",
|
||||
type: "contextmenu",
|
||||
name: 'congratsmessage',
|
||||
description: 'Congratulate a user.',
|
||||
type: 'contextmenu',
|
||||
|
||||
data: new ContextMenuCommandBuilder()
|
||||
.setName("Congratulate")
|
||||
.setName('Congratulate')
|
||||
.setType(ApplicationCommandType.Message)
|
||||
.setDefaultMemberPermissions(PermissionFlagsBits.ManageMessages),
|
||||
|
||||
async execute(interaction) {
|
||||
const { targetId } = interaction;
|
||||
|
||||
const { targetId } = interaction
|
||||
const message = await interaction.channel.messages.fetch(targetId);
|
||||
|
||||
if (!message) {
|
||||
return interaction.reply({ content: "That user does not exist.", ephemeral: true });
|
||||
return interaction.reply({ content: 'That user does not exist.', ephemeral: true });
|
||||
}
|
||||
|
||||
const target = message.author;
|
||||
|
||||
await message.reply({
|
||||
embeds: [
|
||||
{
|
||||
title: "Congratulations!",
|
||||
description: `GG to ${userMention(target.id)}!`,
|
||||
},
|
||||
],
|
||||
embeds:[{
|
||||
title: 'Congratulations!',
|
||||
description: `GG to ${userMention(target.id)}!`,
|
||||
}]
|
||||
});
|
||||
await message.react("🎉");
|
||||
await message.react('🎉');
|
||||
|
||||
await interaction.reply({ content: `Sent a congrats message`, ephemeral: true });
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user