Skip to content

Bot admin commands (broadcast, /pause, /health) #283

Description

@YaronZaki
  • Difficulty: intermediate · Effort: M · Priority: P3
  • Impact: operators and incident response
  • Problem Statement
    The bot currently exposes only /start. Operators have no way to
    broadcast a maintenance notice to every linked Telegram user, pause
    notifications during an incident, or query the bot's health from
    Telegram itself.
  • Why It Matters
    Incident response without Telegram-side commands forces operators to
    use the dashboard. During a liquidation event, every minute counts.
  • Expected Outcome
    Three admin commands:
    • /broadcast <message> — sends to all is_allowed_notification=True
      users with a confirmation prompt.
    • /pause <minutes> — suppresses alerts for N minutes.
    • /health — returns bot uptime + Redis ping latency.
  • Acceptance Criteria
    • Only TELEGRAM_ADMIN_USER_IDS env-var list can run these.
    • /broadcast rate-limited to 1/hr/caller.
    • /pause record persists in Redis with TTL.
    • /health returns within 2 seconds.
  • Implementation Notes
    ADMIN_IDS = set(int(x) for x in os.getenv("TELEGRAM_ADMIN_USER_IDS", "").split(","))
    @cmd_router.message(Command("broadcast"), F.from_user.func(lambda u: u.id in ADMIN_IDS))
    async def broadcast(message): ...
  • Files / Modules Affected
    • new: quantara/web_app/telegram/handlers/admin.py
    • quantara/web_app/telegram/__init__.py (register router)
  • Dependencies: standalone; pairs with #91 (deep-link replay).

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26featurepriority/P3Imported from PRODUCTION_ISSUES.mdtelegramImported from PRODUCTION_ISSUES.md

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions