0

I want to make an User Info command and I'm currently trying to add the function User joined Discord at but with the current code I only get my exact time when I execute the command (see this link) and I don't know what to change in that command so it would work.

I'm using this package for the date.



            case 'minfo':

            const moment = require('moment')
  
            const membed = new Discord.MessageEmbed()
            
            .setColor('RANDOM')
            .setThumbnail(message.member.displayAvatarURL())
            .setTimestamp()
            .addFields(
                {name: 'User Name:', value: `${message.author}`},
                {name: 'User ID:', value: `${message.author.id}`},
                {name: 'Joined at', value: `${moment(message.author.joinedat).format('MMMM Do YYYY, h:mm:ss a')}`}
            )

            message.channel.send({embeds: [membed]}) 
I need Help
  • 204
  • 3
  • 13
  • 1
    Does this answer your question? [What is the difference between a User and a GuildMember in discord.js?](https://stackoverflow.com/questions/63979076/what-is-the-difference-between-a-user-and-a-guildmember-in-discord-js) – MrMythical Nov 26 '21 at 12:06

1 Answers1

1

Message#author is a User. .joinedAt only exists on GuildMembers which you can get with Message#member

{name: 'Joined at', value: `${moment(message.member.joinedAt).format('MMMM Do YYYY, h:mm:ss a')} //remember capitalization

Additionally, .createdAt only exists on Users, not GuildMembers

MrMythical
  • 8,908
  • 2
  • 17
  • 45