mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
feat(GuildsAPI): bulk ban users (#10202)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user