Invia un messaggio diretto all'utente invece che al canale
Dec 31 2020
Quindi ho cercato di capire come inviare questo embed a un dms degli utenti invece che a un canale, ma tutti i post che ho trovato sono irrilevanti per la mia domanda o obsoleti e non funzionano affatto.
module.exports = {
name: 'help',
description: 'this is a help command!',
execute(message, args){
const embed = new Discord.MessageEmbed()
.setTitle('List of Commands')
.setDescription('This embed lists all of my commands.')
.setColor('#ed2626')
.addFields({
name: '+help',
value: 'Shows a list of commands',
inline: true
}, {
name: '+ping',
value: 'Show your insolence to krennic!',
inline: true
}, {
name: 'Test Number 3',
value: 'This is a example value'
}, {
name: 'Test Number 4',
value: 'This is a example value'
})
.setTimestamp();
// This right here is what i'm trying to figure out
// Instead of sending in the channel how would i dm the person that calls the command?
message.channel.send(embed);
console.log('Help command was ran!')
}
}
Risposte
1 strafexz Dec 31 2020 at 04:21
Puoi inviare un messaggio diretto a un utente utilizzando il metodo di User#send()
esempio:
superCoolUserOmg.send(superCoolEmbedOmg)
CIA Dec 31 2020 at 00:51
Shoejep ha risposto a questo
message.author.send(embed);