No description
- Rust 95.7%
- Dockerfile 4.3%
ALLOWED_CHAT_IDS being unset meant no chats to notify. NOTIFY_CHAT_IDS now controls notification targets independently, falling back to ALLOWED_CHAT_IDS if not set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| docs/plans | ||
| src | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| README.md | ||
Shopping Bot
A Telegram bot for managing shopping lists with SQLite persistence.
Features
- Add items to shopping list
- Remove items by ID
- View current list
- Clear entire list
- Persistent storage using SQLite
- Multi-chat support with optional access control
Commands
/help- Display available commands/add <item>- Add an item to the shopping list/remove <id>- Remove an item by its ID/show- Display the current shopping list/clear- Clear the entire shopping list
Deployment
Using Docker Compose (Recommended)
- Clone the repository
- Copy
.env.exampleto.envand configure:cp .env.example .env - Edit
.envand set your bot token:BOT_TOKEN=your_bot_token_from_botfather - (Optional) Set allowed chat IDs for access control:
ALLOWED_CHAT_IDS=123456789,-987654321 - Build and run:
docker-compose up -d
Using Docker
Build the image:
docker build -t shopping-bot .
Run the container:
docker run -d \
--name shopping-bot \
-e BOT_TOKEN=your_bot_token \
-e ALLOWED_CHAT_IDS=123456789,-987654321 \
-v shopping-bot-data:/data \
shopping-bot
Local Development
- Install Rust
- Set environment variables:
export BOT_TOKEN=your_bot_token export ALLOWED_CHAT_IDS=123456789,-987654321 # Optional - Run the bot:
cargo run
Environment Variables
BOT_TOKEN(required): Your Telegram bot token from @BotFatherALLOWED_CHAT_IDS(optional): Comma-separated list of allowed chat IDs. Leave empty to allow all chats.RUST_LOG(optional): Log level (error, warn, info, debug, trace)
Data Storage
- In Docker: Data is stored in
/data/shopping_list.db(persisted via volume) - Local development: Data is stored in
/tmp/shopping_list.db