Updated congrats messaege and removed ping js
event
This commit is contained in:
@@ -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 });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
name: 'ping',
|
|
||||||
description: 'Ping!',
|
|
||||||
type: 'message',
|
|
||||||
};
|
|
||||||
Reference in New Issue
Block a user