带有 Discord 机器人用户头像的欢迎消息

Welcome message with user avatar for Discord bot

所以我正在使用 JavaScript 开发 Discord 机器人,我想收到带有用户图像的欢迎消息(例如 this)。我不知道应该从哪里开始,有人可以帮助我吗?
感谢您的宝贵时间!

每次有新成员加入公会时触发的事件是guildMemberAdd,由客户端发出。
要发送图像,您可以将其作为 Attachment or as the image of a RichEmbed.

发送

为了完成所有这些工作,您需要这样的东西:

client.on('guildMemberAdd', member => {
  // channel: the channel you want to send the welcome message in

  // you can either send a normal message:
  channel.send(`Welcome ${member}, bla bla bla...`, { // its like sending a normal message, but with some MessageOptions
    file: 'https://image.ibb.co/dNGVKz/Screenshot_1.png' // this is your image URL
  });

  // or send it with an embed:
  let embed = new Discord.RichEmbed()
    .setTitle("Welcome")
    .setDescription(`Hi ${member}, bla bla bla...`)
    .setImage('https://image.ibb.co/dNGVKz/Screenshot_1.png');
  channel.send({embed});
});

如果有一些方法或类你还不知道,你可以在wiki.

中查找它们