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

@everyone role contains no members #9684

Closed
GodderE2D opened this issue Jul 4, 2023 · 3 comments · Fixed by #9685
Closed

@everyone role contains no members #9684

GodderE2D opened this issue Jul 4, 2023 · 3 comments · Fixed by #9685

Comments

@GodderE2D
Copy link
Contributor

Which package is this bug report for?

discord.js

Issue description

In discord.js@dev, the @everyone role contains no members.

To reproduce, simply run the code sample below and observe the number returned.

  • Expected: Should return the guild's member count
  • Actual result: No members are in the Collection, therefore 0 is returned

A simple workaround is to use Guild.memberCount, however this is still a bug and works in 14.11.0.


Could be related to:

Also see: https://discord.com/channels/222078108977594368/937420598383108167/1125273078453256283

Code sample

// The @everyone role id is identical to the guild id
<RoleManager>.cache.get(message.guild.id).members.size

Versions

Issue priority

Low (slightly annoying)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

Guilds

I have tested this issue on a development release

75d91b5

@Syjalo

This comment was marked as outdated.

@imranbarbhuiya
Copy link
Contributor

imranbarbhuiya commented Jul 4, 2023

did u fetch the members before checking cache size? maybe no members were cached so its showing 0. Also u should always use guild.memberCount instead of <RoleManager>.cache.get(message.guild.id).members.size or message.guild.members.cache.size as these methods only shows cached members

@GodderE2D
Copy link
Contributor Author

It still shouldn't show 0 as the bot member would be cached. But even after I fetch members it's still 0.

@Jiralite Jiralite added has PR and removed need repro labels Jul 6, 2023
@kodiakhq kodiakhq bot closed this as completed in #9685 Jul 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants