feat(GuildsAPI): bulk ban users (#10202)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
Almeida
2024-04-06 08:24:16 +01:00
committed by GitHub
parent f1f2683dc7
commit bfc3b100da

View File

@@ -75,6 +75,8 @@ import {
type RESTPatchAPIGuildWidgetSettingsResult,
type RESTPostAPIAutoModerationRuleJSONBody,
type RESTPostAPIAutoModerationRuleResult,
type RESTPostAPIGuildBulkBanJSONBody,
type RESTPostAPIGuildBulkBanResult,
type RESTPostAPIGuildChannelJSONBody,
type RESTPostAPIGuildChannelResult,
type RESTPostAPIGuildEmojiJSONBody,
@@ -364,6 +366,26 @@ export class GuildsAPI {
await this.rest.delete(Routes.guildBan(guildId, userId), { reason, signal });
}
/**
* Bulk ban users from a guild
*
* @see {@link https://discord.com/developers/docs/resources/guild#bulk-guild-ban}
* @param guildId - The id of the guild to bulk ban users in
* @param body - The data for bulk banning users
* @param options - The options for bulk banning users
*/
public async bulkBanUsers(
guildId: Snowflake,
body: RESTPostAPIGuildBulkBanJSONBody,
{ reason, signal }: Pick<RequestData, 'reason' | 'signal'> = {},
) {
return this.rest.post(Routes.guildBulkBan(guildId), {
reason,
body,
signal,
}) as Promise<RESTPostAPIGuildBulkBanResult>;
}
/**
* Gets all the roles in a guild
*