我无法解决提及第三方用户的错误,错误始于“ Roles”和服务器登录日期(即帐户创建日期)。
请帮助。
... [cut]
} else if (command === 'user') {
let user = message.mentions.users.first() || message.author;
const embed = new Discord.RichEmbed()
.setauthor(`Akirabot. Find of user.`)
.setColor(0x348fcd)
.setTitle('')
.addField(`username`,`${user.username}`,true)
.addField(`User id`,`${user.id}`,true)
.addField(`Status`,`${user.presence.status}`,true)
.addField(`Date of create account`,`${moment(user.createdAt).toString().substr(0,15)}\n(${moment(user.createdAt).fromNow()})`,true)
.addField("Currently Playing",user.presence.game || "Nothing.",true)
.addField(`Join date to server`,`${moment(user.joinedAt).toString().substr(0,15)}\n(${moment(user.joinedAt).fromNow()})`,true)
.addField('Roles',`${user.members.roles}.`,true)
.setfooter(`— Akirabot,made with love by setosh,2019.`)
.setTimestamp('')
.setThumbnail(`${user.displayAvatarURL}`)
message.channel.send({ embed });
我收到此错误消息
TypeError: Cannot read property 'roles' of undefined