Telegram step

Telegram step works as an interface to Telegram API. There are following options to work with Telegram step:

  • Professional mode. Choose any Telegram method you like and compose the request in JSON-format;

  • Send text message. Easier way to deal with sendMessage method. Typing a text message + choosing advanced options

Professional mode (HTTP-requests)

There are following fields:

  • Chat IDs. That is ID (or an array of IDs, comma separated) of objects from Integrations/Telegram/TChat data structure (see Telegram data structures).

  • Method type. POST/GET.

  • Method name. One of the Telegram official API-methods.

  • Request body. According Telegram documentation, but exclude parameter chat_id — it will be added automatically, based on Chat IDs field. The input control will check consistency of JSON syntax. You are welcome to use Template system here, adding fields of the current object, global constants or local variables.

  • Save response to... Choose where to save API response (if necessary).

  • Escaping characters with \. If the option ON, Directual will escape characters from the list with \. But be careful. That could conflict with Markdown (inline links mostly). Turn the option OFF if you want to manage that matter by yourself.

Automatic character escaping usually brakes markdown links. Turn it off, if you want to add links, but mirror characters from the list manually.

You can start editing your http-request from another mode, and then switch to Professional.

Send text message

There are following fields:

  • Message (with Markdown formatting by default).

  • Use reply keyboard.

    • List of buttons below, each one has options to request contact or request location.

  • Remove keyboard (doesn't match with the previous option). Removes all reply keyboards.

  • Disable notification.

  • Disable link preview.

  • Escape characters with \. Works in the same way as in Professional mode.

Text message Markdown formatting

Telegram Bot API supports basic formatting for messages. You can use bold, italic, underlined and strikethrough text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly.

In Telegram v.2 step Markdown v2 is turned on by default. Use the following syntax in your message:

*bold \*text*
_italic \*text_
__underline__
~strikethrough~
*bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*
[inline URL](http://www.example.com/)
[inline mention of a user](tg://user?id=123456789)
`inline fixed-width code`
```
pre-formatted fixed-width code block
```
```python
pre-formatted fixed-width code block written in the Python programming language
```

Please note:

  • Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup.

  • Inside pre and code entities, all '`' and '\' characters must be escaped with a preceding '\' character.

  • Inside (...) part of inline link definition, all ')' and '\' must be escaped with a preceding '\' character.

  • In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.

  • In case of ambiguity between italic and underline entities __ is always treated from left to right as beginning or end of underline entity, so instead of ___italic underline___ use ___italic underline_\r__, where \r is a character with code 13, which will be ignored.

Last updated