I am having trouble with this. If I mention a user in my server, following another command, how can my embed message private message that mentioned user?
For example: =deny (@Mentioned User)
I am having trouble with this. If I mention a user in my server, following another command, how can my embed message private message that mentioned user?
For example: =deny (@Mentioned User)
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = '=';
client.on('message', message => {
if (message.content.startsWith(`${prefix}deny`) {
const user = message.mentions.users.first();
const embed = new MessageEmbed()
.setColor('RED')
.setTitle('Title')
.setDescription('Description')
.setTimestamp();
user.send(embed);
}
});
client.login('discord token here');
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.