feat(RoleManager): add fetchMemberCounts#11352
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
📝 WalkthroughWalkthroughAdds a new public method Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used🧬 Code graph analysis (1)packages/discord.js/typings/index.d.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
Comment |
There was a problem hiding this comment.
Pull request overview
This PR integrates a new Discord API endpoint into the RoleManager class by adding a fetchMemberCounts() method that retrieves the number of members for each role in a guild. This implementation follows the upstream Discord API documentation update (PR #8025).
Key Changes
- Added
fetchMemberCounts()method to fetch role member counts from the Discord API - TypeScript type definitions updated to include the new method signature
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/discord.js/typings/index.d.ts | Added TypeScript type definition for the new fetchMemberCounts() method returning a Promise of a Collection mapping Snowflake role IDs to numbers |
| packages/discord.js/src/managers/RoleManager.js | Implemented fetchMemberCounts() method that calls the new Discord API endpoint and transforms the response into a Collection |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment was marked as outdated.
This comment was marked as outdated.
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
* feat(RoleManager): add `fetchMemberCounts` * docs: improve description Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* feat(RoleManager): add `fetchMemberCounts` * docs: improve description Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> --------- Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Integrates the new endpoint into the
RoleManagerUpstream: