Wyślij bezpośrednią wiadomość do użytkownika zamiast do kanału
Dec 31 2020
Próbowałem więc dowiedzieć się, jak wysłać to osadzenie do użytkowników dms zamiast do kanału, ale wszystkie znalezione posty są nieistotne dla mojego pytania lub nieaktualne i w ogóle nie działają.
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!')
}
}
Odpowiedzi
1 strafexz Dec 31 2020 at 04:21
Możesz wysłać wiadomość prywatną do użytkownika, korzystając z User#send()
przykładu metody :
superCoolUserOmg.send(superCoolEmbedOmg)
CIA Dec 31 2020 at 00:51
Shoejep odpowiedział na to
message.author.send(embed);