This tool helps you quickly set up a project structure for a Telegram bot using Python's aiogram library. It generates all the necessary files and dependencies, allowing you to focus on your bot's logic rather than its setup.
- Modular project structure for scalable Telegram bots.
- Suitable for both simple and complex bot projects.
- Automatic installation of dependencies.
- Pre-configured files for handlers, configurations, and more.
- Optional middlewares, database setup, and utility integrations for larger bots.
git clone https://github.com/abdulaziz-backend/aiogram-template.gitcd <repository_directory>Once installed, you can generate a Telegram bot project using the following commands:
py manage.py- The tool will prompt for the project name and whether you'd like to include middlewares, database setup, and other utilities (for larger projects).
- Navigate to the Project Directory
cd <project_name>python -m venv venv##3. Activate the Virtual Environment: Windows:
venv\Scripts\activatemacOS/Linux:
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root and add your bot token:
BOT_TOKEN=your_bot_token_here
- Run the Bot
python bot.py