0

Trying to write an info command. I don't think I'm correctly getting the guild member to get the .joinedAt value, and I haven't been able to find a recent example. Here is the relevant code. Any help appreciated:

const user = await interaction.options.getUser("user").fetch(true);
embed.setTitle(`User info for ${user.username}`);
embed.addFields(
  { name: "User Tag:", value: `${user.tag}`, inline: true },
  { name: "User ID:", value: `${user.id}`, inline: true },
  { name: "Bot Status:", value: `${user.bot}`, inline: true },
  {
    name: "Account Creation Date:",
    value: `${user.createdAt}`,
    inline: false
  },
  // I'm trying to get the .joinedAt value here
  {
    name: "Guild Join Date:",
    value: `${interaction.message.guild.member(user).joinedAt}`,
    inline: false
  }
);
MarioG8
  • 5,122
  • 4
  • 13
  • 29
Koto
  • 430
  • 4
  • 19
  • 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 20 '21 at 14:53

1 Answers1

1

You are getting just common user using getUser instead of getMember which is server member

MegaMix_Craft
  • 2,199
  • 3
  • 10
  • 36