Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document bulk ban endpoint #6720

Merged
merged 4 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/resources/Guild.md
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,32 @@ Remove the ban for a user. Requires the `BAN_MEMBERS` permissions. Returns a 204
> info
> This endpoint supports the `X-Audit-Log-Reason` header.

## Bulk Guild Ban % POST /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/bulk-ban

Ban up to 200 users from a guild, and optionally delete previous messages sent by the banned users. Requires both the `BAN_MEMBERS` and `MANAGE_GUILD` permissions. Returns a 200 response on success, including the fields `banned_users` with the IDs of the banned users and `failed_users` with IDs that could not be banned or were already banned.

> info
> This endpoint supports the `X-Audit-Log-Reason` header.

###### JSON Params

| Field | Type | Description | Default |
|-------------------------|---------------------|-------------------------------------------------------------------------|---------|
| user_ids | array of snowflakes | list of user ids to ban (max 200) | |
| delete_message_seconds? | integer | number of seconds to delete messages for, between 0 and 604800 (7 days) | 0 |

###### Bulk Ban Response

On success, this endpoint returns a 200 success response with the following body.

| Field | Type | Description |
|--------------|---------------------|-------------------------------------------------|
| banned_users | array of snowflakes | list of user ids, that were successfully banned |
| failed_users | array of snowflakes | list of user ids, that were not banned |

> info
> If none of the users could be banned, an error response code `500000: Failed to ban users` is returned instead.

## Get Guild Roles % GET /guilds/{guild.id#DOCS_RESOURCES_GUILD/guild-object}/roles

Returns a list of [role](#DOCS_TOPICS_PERMISSIONS/role-object) objects for the guild.
Expand Down
1 change: 1 addition & 0 deletions docs/topics/Opcodes_and_Status_Codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ Along with the HTTP error code, our API can also return more detailed error code
| 240000 | Message blocked by harmful links filter |
| 350000 | Cannot enable onboarding, requirements are not met |
| 350001 | Cannot update onboarding while below requirements |
| 500000 | Failed to ban users |

###### Example JSON Error Response

Expand Down