A clean and well-structured template to kickstart your Telegram Bot projects efficiently. Includes modular architecture, environment setup, and clear guidelines.
- Modular Design: Organized code structure for scalability.
- Environment Management: Pre-configured
.envexample file for secure settings. - Dependency Management: Powered by Poetry for simplified package management.
- Error Handling: Centralized error-handling logic.
- State Management: FSM-ready structure for complex workflows.
├── app/
│ ├── __init__.py
│ ├── main.py # Entry point
│ ├── config.py # Bot configurations (e.g., tokens)
│ ├── errors/
│ │ ├── __init__.py
│ │ ├── error_handler.py # Error handler
│ ├── handlers/
│ │ ├── __init__.py
│ │ ├── users.py # Handles user-specific actions
│ │ ├── groups.py # Handles group-specific actions
│ │ ├── channels.py # Handles channel-specific actions
│ ├── keyboards/
│ │ ├── __init__.py
│ │ ├── keyboards.py
│ │ ├── menus.py # Inline and reply keyboards
│ ├── states/
│ │ ├── __init__.py
│ │ ├── registration.py # FSM states for registration
│
│env.example # Create .env file and copy the env.example file
│
│poetry.lock # venv dependencies
│pyproject.toml # venv dependencies
https://github.com/khurshiduktamov/aiogram-bot-template.git
cd aiogram-bot-templateEnsure Poetry is installed and run:
poetry install- Copy
env.exampleto.env:
cp env.example .env- Add your configuration values to the
.envfile.
poetry run python app/main.pyWe welcome your contributions! Please:
- Fork the repository.
- Create a branch for your changes.
- Submit a pull request for review.
This project is licensed under the MIT License. See the LICENSE file for details.
- Author: Khurshid Uktamov
- Email: xurshid3777@gmail.com
- GitHub: https://github.com/khurshiduktamov