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

Re-implement the timezone command that was reverted.

- Add cmd_timezone function with get/set functionality
- Validate timezone using zoneinfo (IANA format)
- Admin-only permission via service layer
- Update help text and bot command list
- Fix indentation bug in cmd_add (duplicate lines)

Fixes #53
This commit is contained in:
shokollm
2026-04-04 08:14:58 +00:00
parent e3b813661d
commit 6da16e752b
2 changed files with 36 additions and 6 deletions

View File

@@ -15,6 +15,7 @@ from commands import (
cmd_my,
cmd_show,
cmd_start,
cmd_timezone,
cmd_track,
cmd_untrack,
cmd_update,
@@ -43,6 +44,7 @@ def build_app() -> Application:
app.add_handler(CommandHandler("track", cmd_track))
app.add_handler(CommandHandler("untrack", cmd_untrack))
app.add_handler(CommandHandler("show", cmd_show))
app.add_handler(CommandHandler("timezone", cmd_timezone))
app.add_handler(MessageHandler(filters.COMMAND, cmd_help))
@@ -59,6 +61,7 @@ async def post_init(app: Application) -> None:
("track", "Track a bounty"),
("untrack", "Stop tracking"),
("show", "Show bounty details"),
("timezone", "Get/set room timezone"),
("help", "Show help"),
]
)