Commit Graph

11 Commits

Author SHA1 Message Date
49c0e82bac refactor: migrate from go-telegram-bot-api/v5 to go-telegram/bot
- Replaced tgbotapi with go-telegram/bot (zero-dependency, context-aware, Bot API 10.0)
- All handler methods now accept context.Context; threading ctx through all sends/edits
- Changed from function-based (NewMessage/NewEditMessageText/NewInlineKeyboardMarkup) to struct-param API (SendMessageParams/EditMessageTextParams/InlineKeyboardMarkup)
- Added colored buttons: DEL buttons in calendar use Style: 'danger' (red)
- Both polling and webhook modes preserved with new library patterns
- Context-based shutdown (signal.NotifyContext) replaces stop channel
2026-06-24 14:56:50 +03:30
a8b849f8fd refactor: split handlers.go into 5 files, redesign export month picker, pad calendar rows, improve comments
- Split 1571-line handlers.go into: handlers.go (core), clock.go, settings.go, calendar.go, report.go
- Redesigned export month picker: year navigation + 12-month grid instead of prev/next month
- Fixed calendar last row: pad remaining cells with empty buttons to ensure 7 columns
- Added Go doc comments across all files (dateutil.go, totals.go, store.go, main.go, webhook.go)
2026-06-24 11:33:17 +03:30
2970b7d3fc feat: redesigned DB schema with users, work_types, days, events 2026-06-24 00:36:16 +03:30
8616ed0867 feat: multi-user isolation and graceful shutdown
- Add chat_id to events, settings, and days_off for per-user data
- Add proper graceful shutdown (signal handling, WaitGroup)
- Separate polling and webhook modes with goroutine management
- Add schema migration from single-user to multi-user schema
- Refactor handlers with shared actionFunc pattern (msg + callback)
- Fix schema path for Docker deployment (/app/db/schema.sql)
- Remove emoji from output text for cleaner formatting
2026-06-24 00:14:41 +03:30
b4fab29d45 Clean up: remove unused packages, switch to slog, tidy Makefile 2026-06-23 22:34:01 +03:30
32446a99d1 Fix break tracking (out→in gap), add startup log, clean up /start message 2026-06-23 22:00:25 +03:30
7da6f4cb49 Add BOT_ALLOWED_USERS, fix SetColWidth params, drop fmt import, save chat_id on start 2026-06-23 21:56:18 +03:30
4a5778afe5 feat: add inline keyboard, /start command, and callback handlers
- Show main menu with Clock In/Out, Report, Export, Remote, Day Off buttons
- Each action result includes a 'Back to Menu' button
- Handle callback queries alongside text commands
- Delete stale webhook before switching to polling
- Log i18n initialization error instead of silently ignoring it
2026-06-23 21:42:52 +03:30
b0fcb7a6c3 main: pass correct APIEndpoint to NewBotAPIWithClient 2026-06-23 21:00:27 +03:30
3aaf5b326d main: use default HTTP client (proxy via env) 2026-06-23 20:58:52 +03:30
4146e35f35 Initial scaffold: Go module, SQLite schema, config loader, Telegram bot with webhook/polling modes 2026-06-23 20:22:46 +03:30