【发布时间】:2020-03-05 05:02:28
【问题描述】:
这个帖子没有解决我的问题,这就是我再次询问的原因。 I am trying to make a discord.js avatar command, and the mentioning portion doesn't work correctly
当我使用我的头像命令而不提及用户时,它会按预期显示我的头像,但是当我提到用户时,它会显示“未定义的头像”并且不显示头像
module.exports.run = async (Client, msg, args) => {
let member = msg.mentions.members.first() || msg.author
let embed = new Discord.RichEmbed()
.setTitle(`${member.username}'s Avatar`)
.setImage(member.avatarURL)
.setColor(0x233f23);
msg.channel.send(embed)
}
它似乎没有找到提到的用户,但我不知道为什么
在我使用之前
if (!member) member = msg.author
但这仍然给了我同样的问题,所以我从上面链接的线程中应用了修复程序,它仍然是同样的事情。
【问题讨论】:
标签: javascript discord discord.js