user_leave
Leave the server as the signed-in user. The server marks you as no longer a member and closes the connection you sent this on.
Request
Section titled “Request”{ "cmd": "user_leave", "delete_messages": true}| Field | Type | Required | Description |
|---|---|---|---|
delete_messages |
boolean | No | When true, delete every message you posted in text, voice, and forum channels and their threads, along with their polls and attachments. Defaults to false. |
Response
Section titled “Response”The server closes your connection before it sends a reply, so don’t wait for one. Treat the socket closing as success. The reply it builds looks like this:
{ "cmd": "user_leave", "user": "alice", "val": "User left server", "messages_deleted": 12}Every other authenticated connection receives:
{ "cmd": "user_leave", "username": "alice"}If you set delete_messages, members who can see the affected channels also receive a message_delete frame for each removed message.
- Only the connection that sent the command is closed. Your other open sessions stay connected, but every command they send fails with
You are not currently a member of this server. - You can rejoin by signing in again, subject to the server’s access mode.
- Your roles are kept.
Permissions
Section titled “Permissions”Any member can call it, including while timed out.
Errors
Section titled “Errors”These arrive before the connection closes, and you stay a member.
val |
When |
|---|---|
Unable to save users |
The server could not write the change to storage. |
Unable to delete user messages |
Deleting your messages failed. |
Unable to delete message poll |
Deleting a poll attached to one of your messages failed. |
| Validation message | delete_messages is not a boolean. |
