Accessing DiscordMember.DisplayName throws on members downloaded through DiscordGuild.GetAllMembersAsync()
Created by: 13xforever
Make sure you familiarize yourself with our contributing guidelines.
Summary
A KeyNotFoundException
exception is thrown on members that were acquired through guild download method.
Details
Using DSharpPlus 4.0.0-nightly-00808 with .net 5. Pretty sure this is an issue with the new gateway version, as this exact code worked fine before the switch.
System.Collections.Generic.KeyNotFoundException: The given key 'SOME_USER_ID' was not present in the dictionary.
at System.Collections.Concurrent.ConcurrentDictionary`2.ThrowKeyNotFoundException(TKey key)
at System.Collections.Concurrent.ConcurrentDictionary`2.get_Item(TKey key)
at DSharpPlus.Entities.DiscordMember.get_Username()
Steps to reproduce
- Get members through
DiscordGuilde.GetAllMembersAsync()
- Try to access
member.DisplayName
for said members - Catch exception for almost every member