Skip to content

Split admin and eval commands into dedicated plugins - #13

Merged
nanonyme merged 2 commits into
mainfrom
copilot/split-commands-to-plugins
Feb 19, 2026
Merged

nanonyme merged 2 commits into
mainfrom
copilot/split-commands-to-plugins

Conversation

Copilot AI commented Feb 19, 2026 •

Copy link
Copy Markdown
Contributor

app.py was monolithically handling all bot commands (!reincarnate, !join, !leave, !eval) alongside the PB connection logic. These are now split into two proper plugins in the plugin registry.

New plugins

  • plugins/eval_plugin.py — handles !eval truth:expr boolean evaluation via simple_eval; replies to sender in PM, channel in public
  • plugins/admin_plugin.py — handles !reincarnate, !join, !leave with SQLite role-based access control (superadmin-gated); !reincarnate sends KILL to the app subprocess, letting processExited trigger the existing reconnect flow

app.py simplification

Removed handleCommand, resolveRoles, and the now-unused imports (sqlite3, simple_eval, functools). Message handler methods are reduced to staleness checks only.

Bug fix

The original resolveRoles used fetchmany() (returns only 1 row by default), silently truncating multi-role users. Fixed to fetchall() in AdminPlugin._resolve_roles.

Config

config.json.example updated to document both new plugins. Enable them by adding to the plugins array:

{ "name": "eval",  "module": "plugins.eval_plugin",  "enabled": true },
{ "name": "admin", "module": "plugins.admin_plugin", "enabled": true }
Original prompt

This section details on the original issue you should resolve

<issue_title>Split commands to plugins</issue_title>
<issue_description>We should have adminplugin handling and simple eval to another plugin. </issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: nanonyme <348449+nanonyme@users.noreply.github.com>
Copilot AI changed the title [WIP] Split commands to admin and evaluation plugins Split admin and eval commands into dedicated plugins Feb 19, 2026
Copilot AI requested a review from nanonyme February 19, 2026 13:00
@nanonyme
nanonyme marked this pull request as ready for review February 19, 2026 13:05
@nanonyme
nanonyme merged commit ea7ebb8 into main Feb 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Split commands to plugins

2 participants