Updated congrats messaege and removed ping js

event
This commit is contained in:
2023-04-24 12:26:27 +02:00
parent a8c1cbecea
commit e2747dab3f
2 changed files with 13 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits} = require('discord.js'); const { ContextMenuCommandBuilder, ApplicationCommandType, PermissionFlagsBits, userMention} = require('discord.js');
module.exports = { module.exports = {
name: 'congratsmessage', name: 'congratsmessage',
@@ -13,13 +13,22 @@ module.exports = {
async execute(interaction) { async execute(interaction) {
const { targetId } = interaction const { targetId } = interaction
const target = await interaction.guild.members.fetch(targetId); const message = await interaction.channel.messages.fetch(targetId);
if (!target) { if (!message) {
return interaction.reply({ content: 'That user does not exist.', ephemeral: true }); return interaction.reply({ content: 'That user does not exist.', ephemeral: true });
} }
await interaction.reply({ content: `Congratulations ${target.user.username}!`, ephemeral: true }); const target = message.author;
await message.reply({
embeds:[{
title: 'Congratulations!',
description: `GG to ${userMention(target.id)}!`,
}]
});
await message.react('🎉');
await interaction.reply({ content: `Sent a congrats message`, ephemeral: true });
} }
}; };

View File

@@ -1,5 +0,0 @@
module.exports = {
name: 'ping',
description: 'Ping!',
type: 'message',
};