My Telegram Bot with PostgreSQL and Docker
A Telegram bot designed to perform various tasks, including but not limited to showing a service shop, fetching news, and managing a cart. The bot uses Python, Telebot library for Telegram API, and PostgreSQL for database operations. It's containerized using Docker for easy deployment. Features
Main Menu with Inline Keyboard.
Service Shop with different categories.
News Page to fetch and display latest news.
Cart functionality to add or remove services.
PostgreSQL as a database backend.
Pre-requisites
Docker
Docker Compose
Python 3.x
Installation
Clone the Repository
bash
git clone https://github.com/your_username/your_project_name.git
Navigate to the Directory
bash
cd your_project_name
Create an .env file
Create a .env file in the project root directory and add your environment variables.
env
POSTGRES_DB=your_db_name POSTGRES_USER=your_username POSTGRES_PASSWORD=your_password POSTGRES_HOST=db POSTGRES_PORT=5432 TELEGRAM_API_KEY=your_telegram_api_key
Build and Run Docker Containers
css
docker-compose up --build
Usage
Start the bot by sending /start or /menu.
Use the inline keyboard to navigate through the menu options.
Troubleshooting
For any database errors, ensure that your .env file is correctly set up and that the database container is running.
For other issues, check the bot logs for debugging. Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. License
MIT License. See LICENSE for more information.