Skip to content

Commit

Permalink
feat(GuildsAPI): bulk ban users (#10202)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
almeidx and kodiakhq[bot] committed Apr 6, 2024
1 parent f1f2683 commit bfc3b10
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/core/src/api/guild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ import {
type RESTPatchAPIGuildWidgetSettingsResult,
type RESTPostAPIAutoModerationRuleJSONBody,
type RESTPostAPIAutoModerationRuleResult,
type RESTPostAPIGuildBulkBanJSONBody,
type RESTPostAPIGuildBulkBanResult,
type RESTPostAPIGuildChannelJSONBody,
type RESTPostAPIGuildChannelResult,
type RESTPostAPIGuildEmojiJSONBody,
Expand Down Expand Up @@ -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
*
Expand Down

0 comments on commit bfc3b10

Please sign in to comment.