Administration Commands #32

Closed
opened 2026-02-13 18:36:07 +03:00 by NiXTheDev · 1 comment
NiXTheDev commented 2026-02-13 18:36:07 +03:00 (Migrated from github.com)

Add administration commands for bot operators to monitor and manage the bot.

Scope

Create admin-only commands for bot management. Must work without external infrastructure.

Commands

  • /admin stats - Show bot statistics (uptime, commands processed, active users)
  • /admin health - Check bot health status
  • /admin rate_limits - View rate limit status for users
  • /admin reload - Reload configuration (if safe to do so)
  • /admin maintenance - Enable maintenance mode
  • /admin broadcast - Send message to all chats (with rate limiting)

Implementation

  1. Add admin authorization (check user ID against ADMIN_IDS env var)
  2. Create AdminCommands module
  3. Store admin actions in database for audit
  4. All data from SQLite, no external services

Security

  • Only whitelisted user IDs can use admin commands
  • Log all admin actions
  • Rate limit admin commands to prevent abuse

Configuration

  • ADMIN_IDS - Comma-separated list of admin Telegram user IDs

Testing

  • Test all admin commands with authorized/unauthorized users
  • Verify audit logging works
Add administration commands for bot operators to monitor and manage the bot. ## Scope Create admin-only commands for bot management. Must work without external infrastructure. ## Commands - /admin stats - Show bot statistics (uptime, commands processed, active users) - /admin health - Check bot health status - /admin rate_limits - View rate limit status for users - /admin reload - Reload configuration (if safe to do so) - /admin maintenance - Enable maintenance mode - /admin broadcast - Send message to all chats (with rate limiting) ## Implementation 1. Add admin authorization (check user ID against ADMIN_IDS env var) 2. Create AdminCommands module 3. Store admin actions in database for audit 4. All data from SQLite, no external services ## Security - Only whitelisted user IDs can use admin commands - Log all admin actions - Rate limit admin commands to prevent abuse ## Configuration - ADMIN_IDS - Comma-separated list of admin Telegram user IDs ## Testing - Test all admin commands with authorized/unauthorized users - Verify audit logging works
NiXTheDev commented 2026-02-13 18:51:23 +03:00 (Migrated from github.com)

Why would we ever need this?

Why would we ever need this?
Sign in to join this conversation.
No description provided.