An open API service indexing awesome lists of open source software.

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.

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:

Bot Screenshot