Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

membersOnline value is wrong #6

Closed
ahnl opened this issue May 6, 2022 · 3 comments
Closed

membersOnline value is wrong #6

ahnl opened this issue May 6, 2022 · 3 comments
Assignees

Comments

@ahnl
Copy link
Member

ahnl commented May 6, 2022

I doubt there is 1 300 members online when Discord shows there are just 300 members in the Jäsen-role.

Needs investigating.

image

image

@Chicken
Copy link
Member

Chicken commented May 6, 2022

This happens because the check for a member being online (member?.presence?.status !== "offline") is wrong. When a presence is not in the cache the status (member?.presence?.status) is undefined and therefore the code thinks such members are online when in reality they are more likely to be offline. For a good approximate amount of online users guild.approximatePresenceCount should be used.

@Esinko
Copy link
Member

Esinko commented May 6, 2022

Unsure about how you should calculate how many members are online, but this is just a plain bug in my code. I should have added an exception for fields with undefined. However, I wonder how this seemed to work before...

@Esinko Esinko closed this as completed in 23f3973 May 6, 2022
@ahnl
Copy link
Member Author

ahnl commented May 6, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants