members_ban
members_ban
Section titled “members_ban”Category: members
Ban a user from a guild. DESTRUCTIVE — user can’t rejoin until unbanned.
When to use
Section titled “When to use”- Permanent removal of a malicious user.
When NOT to use
Section titled “When NOT to use”- Soft-removal → use
members_kick. - Multiple users → use
members_bulk_ban.
Optional delete_message_seconds (0..604800) deletes that user’s recent messages.
| Field | Type | Required | Description |
|---|---|---|---|
guild_id | string | yes | Guild to ban from |
user_id | string | yes | Member to ban |
delete_message_seconds | integer | no | Delete the user’s messages from the last N seconds (0..604800 = up to 7 days) |
audit_reason | string | no | Reason recorded in audit log (X-Audit-Log-Reason header) |
Returns
Section titled “Returns”\{banned, user_id, guild_id\}. Idempotent — re-banning is a no-op.
Output schema
Section titled “Output schema”| Field | Type | Required | Description |
|---|---|---|---|
banned | boolean | yes | |
user_id | string | yes | Discord user ID |
guild_id | string | yes | Discord guild (server) ID |
Annotations
Section titled “Annotations”| Property | Value |
|---|---|
| Read-only | no |
| Destructive | yes |
| Idempotent | yes |
| Open-world | yes |
| Confirmation required | yes (__confirm:true required) |