채널 대신 사용자에게 쪽지 보내기

Dec 31 2020

그래서 나는이 삽입을 채널 대신 사용자 dms에게 보내는 방법을 알아 내려고 노력했지만 내가 찾은 모든 게시물은 내 질문과 관련이 없거나 구식이며 전혀 작동하지 않습니다.

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


  }
}

답변

1 strafexz Dec 31 2020 at 04:21

방법 User#send()예제를 사용하여 사용자에게 DM을 보낼 수 있습니다 .

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

Shoejep 님이 답변했습니다.

message.author.send(embed);