TelegramDynamicsBot is an ad-campaign automation tool for Telegram, featuring a dual-bot architecture. A control bot built with Aiogram collects campaign parameters from the user, and a UserBot executes message broadcasts on behalf of the user.
- Framework: Aiogram
- Role: Provides an intuitive interface for administrators to create, schedule, and manage announcements, groups, and message templates.
- Features:
- Command handling
- Interactive dialogues for setup and management
- Real-time status monitoring
- Framework: Pyrogram
- Role: Logs in as a Telegram user to bypass Bot API restrictions and dispatch scheduled messages to groups.
- Features:
- Scheduled message dispatch using APScheduler
- Seamless integration with the main bot via a shared database
-
Dual-Component Architecture:
Separates administrative functions from message dispatching for enhanced scalability and flexibility. -
Robust Data Management:
Utilizes PostgreSQL with SQLAlchemy for ORM and Alembic for database migrations. -
Containerized Deployment:
Fully Dockerized using Docker Compose, including containers for:- Main bot
- Userbot
- PostgreSQL
- Redis (optional)
- Adminer for database management
-
Modern Asynchronous Stack:
Leverages Python 3.10+ with asynchronous libraries to handle multiple tasks efficiently.
- Language: Python 3.10+
- Frameworks & Libraries:
- Aiogram: For Telegram Bot API interactions.
- Pyrogram: For Telegram client operations.
- SQLAlchemy & Alembic: For ORM and database migrations.
- APScheduler: For task scheduling.
- Docker: For containerization.
- Database & Caching:
- PostgreSQL: Primary data storage.
- Redis: Optional, for caching and state management.
docker-compose upIt will create the containers.CTRL + ZIt will detach from the containers.sh run_migrations.shIt will run the migrations for the DB.