A template for creating Telegram bots using botspot - a framework built on top of aiogram that provides useful components and utilities.
- 🚀 Quick setup with minimal boilerplate
- 🛠 Built-in components for common bot features
- 🔧 Easy configuration via environment variables
- 📝 Command menu management out of the box
- ⚡ Error handling and reporting
- 🔍 Bot URL printing for easy testing
- Clone this template:
git clone https://github.com/calmmage/botspot-template.git your-bot-name
cd your-bot-name- Install dependencies:
poetry install- Set up your environment:
cp example.env .env
# Edit .env with your bot token and settings- Run the bot:
poetry run python run.py.
├── app/
│ ├── _app.py # Core app
│ ├── bot.py # Bot setup & launcher
│ ├── router.py
│ └── __init__.py
├── example.env # Example environment variables
├── pyproject.toml # Project dependencies
├── README.md
├── Dockerfile
├── docker-compose.yaml
└── run.py # Main entry point - for docker etc.
The template uses environment variables for configuration. See example.env for available options:
TELEGRAM_BOT_TOKEN: Your bot token from @BotFatherBOTSPOT_PRINT_BOT_URL_ENABLED: Print bot URL on startupBOTSPOT_ERROR_HANDLER_ENABLED: Enable error handlingBOTSPOT_BOT_COMMANDS_MENU_ENABLED: Enable command menu- And more...
- Install pre-commit hooks:
pre-commit install- Run tests:
poetry run pytestBuild and run with Docker:
docker-compose up --buildThis project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.