> For the complete documentation index, see [llms.txt](https://readme.directual.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://readme.directual.com/scenarios/editing-scenarios/integration-steps/telegram-step.md).

# Telegram step

![](/files/-MTCgLcqvdhMLyUQVyOJ)

Telegram step works as an interface to [Telegram API](https://core.telegram.org/bots/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)

![](/files/-MTChi0gTJbr5UR33Ayq)

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](/api-integrations/other-integrations/telegram.md#step-3-find-telegram-structures-in-directual)).
* **Method type**. POST/GET.
* **Method name**. One of the [Telegram official API-methods](https://core.telegram.org/bots/api).
* **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](/template-system/basics-of-template-system.md) 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](/scenarios/editing-scenarios/integration-steps/telegram-step.md#please-note) 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.&#x20;

{% hint style="warning" %}
Automatic character escaping usually brakes markdown links. Turn it off, if you want to add links, but mirror characters from the list manually.
{% endhint %}

{% hint style="info" %}
You can start editing your http-request from another mode, and then switch to Professional.
{% endhint %}

## **Send text message**

![](/files/-MTCmulYF7_6sgcsiNaN)

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.
