DiscordMember lacks of user properties when the cache is empty on Guild Member Removed event
Created by: FenikkusuKoneko
Summary
The DiscordMember
entity doesn't use the DiscordUser
's properties, instead it searches this in the user cache.
Details
I found that the DiscordMember
entity doesn't have the username, discriminator, avatar, basically all the general fields from the DiscordUser
entity when this is not in the cache.
I was searching the cause of this and I found that DiscordMember
searches the user in the user cache then it uses its properties.
I found this problem in the Guild Member Removed event when I started my bot with the cache empty. I believe Discord sends the full data of the user that left the server.
Steps to reproduce
- Start the bot with the cache empty (i.e. have only the member intent enabled or not)
- Try to access member's username in the guild member removed event
- You will get a
KeyNotFoundException