mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(GuildsAPI): add getRoleMemberCounts (#11353)
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable jsdoc/check-param-names */
|
/* eslint-disable jsdoc/check-param-names */
|
||||||
|
|
||||||
import { makeURLSearchParams, type RawFile, type REST, type RequestData } from '@discordjs/rest';
|
import { makeURLSearchParams, type REST, type RawFile, type RequestData } from '@discordjs/rest';
|
||||||
import {
|
import {
|
||||||
Routes,
|
Routes,
|
||||||
type GuildWidgetStyle,
|
type GuildWidgetStyle,
|
||||||
@@ -27,6 +27,7 @@ import {
|
|||||||
type RESTGetAPIGuildPruneCountResult,
|
type RESTGetAPIGuildPruneCountResult,
|
||||||
type RESTGetAPIGuildQuery,
|
type RESTGetAPIGuildQuery,
|
||||||
type RESTGetAPIGuildResult,
|
type RESTGetAPIGuildResult,
|
||||||
|
type RESTGetAPIGuildRoleMemberCountsResult,
|
||||||
type RESTGetAPIGuildRoleResult,
|
type RESTGetAPIGuildRoleResult,
|
||||||
type RESTGetAPIGuildRolesResult,
|
type RESTGetAPIGuildRolesResult,
|
||||||
type RESTGetAPIGuildScheduledEventQuery,
|
type RESTGetAPIGuildScheduledEventQuery,
|
||||||
@@ -35,6 +36,8 @@ import {
|
|||||||
type RESTGetAPIGuildScheduledEventUsersResult,
|
type RESTGetAPIGuildScheduledEventUsersResult,
|
||||||
type RESTGetAPIGuildScheduledEventsQuery,
|
type RESTGetAPIGuildScheduledEventsQuery,
|
||||||
type RESTGetAPIGuildScheduledEventsResult,
|
type RESTGetAPIGuildScheduledEventsResult,
|
||||||
|
type RESTGetAPIGuildSoundboardSoundResult,
|
||||||
|
type RESTGetAPIGuildSoundboardSoundsResult,
|
||||||
type RESTGetAPIGuildStickerResult,
|
type RESTGetAPIGuildStickerResult,
|
||||||
type RESTGetAPIGuildStickersResult,
|
type RESTGetAPIGuildStickersResult,
|
||||||
type RESTGetAPIGuildTemplatesResult,
|
type RESTGetAPIGuildTemplatesResult,
|
||||||
@@ -62,6 +65,8 @@ import {
|
|||||||
type RESTPatchAPIGuildRoleResult,
|
type RESTPatchAPIGuildRoleResult,
|
||||||
type RESTPatchAPIGuildScheduledEventJSONBody,
|
type RESTPatchAPIGuildScheduledEventJSONBody,
|
||||||
type RESTPatchAPIGuildScheduledEventResult,
|
type RESTPatchAPIGuildScheduledEventResult,
|
||||||
|
type RESTPatchAPIGuildSoundboardSoundJSONBody,
|
||||||
|
type RESTPatchAPIGuildSoundboardSoundResult,
|
||||||
type RESTPatchAPIGuildStickerJSONBody,
|
type RESTPatchAPIGuildStickerJSONBody,
|
||||||
type RESTPatchAPIGuildStickerResult,
|
type RESTPatchAPIGuildStickerResult,
|
||||||
type RESTPatchAPIGuildTemplateJSONBody,
|
type RESTPatchAPIGuildTemplateJSONBody,
|
||||||
@@ -84,6 +89,8 @@ import {
|
|||||||
type RESTPostAPIGuildRoleResult,
|
type RESTPostAPIGuildRoleResult,
|
||||||
type RESTPostAPIGuildScheduledEventJSONBody,
|
type RESTPostAPIGuildScheduledEventJSONBody,
|
||||||
type RESTPostAPIGuildScheduledEventResult,
|
type RESTPostAPIGuildScheduledEventResult,
|
||||||
|
type RESTPostAPIGuildSoundboardSoundJSONBody,
|
||||||
|
type RESTPostAPIGuildSoundboardSoundResult,
|
||||||
type RESTPostAPIGuildStickerFormDataBody,
|
type RESTPostAPIGuildStickerFormDataBody,
|
||||||
type RESTPostAPIGuildStickerResult,
|
type RESTPostAPIGuildStickerResult,
|
||||||
type RESTPostAPIGuildTemplatesJSONBody,
|
type RESTPostAPIGuildTemplatesJSONBody,
|
||||||
@@ -96,12 +103,6 @@ import {
|
|||||||
type RESTPutAPIGuildOnboardingJSONBody,
|
type RESTPutAPIGuildOnboardingJSONBody,
|
||||||
type RESTPutAPIGuildOnboardingResult,
|
type RESTPutAPIGuildOnboardingResult,
|
||||||
type RESTPutAPIGuildTemplateSyncResult,
|
type RESTPutAPIGuildTemplateSyncResult,
|
||||||
type RESTGetAPIGuildSoundboardSoundResult,
|
|
||||||
type RESTGetAPIGuildSoundboardSoundsResult,
|
|
||||||
type RESTPatchAPIGuildSoundboardSoundJSONBody,
|
|
||||||
type RESTPatchAPIGuildSoundboardSoundResult,
|
|
||||||
type RESTPostAPIGuildSoundboardSoundJSONBody,
|
|
||||||
type RESTPostAPIGuildSoundboardSoundResult,
|
|
||||||
type Snowflake,
|
type Snowflake,
|
||||||
} from 'discord-api-types/v10';
|
} from 'discord-api-types/v10';
|
||||||
|
|
||||||
@@ -1461,4 +1462,18 @@ export class GuildsAPI {
|
|||||||
signal,
|
signal,
|
||||||
}) as Promise<RESTPutAPIGuildIncidentActionsResult>;
|
}) as Promise<RESTPutAPIGuildIncidentActionsResult>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetches role member counts for a guild.
|
||||||
|
*
|
||||||
|
* @see {@link https://discord.com/developers/docs/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, { auth, signal }: Pick<RequestData, 'auth' | 'signal'> = {}) {
|
||||||
|
return this.rest.get(Routes.guildRoleMemberCounts(guildId), {
|
||||||
|
auth,
|
||||||
|
signal,
|
||||||
|
}) as Promise<RESTGetAPIGuildRoleMemberCountsResult>;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user