> For the complete documentation index, see [llms.txt](https://docs.salebot.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.salebot.pro/chatbots/channels/telegram/chatbot.md).

# Как создать Telegram бота

{% hint style="warning" %}
Важно знать!&#x20;

При работе с Telegram учитывайте требования:

* Максимальная длина текстового сообщения 4096 символов, для сообщения с картинкой (1080\*1080px) не более 1024 символов
* Требования к картинкам, фото. Telegram предпочитает квадратные картинки, оптимально 900х900 пикселей, весом не более 5Мб

Требования к файлам. Api Telegram требователен к загружаемым файлам

* Боты могут отправлять файлы до 2 Гб.
* Для работы с ранее загруженными файлами можно использовать file\_id. В этом случае к файлу применяются лимиты согласно документации Telegram.
* Файлы могут быть отправлены с использованием URL-адреса. В этом случае бот загружает файл и отправляет его. Максимальный размер для фотографий — 5 МБ, для других типов контента — 20 МБ
* Для постинга установлены иные лимиты: для фото - 10Мб, остальные файлы - 2 Гб.

[Подробнее в первоисточнике](https://core.telegram.org/bots/api#sending-files)
{% endhint %}

## Создание бота в Telegram

Бот в Telegram создается при помощи другого бота под названием[ BotFather](https://t.me/BotFather) - данный Telegram-канал поможет Вам без знаний программирования создать Бота.

Стоит отметить, что рядом с названием BotFather есть галочка (данный ориентир позволит Вам не наткнуться на иные мошеннические каналы).

Отправьте ему команду /newbot, указываем имя-логин вашего бота (должен обязательно заканчиваться на bot или \_bot).

Если адрес не занят, BotFather пришлет в ответ сообщение с токеном — «ключом» для доступа к созданному боту. Его нужно сохранить и никому не показывать:

<figure><img src="/files/i1AccoHqtSHXUjk6NAl1" alt="" width="484"><figcaption><p>Создание бота</p></figcaption></figure>

После этого нужно зайти в раздел "Каналы", выбрать Telegram и ввести в форму токен вашего бота:

<figure><img src="/files/qzmJeeZdsPo0ZIwwmcyI" alt=""><figcaption><p>Подключение бота Telegram к проекту</p></figcaption></figure>

Нажмите кнопку готово. На этом подключение бота завершено.

## Видео-инструкции

### 1. Создать чат-бота для Телеграм

{% embed url="<https://www.youtube.com/watch?ab_channel=Salebot-%D0%9A%D0%BE%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%82%D0%BE%D1%80%D1%87%D0%B0%D1%82%D0%B1%D0%BE%D1%82%D0%BE%D0%B2&v=NuvKVGXDywI>" %}

### 2. Подключить бота к Сейлбот

{% embed url="<https://youtu.be/aefp_YnP41I>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.salebot.pro/chatbots/channels/telegram/chatbot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
