mirror of
https://github.com/discordjs/discord.js.git
synced 2026-09-17 08:47:27 +00:00
feat(GuildsAPI): add getRoleMemberCounts (#11353)
Co-Authored-By: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
@@ -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>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user