This project is a Telegram bot for a fast-food ordering system, allowing users to view menus, add items to their cart, and complete orders through Telegram. Built using the aiogram library, this bot provides a structured and interactive ordering experience.
- User registration and information collection
- Menu navigation with categories and items
- Shopping cart management
- Order placement and payment handling
- Manager notification for new orders
- Python 3.10+
aiogramlibraryasynciofor asynchronous operations
-
Clone the repository:
git clone https://github.com/yourusername/telegramfastfoodbot.git cd telegramfastfoodbot -
Install the required Python packages:
pip install -r requirements.txt
-
Create a
.envfile in the root directory based on.env.example:TELEGRAM_TOKEN=your_telegram_token_here PAYMENT_TOKEN=your_payment_token_here MANAGER_ID=your_manager_id_here DB_USER=your_database_user DB_PASSWORD=your_database_password DB_ADDRESS=your_database_address DB_NAME=your_database_name
Replace the placeholders with your actual configuration values.
Configure your database settings in .env and ensure the database is initialized and ready for use.
-
Start the bot:
python main.py
-
The bot will begin polling Telegram for updates. Users can interact with it by sending commands or selecting options from menus.
/start- Register a new user and begin interaction.- Main Menu - View main options (e.g., place an order, view cart).
- Categories - Navigate through product categories to view items.
- Cart - Add, remove, and modify items in your cart.
- Order - Complete the order and pay directly through Telegram.
main.py- Entry point of the bot.infrastructure/database/- Database utility functions for managing user data, orders, and cart items.presenter/bot/- Contains bot UI elements (keyboards, menus) and helper functions.settings/config.py- Bot configuration file, including API tokens and database credentials.
Feel free to fork the repository and submit pull requests if you'd like to contribute!
This project is licensed under the MIT License.