Bot. Send Message#

Sending a text message in the chat.

Connection[Link] Connection object to the bot. The variable name in this property must match the variable name in the "Connection" property of the "Bot. Create Connection" block from the Telegram group that was previously used to connect to the Telegram bot.
Chat ID

[Number] Chat ID. This value can be obtained:

  • from the "Bot. Get Message" block in the "Message" property - $TMessage.ChatId;
  • from the "Bot. List Chats" block in the "List of Chats" property - $Chats["username"].
Message ID[Number] You can enter the ID of the message to which you want to reply. This value can be obtained from the "Bot. Get Message" block in the "Message" property - $TMessage.Id
Text[Text] Message text.
Buttons

[Dictionary] A dictionary of buttons that will be sent along with the message. The key of the dictionary is the button name, and the value of the dictionary is the callback data.

For example: @{ "Back"="butBack"; "Forward"="butForward" }. The values "butBack" and "butForward" will be returned in the $TMessage.CallbackData property. More details are described in the "Callback" property of the "Bot. Get Message" block.

Number of Button Columns[Number] If the value is empty, the buttons will be arranged in a single row. If a value is specified, the buttons will be arranged in the specified number of columns.
Disable NotificationWhen enabled, the delivery notification will not be sent.
Disable PreviewWhen enabled, link previews are disabled.
HTML FormattingWhen enabled, text can use formatting with HTML tags. For example: <b>Bold text</b>.
Message Thread[Number/Text] Specify the thread ID to which the message should be sent. This allows sending a message to a specific group within a supergroup, as well as to the comment chat for a specific channel message. If you are sending a message to a supergroup, then message_thread_id refers to a specific group within the supergroup. If you are writing a comment for a message in a channel, then message_thread_id refers to the comment thread for a specific channel message. This identifier can be obtained using the "Client. Get Message Thread ID" block.
Number of Attempts[Number] The number of attempts in case of a connection error with the server.
Message

[Link] Returns the object of the sent message. Available properties:

  • Id - message ID;
  • ChatId - chat ID;
  • From - username of the sender;
  • 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 determined using the IsDocument, IsPhoto properties). 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" - 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 message level that blocks will output during operation. Possible values:

  • "Default" - 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.