Home > other >  Unable to get users .joinedAt value
Unable to get users .joinedAt value

Time:11-20

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
  }
);

CodePudding user response:

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

  • Related