Open ghost opened 5 years ago
Good question, I'll try to do some tests and see if I can recreate the issue.
Interestingly, I am actually getting the opposite problem: I have 341 members in my Discord guild/server, and iterating over guildMembers only yields 131 entries. Any idea why this could be the case? Is there some limit to the amount of people that the API can handle?
[edit] More info:
I am on the latest version (v19). And here is a print statement of the bug in question:
Sun Apr 14 15:03:54 UTC 2019 - len(guild.Members) = 106, guild.MemberCount = 341
So interestingly, MemberCount is correct, but the size of guildMembers is not... It seems to fluctuate and not be consistent between calls.
[edit2] The problem seems to go away once I do a RequestGuildMembers() call. Now I get:
Sun Apr 14 15:25:28 UTC 2019 - len(guild.Members) = 342, guild.MemberCount = 341
Which is more in line with what saulgoogman is experiencing.
@Zamiell this sounds like a different issue and should probably have it's own issue - not get added into this one. Can you create a new issue for your question?
To be clear, now that I'm using RequestGuildMembers()
, I'm also experiencing this issue - the size of len(guild.Members) will occasionally be larger than guild.MemberCount. But yes, I'll open a separate issue.
Good question, I'll try to do some tests and see if I can recreate the issue.
I just use RuquestGuildMembers()
on Ready
event.
I set up a Goroutine to redo RuquestGuildMembers() every 5 minutes, because I wasn't sure if it would stay updated. Do either of you know if that is necessary? Regardless, it could be contributing to the bug in question.
Here it seems like it's including members that are connected to voice chat twice.
I also can confirm that this bug is still a thing. It counts users in voice chat twice.
I can also confirm that that exact bug is still there (using v0.26.1).
In the state i have doubling some guild members. Now, I use a little util function for fix it (below).
Why this slice has non-unique elements?