Ban Member
discord.ban_member
ActionChat & messagingconnection required
Calls the Discord API with the connection's credentials.
Ban a user from a server, optionally deleting their recent messages.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- Discord
- Secret shape
- the bot token (sent as "Authorization: Bot <token>") for every op except discord.execute_webhook, whose secret is the webhook URL
- Resolved by
- config.connection_id, else node.connection_id
Configuration
4 fields, 2 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
guild_id Id of the Discord server (right-click the server → Copy Server ID). | string | Yes | — | — | — |
user_id Id of the member's Discord user account. | string | Yes | — | — | — |
delete_message_seconds Also delete this many seconds of the user's recent messages, 0-604800 (7 days). | number | No | — | 0–604800 | — |
reason Why the change was made; recorded in the server's audit log. | string | No | — | ≤ 512 characters | — |
Output
One shape.
result
| Field | Type | Example |
|---|---|---|
ok True once Discord accepted the call. | boolean | true |
guild_id Server the ban was created in. | string | — |
user_id User who was banned. | string | — |
banned True — the user is banned. | boolean | true |
{
"banned": true,
"guild_id": "",
"ok": true,
"user_id": ""
}Notes
- Needs a Discord connection whose secret is the bot token.
- Needs BAN_MEMBERS. The user need not currently be a member.
See Ban Member run in a workflow.
In a technical demo we add the Discord connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.