https://github.com/abbosaliboev/tilla-tandir-bot
Automated telegram bot for kitchen reports.
https://github.com/abbosaliboev/tilla-tandir-bot
bot-template python telegram telegram-bot
Last synced: 5 days ago
JSON representation
Automated telegram bot for kitchen reports.
- Host: GitHub
- URL: https://github.com/abbosaliboev/tilla-tandir-bot
- Owner: abbosaliboev
- Created: 2024-12-12T01:29:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-04T08:18:10.000Z (12 months ago)
- Last Synced: 2025-07-04T09:25:37.200Z (12 months ago)
- Topics: bot-template, python, telegram, telegram-bot
- Language: Procfile
- Homepage:
- Size: 347 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Telegram Inventory Management Bot π€
**This bot simplifies inventory, sales, and expense management by integrating features like user authentication, PDF reporting, and real-time tracking.**
---
## β¨ Features
- π **Inventory Management**:
- π₯ Add items to inventory.
- π€ Remove items from inventory.
- π View inventory status.
- πΈ **Sales Management**:
- Record and track sales.
- Generate daily and monthly reports.
- π οΈ **Expense Tracking**:
- Add expenses with user details.
- Monitor daily and monthly expenses.
- ποΈ **PDF Report Generation**:
- Automatically generate and share **monthly reports** in PDF format. π
- π **Secure Access**:
- Only authorized users can access bot features through an **admin password**.
- π€ **User Management**:
- View, add, or remove authorized users.
- Clear the entire user list in one command.
---
## π Bot Commands
### π€ General Commands
| Command | Description |
|----------------------------------|--------------------------------------|
| `/start` | Start the bot and view commands. |
| `/yakuniy_savdo [product] [quantity] [price]` | Record a sale. |
| `/ombor` | View all items in the inventory. |
| `/qabul [product] [quantity]` | Add products to the inventory. |
| `/chiqarish [product] [quantity]`| Remove products from the inventory. |
| `/kunlik_hisobot` | View daily sales and expense report. |
| `/oylik_hisobot` | Generate and share monthly PDF report. |
| `/xarajat [product] [price]` | Record an expense. |
### π§ Admin Commands
| Command | Description |
|----------------------------------|--------------------------------------|
| `/foydalanuvchilar` | View the list of authorized users. |
| `/foydalanuvchilarni_tozalash` | Remove all authorized users. |
| `/foydalanuvchini_ochirish [user_id]` | Remove a user by ID. |
---
## π Hosting Platform: Railway
This bot is hosted on **Railway**, a user-friendly platform offering free and flexible hosting for lightweight applications.
### Why Railway?
- **Free Plan**: Perfect for small projects and bots.
- **GitHub Integration**: Automatically deploys from your repository.
- **Simple Management**: Easy-to-use dashboard for logs and settings.
### Deployment Steps
1. Sign up on [Railway](https://railway.app/).
2. Create a new project and connect your GitHub repository.
3. Add environment variables (e.g., `YOUR_BOT_TOKEN`).
4. Deploy your bot and monitor it via the Railway dashboard.
For more details, visit the [Railway Documentation](https://railway.app/docs).
---
## π Setup and Installation
### 1οΈβ£ Prerequisites
- **Python 3.x** installed.
- Required libraries installed:
```bash
pip install fpdf python-telegram-bot
```
### 2οΈβ£ Steps to Run the Bot
1. Clone this repository:
```bash
git clone
cd
```
2. Create a `database.json` file to store sales, inventory, and expenses:
```json
{
"savdolar": [],
"ombor": {},
"xarajatlar": []
}
```
3. Update the **bot token** in the code:
```python
app = ApplicationBuilder().token("YOUR_BOT_TOKEN").build()
```
4. Run the bot locally:
```bash
python bot.py
```
5. Access the bot via Telegram and start using commands.
---
## πΌ Visual Styling and Stickers
To make the bot interactive and fun:
- **Emoji Integration**: Commands and responses include emojis to improve readability.
- **Stickers**: Use Telegram stickers to acknowledge user actions or errors (e.g., π, β, π). You can include stickers using Telegramβs `send_sticker` method in responses.
Example:
```python
await update.message.reply_sticker(sticker="CAACAgIAAxkBAAEB1Jlk9Xo7K0X5...")
```
---
## π Security
- Admin password is required for system access.
- Replace the default password (`ADMIN_PASSWORD`) in the code with a secure password:
```python
ADMIN_PASSWORD = "YourSecurePassword"
```
---
## π File Structure
| File/Directory | Description |
|-----------------------|--------------------------------------------------|
| `bot.py` | Main script containing the bot's logic. |
| `database.json` | Persistent storage for sales, inventory, expenses. |
| `oylik_hisobot.pdf` | Monthly sales and expense report in PDF format. |
---
## π Future Improvements
- Add **multi-language support** for commands and responses.
- Integrate **AI-powered analytics** for sales trends.
- Expand report generation with graphs and charts.
---
## π License
This project is open-source and available under the **MIT License**.
---
## πΈ Screenshot
Below is a screenshot of the bot in action:
