Skip to content

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.

{
"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.

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.

Any member can call it, including while timed out.

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.