Telegram bot for managing cleaning schedule in the local.
Go to file
Kamil 'Kamaś' Bruchal 881bd5be03 feat: add weekly duty reminder scheduler
Add Reminder that posts a weekly cleaning-duty reminder to a Telegram
group on a configurable schedule (REMINDER_WEEKDAY/REMINDER_HOUR), in
Europe/Warsaw time, announcing the duty DUTY_AHEAD_DAYS out. Reminders
are disabled unless GROUP_CHAT_ID is set. Wire ReminderConfig parsing
into LoadConfig with validation, document the commands and reminder
config in README, and cover config loading with tests.
2026-06-18 02:36:06 +02:00
.gitignore fix: read GOOGLE_SHEETS_ID and default range to current-year tab 2026-06-17 21:16:25 +02:00
.golangci.yml Initial commit 2026-06-17 18:53:54 +02:00
.markdownlint-cli2.yaml Initial commit 2026-06-17 18:53:54 +02:00
.pre-commit-config.yaml Initial commit 2026-06-17 18:53:54 +02:00
Dockerfile Initial commit 2026-06-17 18:53:54 +02:00
README.md feat: add weekly duty reminder scheduler 2026-06-18 02:36:06 +02:00
live_test.go fix: read GOOGLE_SHEETS_ID and default range to current-year tab 2026-06-17 21:16:25 +02:00
main.go feat: add Config + Service wiring for cache and background sync 2026-06-17 20:35:05 +02:00
scheduler.go feat: add weekly duty reminder scheduler 2026-06-18 02:36:06 +02:00
service.go feat: add weekly duty reminder scheduler 2026-06-18 02:36:06 +02:00
service_test.go feat: add weekly duty reminder scheduler 2026-06-18 02:36:06 +02:00
store.go fix: lint, interval validation, corrupt-cache tolerance, background init sync, concurrent test 2026-06-17 20:45:29 +02:00
store_test.go fix: lint, interval validation, corrupt-cache tolerance, background init sync, concurrent test 2026-06-17 20:45:29 +02:00

README.md

Dyżur-bot

A telegram bot for managing the cleaning rota in hackerspace. Bot offers weekly reminders about cleaning duties as well as on demand informations. Backend read the schedule from a Google sheet, store it in local JSON file.

Running

Requires GOOGLE_API_KEY, GOOGLE_SHEETS_ID, and BOT_TOKEN in the environment or a .env file (see service.go/sheet.go for optional SHEET_RANGE, ROTA_CACHE_PATH, SYNC_INTERVAL). Then:

go run ./cmd/dyzur-bot

The service loads the cached rota, syncs from Google Sheets in the background on SYNC_INTERVAL (default 30m), and runs the Telegram bot via long polling until interrupted (Ctrl-C / SIGTERM).

Commands

  • /kto_sprzata — who is on cleaning duty this week.
  • /sync — refresh the rota from Google Sheets now.

Reminders

If GROUP_CHAT_ID is set, the bot posts a weekly duty reminder to that chat. Schedule (all optional, with defaults): REMINDER_WEEKDAY (default Monday), REMINDER_HOUR (default 9, 023), DUTY_AHEAD_DAYS (default 14). The hour is interpreted in Europe/Warsaw time. The reminder announces who is on duty DUTY_AHEAD_DAYS from the fire time — e.g. every Monday 09:00, who cleans two weeks out. Leave GROUP_CHAT_ID unset to disable reminders.