🇷🇺 README на русском доступен здесь
A simple Telegram bot which uses Telegram Forums feature to separate different users to different topics. This bot is the result of evolution of my simple stateless feedback bot.
- Python 3.11
- PostgreSQL 15
- Redis
- aiogram 3.x
- SQLAlchemy 2.x
- psycopg3 (aka psycopg)
and more...
- install docker.
- place your localization files (see relevant README)
- create virtual environment
python -m venv venv
- install dependencies
pip install -r requirements.txt
- change postgres user and password in
compose.local.yml
- fill
settings.yml
(copy from settings.example.yml) - start docker containers with redis and
postgres
docker compose -f compose.local.yml up -d
- (first run) apply migrations to DB
alembic upgrade head
- start application
python -m bot
- change postgres user and password in
compose.yml
- fill
settings.prod.yml
(copy from settings.prod.example.yml) - start docker compose
docker compose up -d
- (first run) apply migrations to DB
docker compose exec tg_bot alembic upgrade head
P.S.
If you get error Could not create new topic error_type=TelegramBadRequest message=Bad Request: not enough rights to create a topic method=CreateForumTopic
-
Your bot must be an administrator (has permissions to create topics) in your's telegram
group.