Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add memberCount in the Role #3306

Unanswered
Discussion options

Description

When fetching the roles from a guild, it would be very useful if the role structure had a "memberCount" property, similar to the guild.memberCount property currently exposed.

Why This is Needed

This is needed so we can avoid fetching all members just to know if a role is used or not. Currently, the only way to know how a role is used / who a role is assigned to, is to fetch the members to check what roles are assigned to them.

Alternatives Considered

Although there is a workaround, i.e. fetch members and check their roles individually; It would be softer on the discord servers to avoid fetching members info just to obtain role related information.

Additional Details

This is purely to avoid unnecessary API calls. Thanks for considering it!

You must be logged in to vote

Replies: 3 comments 1 reply

Comment options

there's now an endpoint for getting role member counts (and endpoints for getting/setting role members) but bots can't use them yet:

image

You must be logged in to vote
0 replies
Comment options

any updates on this? we're running into issues that would really benefit from this

You must be logged in to vote
0 replies
Comment options

We've released GET /guilds/:id/roles/member-counts for bots in a public preview!

discord/discord-api-spec@471ad9b

You must be logged in to vote
1 reply
Comment options

now role members :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Converted from issue

This discussion was converted from issue #2610 on July 01, 2021 19:14.

AltStyle によって変換されたページ (->オリジナル) /