Welcome, fearless coders and digital sorcerers, to Telegrinder-Alchemy, the repository that empowers you to create mighty Telegram bots! With the combined strength of Telegrinder and SQLAlchemy, this guide will help you craft bots that harness the full potential of PostgreSQL and Docker.
Prepare yourself for a journey through the realms of bot development with these powerful tools at your command:
-
Telegrinder Framework: The Swift Blade ⚡️ An intuitive framework that makes Telegram bot development fast and seamless. Wield it like a master, simplifying your bot-building journey.
-
SQLAlchemy: The Architect of Data 🏺 Manage your bot's data effortlessly with SQLAlchemy, a robust ORM that bridges your bot and its database with precision.
-
Migrations: The Scroll of Evolution 📜 Pre-configured migrations ensure that your database evolves with your bot without risking the integrity of your data structures.
-
PostgreSQL: The Database Colossus 🏛️ A powerful and scalable database that allows your bot to manage vast amounts of data with ease. PostgreSQL is fully integrated to ensure smooth operation.
-
Docker: The Eternal Vessel 🐳 Docker containers make deployment across environments easy, providing your bot with a portable and consistent runtime, no matter the server or platform.
Follow these steps carefully to bring your bot to life:
Begin by cloning the repository to your local machine:
git clone https://github.com/prostomarkeloff/telegrinder-alchemy
cd telegrinder-alchemy
Protect your project from dependency conflicts by creating a virtual environment:
python -m venv venv
source venv/bin/activate # For Windows: venv\\Scripts\\activate
Use Poetry to handle dependencies efficiently:
pip install poetry
Install all the required dependencies with:
poetry install
Set up the necessary environment variables in a .bot-env-dev
and .bot-env-prod
files. Here’s an example:
BOT_TOKEN=token
DB_URL=postgresql+asyncpg://admin:admin@localhost:5432/bot
POSTGRES_DATA_PATH=./postgres-data
POSTGRES_USER=admin
POSTGRES_PASSWORD=admin
POSTGRES_DB=bot
Telegrinder-alchemy lets you use already prewritten scripts, to run your bot locally and get into production. All of them do use docker and compose, so have it in mind getting errors. Let's run our bot!
bash scripts/dev-run.sh
Your bot is now alive and ready to serve!
While your bot is now functional, the road to mastery continues. Consider expanding your bot’s capabilities by exploring advanced features of Telegrinder and fine-tuning your PostgreSQL database for optimal performance. Docker will allow you to scale and deploy your bot seamlessly.
Want to contribute to Telegrinder-Alchemy? Fork the repository, submit issues, or create pull requests. Together, we can build something extraordinary!
Armed with the knowledge of Telegrinder-Alchemy, go forth and build bots of incredible power. Whether your creation is simple or complex, this guide will serve you well.
Happy coding, and may your bots be ever powerful!
- Author: prostomarkeloff
- License: MIT
🐉 THE END. BUT ALSO, THE BEGINNING... 🐉