Client. Export Messages (TelegramClientGetMessages)#

Exports messages from a chat. The export of messages occurs from the last one,
i.e., from bottom to top.

Connection[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.
Destination

[Text] Destination object. This string can contain the following values:

  • Chat Id,
  • Chat name,
  • User Id,
  • Combination of "FirstName LastName" of the User,
  • Username value of the User,
  • User's phone.
Offset[Number] Message identifier from which the export starts. The default value is set to 0, which means loading messages from the very last one.
Count[Number] Sets a limit on the number of messages to be exported at one time.
Contact Filter[Text] String for filtering contacts in the chat. Searches for the occurrence of the specified value in Id, FirstName, LastName, Username, Phone.
Message Filter[Text] String for filtering the message text. Searches for the occurrence of the specified value.
Message Stream[Text] String with the message stream identifier. Used when working with news comments.
Number of Attempts[Number] Number of attempts in case of a communication error with the server.
Messages

[List] Returns a list of messages. Each item in the list is a message object. The object has the following properties:

  • Id - message id;
  • Date - date;
  • From - who the message is from;
  • To - who the message is to;
  • FromId - User Id of the sender;
  • Title - chat name;
  • Text - message text;
  • Type - textual designation of the message type;
  • IsFile - indicates whether there is a file in the message (the type can be more precisely defined using the properties IsDocument, IsPhoto). For example: $TMessage.IsPhoto - if equal to $true, then there is a photo in the message.
Error Handling Level

Select the error handling level. Possible values:

  • "Default" - by default;
  • "Ignore" - errors are ignored;
  • "Handle" - errors are handled.

If "Default" is selected, the value from the "Start" block of this diagram will be used.

Message Level

Select the level of messages that will be output by the blocks during operation. Possible values:

  • "Default" - by default;
  • "Release" - output is disabled;
  • "Debug" - main information output;
  • "Detailed" - detailed information output.

If "Default" is selected, the value from the "Start" block of this diagram will be used.

Error Text[Text] Returns detailed information about the error in case of incorrect execution of the block's work.