No description
  • Rust 95.7%
  • Dockerfile 4.3%
Find a file
Paweł J. Wal 3a80b4a389
Opus: add NOTIFY_CHAT_IDS config, fix empty notification targets
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>
2026-02-22 11:14:39 +01:00
docs/plans Opus: add HTTP API implementation plan 2026-02-22 10:07:21 +01:00
src Opus: add NOTIFY_CHAT_IDS config, fix empty notification targets 2026-02-22 11:14:39 +01:00
.dockerignore initial commit 2025-09-20 20:32:26 +02:00
.env.example initial commit 2025-09-20 20:32:26 +02:00
.gitignore fix packaging 2025-09-20 20:48:10 +02:00
Cargo.lock Opus: add foundation for HTTP API (deps, repo method, config) 2026-02-22 10:09:58 +01:00
Cargo.toml Opus: add foundation for HTTP API (deps, repo method, config) 2026-02-22 10:09:58 +01:00
docker-compose.yml Opus: fix review findings — error handling, empty token, stale comment 2026-02-22 10:16:03 +01:00
Dockerfile Opus: expose API port in Docker config 2026-02-22 10:14:03 +01:00
README.md initial commit 2025-09-20 20:32:26 +02:00

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

  1. Clone the repository
  2. Copy .env.example to .env and configure:
    cp .env.example .env
    
  3. Edit .env and set your bot token:
    BOT_TOKEN=your_bot_token_from_botfather
    
  4. (Optional) Set allowed chat IDs for access control:
    ALLOWED_CHAT_IDS=123456789,-987654321
    
  5. 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

  1. Install Rust
  2. Set environment variables:
    export BOT_TOKEN=your_bot_token
    export ALLOWED_CHAT_IDS=123456789,-987654321  # Optional
    
  3. Run the bot:
    cargo run
    

Environment Variables

  • BOT_TOKEN (required): Your Telegram bot token from @BotFather
  • ALLOWED_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