-
Couldn't load subscription status.
- Fork 1.3k
Add memberCount in the Role #3306
-
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!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 3
Replies: 3 comments 1 reply
-
there's now an endpoint for getting role member counts (and endpoints for getting/setting role members) but bots can't use them yet:
Beta Was this translation helpful? Give feedback.
All reactions
-
any updates on this? we're running into issues that would really benefit from this
Beta Was this translation helpful? Give feedback.
All reactions
-
We've released GET /guilds/:id/roles/member-counts for bots in a public preview!
Beta Was this translation helpful? Give feedback.
All reactions
-
🎉 6
-
now role members :D
Beta Was this translation helpful? Give feedback.