diff --git a/packages/core/src/api/guild.ts b/packages/core/src/api/guild.ts index 8d2c49979..166a4cd08 100644 --- a/packages/core/src/api/guild.ts +++ b/packages/core/src/api/guild.ts @@ -30,6 +30,7 @@ import { type RESTGetAPIGuildPruneCountResult, type RESTGetAPIGuildQuery, type RESTGetAPIGuildResult, + type RESTGetAPIGuildRoleMemberCountsResult, type RESTGetAPIGuildRoleResult, type RESTGetAPIGuildRolesResult, type RESTGetAPIGuildScheduledEventQuery, @@ -1500,4 +1501,17 @@ export class GuildsAPI { signal, }) as Promise; } + + /** + * Fetches role member counts for a guild. + * + * @see {@link https://docs.discord.com/developers/resources/guild#get-guild-role-member-counts} + * @param guildId - The id of the guild to fetch role member counts for + * @param options - The options for fetching role member counts + */ + public async getRoleMemberCounts(guildId: Snowflake, { signal }: Pick = {}) { + return this.rest.get(Routes.guildRoleMemberCounts(guildId), { + signal, + }) as Promise; + } }