# Получение токена Telegram-бота

{% hint style="info" %}
Если Telegram-бот уже создан и у вас нет к нему доступа, обратитесь к специалисту, который создавал бота. Иначе следуйте инструкциям ниже в зависимости от ситуации.
{% endhint %}

<details>

<summary>У меня уже есть Telegram-бот</summary>

Перейдите в [BotFather](https://t.me/botfather) и выберите необходимого бота удобным способом:

* Нажмите `/start` и затем выберите `/mybots - edit your bots`;
* Нажмите иконку 🍔 слева внизу и затем выберите `/mybots - edit your bots`;
* Введите команду `/mybots`.

После выполнения команды вы получите список доступных вам ботов. Выберите необходимого бота и нажмите на кнопку `API Token`&#x20;

Далее BotFather выдаст токен. Это сообщение вида:

*"*&#x48;ere is the token for bot *...**"***

Нажмите на токен, и он автоматически скопируется.

</details>

<details>

<summary>У меня нет Telegram-бота</summary>

Перейдите в [BotFather](https://t.me/botfather) и создайте бота любым удобным способом:

* Нажмите `/start` и затем выберите `/newbot - create a new bot`;
* Нажмите иконку 🍔 слева внизу и затем выберите `/newbot - create a new bot`;
* Введите команду `/newbot`.

После выполнения команд следуйте инструкциям и подсказкам BotFather.

После того как вы создали бота, BotFather выдаст токен. Это сообщение вида:

*"Use this token to access the HTTP API: ...**"***

Нажмите на токен, и он автоматически скопируется.

</details>


---

# Agent Instructions: 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:

```
GET https://assistant-docs.2people.io/poleznoe/poluchenie-tokena-telegram-bota.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
