Devr.AI icon indicating copy to clipboard operation
Devr.AI copied to clipboard

FEATURE REQUEST:Add Admin Commands for Bot Management and Monitoring

Open SiddhantGahankari opened this issue 11 months ago • 6 comments

Is your feature request related to a problem?

  • [x] Yes, it is related to a problem

Describe the feature you'd like

🌟 Feature Description

Add administrative Discord slash commands for bot management and monitoring. Commands would let maintainers check bot health, manage queues, and handle user issues without database access.

🔍 Problem Statement

The bot has no admin commands. All commands are available to everyone. Maintainers cannot monitor bot status, clear stuck messages, or debug user issues in real-time. Any maintenance requires manual database edits or bot restarts.

🎯 Expected Outcome

Add permission-restricted admin commands:

  • /admin stats - View message counts, queue sizes, response times
  • /admin queue status - Check pending tasks
  • /admin queue clear - Remove stuck messages
  • /admin user info - Inspect user state
  • /admin user reset - Fix broken user state
  • /admin cache clear - Clear cached data
  • /admin health - Check database and API connections

Commands restricted to server administrators and bot owner. All actions logged to database.

I want to work on implementing this feature.

Record

  • [x] I agree to follow this project's Code of Conduct
  • [x] I want to work on implementing this feature

SiddhantGahankari avatar Dec 28 '25 11:12 SiddhantGahankari

📝 CodeRabbit Plan Mode

Generate an implementation plan and prompts that you can use with your favorite coding agent.

  • [ ] Create Plan
Examples

🧪 Issue enrichment is currently in open beta.

You can configure auto-planning by selecting labels in the issue_enrichment configuration.

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

💬 Have feedback or questions? Drop into our discord!

coderabbitai[bot] avatar Dec 28 '25 11:12 coderabbitai[bot]

@smokeyScraper Can you please approve and assign this issue to me?

SiddhantGahankari avatar Dec 29 '25 07:12 SiddhantGahankari

I’ve gone through this feature request and I’d like to work on implementing it. The lack of admin-only commands makes real-time bot monitoring and maintenance difficult, especially when dealing with stuck queues, broken user states, or health checks. I believe adding a permission-restricted /admin command group would significantly improve maintainability and production readiness.

I can implement:

Secure admin-only slash commands for stats, queue management, user inspection/reset, cache clearing, and health checks Proper permission checks (server admin / bot owner)

Structured logging of all admin actions to the database

Safe handling for destructive actions (confirmations, validation)

If this aligns with the project direction, I’d be happy to take ownership of this feature and submit a well-documented PR. I agree to follow the project’s Code of Conduct.

vaishali824 avatar Dec 29 '25 10:12 vaishali824

Great @SiddhantGahankari, Admin commands would be an amazing management feature. We were planning to add it sooner or later. Thanks a lot for raising the issue. Assigned to you. I'm sorry @vaishali824, the issue was raised by Siddhant, so as of now, I'm assigning it to him. However, if you both like to collab over this then you can.

smokeyScraper avatar Dec 29 '25 10:12 smokeyScraper

Thanks for the clarification! I’d be happy to collaborate with @SiddhantGahankari on this feature. Please let me know how I can help or which part I can take ownership of (commands, permissions, logging, docs, etc.).

vaishali824 avatar Dec 29 '25 10:12 vaishali824

I would love to take this up. This is a crucial feature for maintaining the bot's health and usability effectively. I have a clear plan to implement these administrative commands ensuring security and comprehensive logging. My approach involves creating a modular admin command group protected by permission checks.

Permission Middleware: Implement a check to ensure only Users with ADMINISTRATOR permission or the Bot Owner can execute these commands. Command Group: Use discord.py or the relevant library's group functionality to namespace commands under /admin. Logging: All actions will be logged to the database with timestamp, executor_id, command_used, and target for accountability. Safety: "Destructive" commands like queue clear or user reset will require a confirmation interaction (Button/Modal) to prevent accidental execution.

I will follow this roadmap to deliver the feature: Setup & Permissions - Create /admin command group. - Implement permission decorators/checks (Admin/Owner only). - Set up the logging schema/function for admin actions. Monitoring Commands** -Implement stats (Message counts, response times). -Implement health (DB & API connection checks). -Implement user info (Inspect user state/profile). Management Commands -Implement queue status (View pending tasks). -Implement queue clear (With safety confirmation). -Implement user reset (Fix broken states). -Implement cache clear. Testing & Documentation -Test all commands with and without permissions. -Add documentation for maintainers on how to use these tools. I am ready to get started immediately! Please assign this to me.

FOX-KNIGHT avatar Dec 31 '25 07:12 FOX-KNIGHT