feat: implement /timezone command to get/set room timezone #67

Merged
shoko merged 1 commits from feat/issue-53-timezone into main 2026-04-04 09:13:41 +02:00
Owner

Summary

Implement /timezone command as specified in #53:

  • /timezone - Get current room timezone (default UTC+0)
  • /timezone <tz> - Set room timezone (admin-only)
  • Validates IANA timezone format (e.g., Asia/Jakarta, Europe/London)
  • Returns error for invalid timezone format

Changes

  • apps/telegram-bot/commands.py:
    • Add zoneinfo import for timezone validation
    • Add cmd_timezone handler function
    • Update help text to include timezone command
  • apps/telegram-bot/bot.py:
    • Import cmd_timezone
    • Register timezone command handler
    • Add timezone to bot command list

Testing

/timezone
Current timezone: Asia/Jakarta

/timezone Asia/Jakarta
✅ Timezone set to Asia/Jakarta.

/timezone InvalidTZ
⛔ Invalid timezone. Use IANA format (e.g., Asia/Jakarta)

Fixes #53

## Summary Implement /timezone command as specified in #53: - `/timezone` - Get current room timezone (default UTC+0) - `/timezone <tz>` - Set room timezone (admin-only) - Validates IANA timezone format (e.g., Asia/Jakarta, Europe/London) - Returns error for invalid timezone format ## Changes - `apps/telegram-bot/commands.py`: - Add `zoneinfo` import for timezone validation - Add `cmd_timezone` handler function - Update help text to include timezone command - `apps/telegram-bot/bot.py`: - Import `cmd_timezone` - Register timezone command handler - Add timezone to bot command list ## Testing ``` /timezone Current timezone: Asia/Jakarta /timezone Asia/Jakarta ✅ Timezone set to Asia/Jakarta. /timezone InvalidTZ ⛔ Invalid timezone. Use IANA format (e.g., Asia/Jakarta) ``` Fixes #53
shoko added 1 commit 2026-04-04 09:12:55 +02:00
- Add cmd_timezone handler for /timezone command
- Validate timezone using IANA format (zoneinfo.ZoneInfo)
- Use existing BountyService.get_timezone and set_timezone methods
- Admin-only permission via service layer
- Update help text and bot command list
- Fixes #53
shoko merged commit 015df15bd5 into main 2026-04-04 09:13:41 +02:00
Sign in to join this conversation.