Technical Architecture: Chat Folder Management Engine
Overview
This technical sub-specification details the TDLib JSON API integration patterns for Telegram chat folder management (Requirement ID: [TECH-006]).
TDLib Method Mappings
Get Chat Folders (``getChatFolders``):
Payload:
{"@type": "getChatFolders", "main_chat_list_position": 0}Response:
chatFoldersobject containing arraychat_foldersofchatFolderInfoitems (id,title,icon,color_id).
Get Detailed Chat Folder Settings (``getChatFolder``):
Payload:
{"@type": "getChatFolder", "chat_folder_id": <id>}Response:
chatFolderobject containing title, icon, colors, and chat filter criteria.
Create Chat Folder (``createChatFolder``):
Payload:
{ "@type": "createChatFolder", "folder": { "@type": "chatFolder", "title": "<title>", "icon": {"@type": "chatFolderIcon", "name": "Custom"}, "color_id": -1, "pinned_chat_ids": [], "included_chat_ids": [], "excluded_chat_ids": [], "exclude_muted": false, "exclude_read": false, "exclude_archived": false, "include_contacts": false, "include_non_contacts": false, "include_bots": false, "include_groups": true, "include_channels": true } }
Response:
chatFolderInfoobject containing assigned integer ID.Edit Chat Folder (``editChatFolder``):
Payload:
{ "@type": "editChatFolder", "chat_folder_id": 1, "folder": { "@type": "chatFolder", "title": "<updated_title>" } }
Response:
okorchatFolderInfo.Delete Chat Folder (``deleteChatFolder``):
Payload:
{"@type": "deleteChatFolder", "chat_folder_id": <id>}Response:
ok.
Filter Chat Listing by Folder (``getChats``):
Payload:
{ "@type": "getChats", "chat_list": { "@type": "chatListFolder", "chat_folder_id": 1 }, "limit": 50 }