feat(GuildsAPI): add getRoleMemberCounts (#11353)

Co-Authored-By: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
Almeida
2026-07-15 16:05:14 +01:00
committed by Jiralite
co-authored by Jiralite
parent a51c2248da
commit 7b37177bcf
+14
View File
@@ -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<RESTPutAPIGuildIncidentActionsResult>;
}
/**
* 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<RequestData, 'signal'> = {}) {
return this.rest.get(Routes.guildRoleMemberCounts(guildId), {
signal,
}) as Promise<RESTGetAPIGuildRoleMemberCountsResult>;
}
}