Chat Settings

Chat, supergroup, discussion-group, and forum-related settings commands.

Chat Settings Commands

Chat, supergroup, discussion-group, and forum-related settings commands.

Handler group source

  • Handler module: backend/tg_client/dialogs/commands/handlers/chat_settings.py
  • Registered commands: 20
  • Registry integration: backend/tg_client/dialogs/commands/registry.py

Command index

Command Handler Service / callable Success event(s) Notes
`delete_chat` handle_chat_settings_commands chat_settings_command_service.delete_chat delete_chat single logical response
`delete_channel` handle_chat_settings_commands chat_settings_command_service.delete_channel delete_channel single logical response
`leave_chat` handle_chat_settings_commands chat_settings_command_service.leave_chat leave_chat single logical response
`set_chat_read_state` handle_chat_settings_commands chat_settings_command_service.set_chat_read_state set_chat_read_state single logical response
`set_chat_title` handle_chat_settings_commands chat_settings_command_service.set_chat_title set_chat_title single logical response
`set_chat_description` handle_chat_settings_commands chat_settings_command_service.set_chat_description set_chat_description single logical response
`set_chat_permissions` handle_chat_settings_commands chat_settings_command_service.set_chat_permissions set_chat_permissions single logical response
`check_chat_username` handle_chat_settings_commands chat_settings_command_service.check_chat_username check_chat_username single logical response
`set_supergroup_username` handle_chat_settings_commands chat_settings_command_service.set_supergroup_username set_supergroup_username single logical response
`toggle_chat_has_protected_content` handle_chat_settings_commands chat_settings_command_service.toggle_chat_has_protected_content toggle_chat_has_protected_content single logical response
`set_chat_slow_mode_delay` handle_chat_settings_commands chat_settings_command_service.set_chat_slow_mode_delay set_chat_slow_mode_delay single logical response
`set_chat_direct_messages_group` handle_chat_settings_commands chat_settings_command_service.set_chat_direct_messages_group set_chat_direct_messages_group single logical response
`set_chat_discussion_group` handle_chat_settings_commands chat_settings_command_service.set_chat_discussion_group set_chat_discussion_group single logical response
`get_suitable_discussion_chats` handle_chat_settings_commands chat_settings_command_service.get_suitable_discussion_chats get_suitable_discussion_chats single logical response
`get_suitable_personal_chats` handle_chat_settings_commands chat_settings_command_service.get_suitable_personal_chats get_suitable_personal_chats single logical response
`set_personal_chat` handle_chat_settings_commands chat_settings_command_service.set_personal_chat set_personal_chat single logical response
`hide_personal_chat` handle_chat_settings_commands chat_settings_command_service.hide_personal_chat hide_personal_chat single logical response
`toggle_supergroup_sign_messages` handle_chat_settings_commands chat_settings_command_service.toggle_supergroup_sign_messages toggle_supergroup_sign_messages single logical response
`toggle_supergroup_is_all_history_available` handle_chat_settings_commands chat_settings_command_service.toggle_supergroup_is_all_history_available toggle_supergroup_is_all_history_available single logical response
`toggle_supergroup_is_forum` handle_chat_settings_commands chat_settings_command_service.toggle_supergroup_is_forum toggle_supergroup_is_forum single logical response

Group conventions

  • Incoming client requests use the WebSocket action field and are routed into the owner runtime via publish_command().
  • Outbound success/error payloads are wrapped into chat_update live events.
  • ctx.send_response() means one logical success event plus a conventional <command>_error event on failure.
  • Manual ctx.send() branches indicate streaming or custom event emission; these commands are documented explicitly below.
  • Request field types and required flags are inferred from handler/service code because there is no formal request schema object for every command.

Command: delete_chat

Summary

Delete chat.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 31).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::delete_chat.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "delete_chat",
  "userbot_id": 1,
  "chat_id": -1001234567890
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
revoke boolean optional true Derived from handler payload access in current code.
remove_from_chat_list boolean optional true Derived from handler payload access in current code.

Response variants

  • Success event(s): delete_chat.
  • Error event(s): delete_chat_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "delete_chat",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes delete_chat.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::delete_chat.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: delete_channel

Summary

Delete channel.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 40).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::delete_channel.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "delete_channel",
  "userbot_id": 1,
  "chat_id": -1001234567890
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
revoke boolean optional true Derived from handler payload access in current code.
remove_from_chat_list boolean optional true Derived from handler payload access in current code.

Response variants

  • Success event(s): delete_channel.
  • Error event(s): delete_channel_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "delete_channel",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
deleteChannel is supported only for channels string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes delete_channel.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::delete_channel.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: leave_chat

Summary

Leave chat.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 49).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::leave_chat.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "leave_chat",
  "userbot_id": 1,
  "chat_id": -1001234567890
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.

Response variants

  • Success event(s): leave_chat.
  • Error event(s): leave_chat_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "leave_chat",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes leave_chat.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::leave_chat.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: set_chat_read_state

Summary

Set chat read state.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 54).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_read_state.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_chat_read_state",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "is_marked_as_unread": true,
  "mark_as_read": "value"
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
is_marked_as_unread boolean optional Derived from handler payload access in current code.
mark_as_read unknown optional Derived from handler payload access in current code.

Response variants

  • Success event(s): set_chat_read_state.
  • Error event(s): set_chat_read_state_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_chat_read_state",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
is_marked_as_unread or mark_as_read is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_chat_read_state.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_read_state.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: set_chat_title

Summary

Set chat title.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 63).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_title.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_chat_title",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "title": "Product Team"
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
title string required Derived from handler payload access in current code.

Response variants

  • Success event(s): set_chat_title.
  • Error event(s): set_chat_title_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_chat_title",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
title is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_chat_title.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_title.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: set_chat_description

Summary

Set chat description.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 71).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_description.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_chat_description",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "description": "Internal coordination chat"
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
description unknown required Derived from handler payload access in current code.

Response variants

  • Success event(s): set_chat_description.
  • Error event(s): set_chat_description_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_chat_description",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
description is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_chat_description.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_description.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: set_chat_permissions

Summary

Set chat permissions.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 79).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_permissions.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_chat_permissions",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "permissions": {
    "can_send_basic_messages": true
  }
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
permissions unknown required Derived from handler payload access in current code.

Response variants

  • Success event(s): set_chat_permissions.
  • Error event(s): set_chat_permissions_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_chat_permissions",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
permissions is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_chat_permissions.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_permissions.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: check_chat_username

Summary

Check chat username.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 87).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::check_chat_username.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "check_chat_username",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "username": "ihor"
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
username string required Derived from handler payload access in current code.

Response variants

  • Success event(s): check_chat_username.
  • Error event(s): check_chat_username_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "check_chat_username",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
username is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes check_chat_username.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::check_chat_username.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: set_supergroup_username

Summary

Set supergroup username.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 95).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_supergroup_username.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_supergroup_username",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "supergroup_id": 1,
  "username": "ihor"
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
supergroup_id integer optional Derived from handler payload access in current code.
username string required Derived from handler payload access in current code.

Response variants

  • Success event(s): set_supergroup_username.
  • Error event(s): set_supergroup_username_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_supergroup_username",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
username is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_supergroup_username.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_supergroup_username.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: toggle_chat_has_protected_content

Summary

Toggle chat has protected content.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 104).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::toggle_chat_has_protected_content.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "toggle_chat_has_protected_content",
  "userbot_id": 1,
  "chat_id": -1001234567890
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
has_protected_content boolean optional true Derived from handler payload access in current code.

Response variants

  • Success event(s): toggle_chat_has_protected_content.
  • Error event(s): toggle_chat_has_protected_content_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "toggle_chat_has_protected_content",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes toggle_chat_has_protected_content.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::toggle_chat_has_protected_content.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: set_chat_slow_mode_delay

Summary

Set chat slow mode delay.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 112).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_slow_mode_delay.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_chat_slow_mode_delay",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "slow_mode_delay": "value"
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
slow_mode_delay unknown required Derived from handler payload access in current code.

Response variants

  • Success event(s): set_chat_slow_mode_delay.
  • Error event(s): set_chat_slow_mode_delay_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_chat_slow_mode_delay",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
slow_mode_delay is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_chat_slow_mode_delay.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_slow_mode_delay.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: set_chat_direct_messages_group

Summary

Set chat direct messages group.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 120).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_direct_messages_group.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_chat_direct_messages_group",
  "userbot_id": 1,
  "chat_id": -1001234567890
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
is_enabled boolean optional false Derived from handler payload access in current code.
paid_message_star_count integer optional 0 Derived from handler payload access in current code.

Response variants

  • Success event(s): set_chat_direct_messages_group.
  • Error event(s): set_chat_direct_messages_group_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_chat_direct_messages_group",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_chat_direct_messages_group.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_direct_messages_group.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: set_chat_discussion_group

Summary

Set chat discussion group.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 129).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_discussion_group.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_chat_discussion_group",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "discussion_chat_id": 1
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
discussion_chat_id integer required Derived from handler payload access in current code.

Response variants

  • Success event(s): set_chat_discussion_group.
  • Error event(s): set_chat_discussion_group_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_chat_discussion_group",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
discussion_chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_chat_discussion_group.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_chat_discussion_group.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: get_suitable_discussion_chats

Summary

Get suitable discussion chats.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 137).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::get_suitable_discussion_chats.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "get_suitable_discussion_chats",
  "userbot_id": 1
}

Parameters

Field Type Required Default Description
This command does not require extra payload fields beyond action and userbot_id.

Response variants

  • Success event(s): get_suitable_discussion_chats.
  • Error event(s): get_suitable_discussion_chats_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "get_suitable_discussion_chats",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
TDLib / service error string Raw API call fails or the service returns a transport-shaped error Forwarded from TdlibBaseClient.tg_call() or the service layer.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes get_suitable_discussion_chats.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::get_suitable_discussion_chats.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Needs verification based on code

  • This command exposes no handler-level payload fields. Confirm whether clients send additional optional keys that the service ignores.

Command: get_suitable_personal_chats

Summary

Get suitable personal chats.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 142).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::get_suitable_personal_chats.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "get_suitable_personal_chats",
  "userbot_id": 1
}

Parameters

Field Type Required Default Description
This command does not require extra payload fields beyond action and userbot_id.

Response variants

  • Success event(s): get_suitable_personal_chats.
  • Error event(s): get_suitable_personal_chats_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "get_suitable_personal_chats",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
TDLib / service error string Raw API call fails or the service returns a transport-shaped error Forwarded from TdlibBaseClient.tg_call() or the service layer.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes get_suitable_personal_chats.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::get_suitable_personal_chats.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Needs verification based on code

  • This command exposes no handler-level payload fields. Confirm whether clients send additional optional keys that the service ignores.

Command: set_personal_chat

Summary

Set personal chat.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 147).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_personal_chat.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "set_personal_chat",
  "userbot_id": 1,
  "chat_id": -1001234567890
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.

Response variants

  • Success event(s): set_personal_chat.
  • Error event(s): set_personal_chat_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "set_personal_chat",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
chat_id is required string Service-side validation or branch guard Returned as the error field of the error event.
chat_id must not be 0 string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes set_personal_chat.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::set_personal_chat.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: hide_personal_chat

Summary

Hide personal chat.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 154).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::hide_personal_chat.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "hide_personal_chat",
  "userbot_id": 1
}

Parameters

Field Type Required Default Description
This command does not require extra payload fields beyond action and userbot_id.

Response variants

  • Success event(s): hide_personal_chat.
  • Error event(s): hide_personal_chat_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "hide_personal_chat",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
TDLib / service error string Raw API call fails or the service returns a transport-shaped error Forwarded from TdlibBaseClient.tg_call() or the service layer.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes hide_personal_chat.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::hide_personal_chat.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Needs verification based on code

  • This command exposes no handler-level payload fields. Confirm whether clients send additional optional keys that the service ignores.

Command: toggle_supergroup_sign_messages

Summary

Toggle supergroup sign messages.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 159).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::toggle_supergroup_sign_messages.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "toggle_supergroup_sign_messages",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "supergroup_id": 1,
  "sign_messages": "value",
  "show_message_sender": "value"
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
supergroup_id integer optional Derived from handler payload access in current code.
sign_messages unknown optional Derived from handler payload access in current code.
show_message_sender unknown optional Derived from handler payload access in current code.

Response variants

  • Success event(s): toggle_supergroup_sign_messages.
  • Error event(s): toggle_supergroup_sign_messages_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "toggle_supergroup_sign_messages",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
TDLib / service error string Raw API call fails or the service returns a transport-shaped error Forwarded from TdlibBaseClient.tg_call() or the service layer.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes toggle_supergroup_sign_messages.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::toggle_supergroup_sign_messages.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_is_all_history_available, toggle_supergroup_is_forum.

Command: toggle_supergroup_is_all_history_available

Summary

Toggle supergroup is all history available.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 169).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::toggle_supergroup_is_all_history_available.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "toggle_supergroup_is_all_history_available",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "supergroup_id": 1,
  "is_all_history_available": true
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
supergroup_id integer optional Derived from handler payload access in current code.
is_all_history_available boolean required Derived from handler payload access in current code.

Response variants

  • Success event(s): toggle_supergroup_is_all_history_available.
  • Error event(s): toggle_supergroup_is_all_history_available_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "toggle_supergroup_is_all_history_available",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
is_all_history_available is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes toggle_supergroup_is_all_history_available.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::toggle_supergroup_is_all_history_available.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_forum.

Command: toggle_supergroup_is_forum

Summary

Toggle supergroup is forum.

Location in code

  • Handler: backend/tg_client/dialogs/commands/handlers/chat_settings.py::handle_chat_settings_commands (branch starts near line 178).
  • Service: backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::toggle_supergroup_is_forum.
  • Raw API modules: backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Normalizer / typed builder: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.

Request

Structure

{
  "action": "toggle_supergroup_is_forum",
  "userbot_id": 1,
  "chat_id": -1001234567890,
  "supergroup_id": 1,
  "is_forum": true
}

Parameters

Field Type Required Default Description
chat_id integer required Derived from handler payload access in current code.
supergroup_id integer optional Derived from handler payload access in current code.
is_forum boolean required Derived from handler payload access in current code.

Response variants

  • Success event(s): toggle_supergroup_is_forum.
  • Error event(s): toggle_supergroup_is_forum_error.
  • Result shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Common outbound envelope:
{
  "type": "chat_update",
  "userbot_id": 1,
  "payload": {
    "userbot_id": 1,
    "type": "toggle_supergroup_is_forum",
    "result": "<typed payload or TDLib-like result>"
  }
}

Errors

Error Type/Code When happens Notes
is_forum is required string Service-side validation or branch guard Returned as the error field of the error event.
TDLib / transport error string Raw API call fails or TDLib raises in the transport wrapper Forwarded from TdlibBaseClient.tg_call() or returned by the service.

Flow

  • TDLibListChatsConsumer.receive_json() forwards the WebSocket action into publish_command().
  • AccountOwnerWorker receives the command envelope and invokes dispatch_command_payload().
  • Registry handler handle_chat_settings_commands processes toggle_supergroup_is_forum.
  • Service layer executes backend/tg_client/dialogs/tdlib/services/chat_settings_command_service.py::toggle_supergroup_is_forum.
  • Raw TDLib wrapper(s): backend/tg_client/dialogs/tdlib/api/chat_settings.py, backend/tg_client/dialogs/tdlib/api/chats.py, backend/tg_client/dialogs/tdlib/api/messages.py, backend/tg_client/dialogs/tdlib/api/topics.py.
  • Result normalization / shaping: backend/tg_client/dialogs/tdlib/normalizers/chat_settings_normalizer.py, backend/tg_client/dialogs/tdlib/normalizers/chat_access_normalizer.py.
  • Final payload is emitted through ctx.send() / ctx.send_response() -> send_ws() -> live event publisher.
  • Sibling commands in this handler group: delete_chat, delete_channel, leave_chat, set_chat_read_state, set_chat_title, set_chat_description, set_chat_permissions, check_chat_username, set_supergroup_username, toggle_chat_has_protected_content, set_chat_slow_mode_delay, set_chat_direct_messages_group, set_chat_discussion_group, get_suitable_discussion_chats, get_suitable_personal_chats, set_personal_chat, hide_personal_chat, toggle_supergroup_sign_messages, toggle_supergroup_is_all_history_available.