# Client. Chat List (TelegramClientGetChats)

Returns all user chats: group chats, channels, dialogues.

<table data-header-hidden><thead><tr><th width="239" valign="top"></th><th width="321" valign="top"></th></tr></thead><tbody><tr><td valign="top">Connection</td><td valign="top">[Link] Client connection object. The variable name in this property must match the variable name in the "Connection" property of the "Client. Create Connection" block from the Telegram group that was previously used to connect the Telegram client.</td></tr><tr><td valign="top">Filter</td><td valign="top">[Text] A string for filtering the chat list. Searches for the occurrence of the specified value in chats (Id, Title) and in dialogues (Id, FirstName, LastName, Username, Phone).</td></tr><tr><td valign="top">Return as list</td><td valign="top"><p>If enabled, the result will be returned as a list of chat objects. Available properties: Id; Title; IsPrivate - indicates that this chat is private with the User.</p><p>If the property is equal to $true (and the "Extract User Data" property is also enabled), then the following properties are available: UserId; UserName; PhoneNumber.</p><p>Properties Chat and User are also available, pointing to these Telegram objects.</p></td></tr><tr><td valign="top">Extract User Data</td><td valign="top">If the "Return as list" property is enabled, then when this property is enabled, user data will be extracted for private chats.</td></tr><tr><td valign="top">Chat List</td><td valign="top"><p>[Dictionary/List] The list of chats is returned as a dictionary. The keys of the dictionary are the chat names, and the values are the chat ids.</p><p>For example: $chatid = $Chats["username"]. This retrieves the chat id value with the user username, and this variable can then be used in message sending blocks.</p><p>If a list is returned, the following properties are available: Id, Title, UserId, Username, PhoneNumber.</p></td></tr><tr><td valign="top">Error Handling Level</td><td valign="top"><p>Select the error handling level. Possible values:</p><ul><li>"Default" - by default;</li><li>"Ignore" - errors are ignored;</li><li>"Handle" - errors are handled.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Message Level</td><td valign="top"><p>Select the message level that blocks will output during operation. Possible values:</p><ul><li>"Default" - by default;</li><li>"Release" - output is disabled;</li><li>"Debug" - main information output;</li><li>"Detailed" - detailed information output.</li></ul><p>If "Default" is selected, the value from the "Start" block of this diagram will be used.</p></td></tr><tr><td valign="top">Error Text</td><td valign="top">[Text] Returns detailed information about the error in case of incorrect execution of the block.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sherparpa.ru/en/sherpa-rpa/sherpa-designer/spravochnik-blokov/telegram/klient.-spisok-chatov-telegramclientgetchats.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
