I am currently using node along with visual studio code. The script is running smoothly and the text is being embedded just below the field title. However, instead of displaying the server join date, it is showing 'undefined'.
switch(args[0]){
case 'userinfo':
let usera = message.mentions.users.first()
if(!usera) return message.channel.send("Must specify user")
const joinDiscord = moment(user.createdAt).format('llll')
let embed = new Discord.MessageEmbed()
.setAuthor(usera.tag, usera.avatarURL)
.addField("ID", usera.id, true)
.addField("Username", usera.username, true)
.addField("Status", usera.presence.status, true)
.addField("Joined Server",usera.joinedAt, true)//its this part
.addField("Created", usera.createdAt, true)
.addField("Bot", usera.bot, true)
.setTimestamp()
.setColor(0x0f7fa6)
.setThumbnail(usera.displayAvatarURL())
message.channel.send({embed});
}
});