A lightweight personal Telegram bot that replies with an hourly weather report for a default city or a user-provided city.
The command keyword is cuaca (Indonesian for “weather”).
- Hourly forecast: temperature, “feels like”, humidity, wind speed + gusts, precipitation probability + amount
- Human-friendly summary: simple warnings and clothing tips based on conditions
- Default city configuration via environment variables
- Optional city override and optional horizon (e.g.,
12h,24h, up to a safe max) - Geocoding cache (SQLite) to reduce repeated geocoding requests
cuaca→ weather for the default city (default horizon)cuaca 24h→ weather for the default city for 24 hourscuaca Berlin→ weather for Berlincuaca Hamburg 12h→ weather for Hamburg for 12 hours
- Python
- Docker + Docker Compose
- Telegram Bot API (polling)
- Open-Meteo (forecast provider)
- Nominatim / OpenStreetMap (geocoding)
- SQLite (local cache)
- Command parsing: detect
cuaca, parse optional city and optional horizon (e.g.,24h) - Geocoding: convert city name to latitude/longitude (cached in SQLite)
- Forecast retrieval: fetch hourly forecast from Open-Meteo
- Formatting: generate a compact summary + hourly lines
- Delivery: send a reply message via Telegram
cuacameans “weather”.
- Docker Desktop (macOS/Windows) or Docker Engine (Linux)
- A Telegram bot token from @BotFather
- Create a
.envfile (do not commit it) based on.env.example:
TELEGRAM_BOT_TOKEN=...DEFAULT_CITY=BerlinTZ=Europe/Berlin
- Start the bot:
docker compose up -d
docker compose logs -f- Chat your bot on Telegram:
- cuaca
- cuaca Berlin 12h
- docker compose down
Environment variables (see .env.example):
TELEGRAM_BOT_TOKEN(required)DEFAULT_CITY(default: Berlin)TZ(default: Europe/Berlin)SQLITE_PATH(default: /data/personal_ops.sqlite)
- Never commit
.envor any tokens/keys. - Rotate the Telegram bot token immediately if it is exposed.
- Polling mode requires no inbound ports, which reduces attack surface.
- The SQLite database is used only for caching geocoding results and should not be committed.
- Architecture:
docs/architecture.md - Security & privacy:
docs/security.md
- If the bot does not reply, check logs:
docker compose logs -f
- If Docker cannot connect to the daemon on macOS, ensure Docker Desktop is running.
- If geocoding fails for a city name, try a more specific query (e.g.,
cuaca Munich, Germany).
- Export a “full report” as PDF/Markdown artifacts
- Optional Google Drive upload for daily artifacts
- Expenses module (chat → Google Sheets)
- Research Radar module (daily paper digest)
- Personal web dashboard integrating all modules
Choose a license that fits your needs (MIT is common for portfolio projects).