Discord.js: GuildMember.user missing many properties

Created on 20 Jul 2020  Â·  4Comments  Â·  Source: discordjs/discord.js

Please describe the problem you are having in as much detail as possible:

When fetching a GuildMember with message.channel.guild.members.fetch(), the user property is missing many properties, and only includes the following: id, username, discriminator, avatar, bot, lastMessageID, lastMessage.
After asking on the Discord server, it works fine for someone else, but after changing the installed discord.js module, bot, user, and version (stable in npm and 12.0.2), I get the same exact results.

Edit: 12 of User's 19 properties are missing: client createdAt createdTimestamp defaultAvatarURL dmChannel flags lastMessageChannelID locale partial presence system tag

Include a reproducible code sample here, if possible:

message.channel.guild.members.fetch("182663633480712201").then(guildmember => {
    message.channel.send(guildmember.user.fetch());
});

Further details:

  • discord.js version: 12.2.0 & 12.0.2 (As tested)
  • Node.js version: 14.5.0
  • Operating system: Arch Linux 5.7.9-arch1-1
  • Priority this issue should have – please be realistic and elaborate if possible: Low, only seems to apply to me and used for random small command

Relevant client options:

  • partials: none
  • gateway intents: none
  • other: none
  • [x] I have also tested the issue on latest master, commit hash: 2b6e6d8
unverified bug

All 4 comments

What exactly is missing again?

12/19 properties
client createdAt createdTimestamp defaultAvatarURL dmChannel flags lastMessageChannelID locale partial presence system tag

How are you checking these properties for their existence? Using console.log? The only one I can see here that should definitely be "defined" is client.

  • createdAt createdTimestamp defaultAvatarURL dmChannel partial presence and tag are all getters that won't appear when using console.log to look at the object.
  • flags doesn't exist on 12.0.2, and requires manual fetching on 12.2.0: User#fetchFlags()
  • lastMessageChannelID is nullable, does not come from API
  • locale is nullable and is not provided to bots
  • system can be undefined

After some experimentation with your information, I have narrowed down the issue to using user.fetch() instead of simply user, and not knowing GuildMemberManager.fetch() is async.

Sorry for my ignorance, thanks for the help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shukriadams picture shukriadams  Â·  3Comments

xCuzImPro picture xCuzImPro  Â·  3Comments

kvn1351 picture kvn1351  Â·  3Comments

Alipoodle picture Alipoodle  Â·  3Comments

DatMayo picture DatMayo  Â·  3Comments