An async Telegram bot that monitors train availability and holds a seat the moment one opens up.
- A user submits a departure station, arrival station, date, and departure hour.
- The bot creates a background task that polls for availability on a configurable interval.
- When a seat becomes available the bot immediately attempts to hold it.
- The user is notified and the seat is kept held for a configurable window (default 10 minutes) so they can complete the purchase manually.
- The user can cancel a search or release a held seat at any time.
| Layer | Technology |
|---|---|
| Bot framework | aiogram 3.x |
| Database | SQLite via SQLAlchemy (async) |
| Task queue | TaskIQ + Redis |
| HTTP client | curl-cffi |
| Config | Pydantic Settings |
- Python 3.9+
- Redis
# 1. Clone and install dependencies
uv sync
# 2. Copy and fill in the environment file
cp .env.example .env
# 3. Start Redis (if not already running)
redis-server
# 4. Run the bot
tutunsabriAll configuration is done through environment variables (or a .env file).
- New users have no access by default. They can send an access request through the bot, which notifies all admins.
- An admin approves or rejects requests via
/grantand/revoke. - Roles determine how many searches can run in parallel: basic (3), premium (5), admin (unlimited).
The bot applies lightweight SQLite migrations automatically on startup, so there is no separate migration step when upgrading.
This project is developed strictly for educational purposes.
- It is not designed to cause harm, disrupt service availability, perform denial-of-service attacks, or interfere with any third-party system or infrastructure.
- Automated interaction with third-party services may violate their terms of service. You are solely responsible for ensuring your use complies with all applicable laws and the terms of service of any platform you interact with.
Use at your own risk. The author(s) accept no liability for any damages, account bans, legal consequences, or any other outcome arising from the use or misuse of this software.