Kanal yerine kullanıcıya doğrudan mesaj gönder

Dec 31 2020

Bu yüzden, bu gömülü bir kanal yerine bir kullanıcıya dms'ye nasıl göndereceğimi anlamaya çalışıyordum, ancak bulduğum tüm gönderiler sorumla alakasız veya modası geçmiş ve hiç çalışmıyor.

  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!')
      


  }
}

Yanıtlar

1 strafexz Dec 31 2020 at 04:21

Yöntem User#send()örneğini kullanarak bir kullanıcıya DM gönderebilirsiniz :

superCoolUserOmg.send(superCoolEmbedOmg)
CIA Dec 31 2020 at 00:51

Shoejep bunu yanıtladı

message.author.send(embed);