# Инструкция по установке UserBot

Получение api\_id и api\_hash - <https://my.telegram.org/apps>

<figure><img src="/files/LItEIXNNSkhQ6mGHR1Y8" alt=""><figcaption></figcaption></figure>

Дальше будет поле  api\_id и api\_hash, их скопировать

Нстройка configs/config.yaml

1\) api\_id - который мы получили

2\) api\_hash - который мы получили

3\) chat\_id - айди чата ВМЕСТЕ С МИНУСОМ (Нужно получить с помощью Telegram Web открыть нужный чат)

4\) only\_admins - реагировать только на владельца чата и админов

5\) use\_gpt - использовать ChatGPT

6\) timeout - Включено или Выключено задержка ответа

7\) seconds\_timeout - через сколько секунд отвечать (Работает только при timeout: True) (Если используете GPT то лучше не стоит)

8\) phrases - регулярные выражения, лучше не трогать, можно добавить&#x20;

<figure><img src="/files/CfFsplK6aOGcm49sG1ZD" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/UbpniasnkWVtnHUTG5bD" alt=""><figcaption></figcaption></figure>

Установка бота на хост (Ubuntu 24)

1\) sudo apt install -y python3-venv

2\) cd user

3\) python3 -m venv venv

4\) source venv/bin/activate

5\) pip3 install -r requirements.txt

6\) python3 bot.py&#x20;

<figure><img src="/files/R9rWiNaFy7Kcn0L5003o" alt=""><figcaption></figcaption></figure>

После запуска просит ввести и подтвердить номер, так же код из телеграмм&#x20;

ЧТОБЫ ЭТОГО НЕ БЫЛО КАЖДЫЙ РАЗ - НЕ УДАЛЯТЬ ФАЙЛЫ СЕССИИ

<figure><img src="/files/LtnbIWuYuTRroJGfMzTU" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/mcx35XXdJts882wHoIO2" alt=""><figcaption></figcaption></figure>

PROFIT


---

# 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://mwu360-sueta.gitbook.io/docs/instrukciya-po-ustanovke-userbot.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.
