fix: ::hilfe zeigt ::onboarding Subcommands einzeln mit Beschreibung

This commit is contained in:
Bernd (Hermes)
2026-07-19 20:28:38 +02:00
parent 7298459fc8
commit 4604f2e123
3 changed files with 72 additions and 0 deletions
+10
View File
@@ -93,6 +93,7 @@ class InlineCommandRegistry:
help_text: str,
description: str = "",
category: str = "Plugin",
subcommands: Optional[Dict[str, str]] = None,
) -> None:
"""Registriert einen ::-Befehl.
@@ -102,12 +103,15 @@ class InlineCommandRegistry:
help_text: Kurzer Hilfetext (eine Zeile).
description: Ausführliche Beschreibung.
category: Kategorie für die Hilfeseite.
subcommands: Optionales Dict {subcmd: beschreibung} für Befehle
mit Subcommands (z.B. {'start': 'Startet...', ...}).
"""
self._commands[name] = {
"handler": handler,
"help_text": help_text,
"description": description,
"category": category,
"subcommands": subcommands or {},
}
def get_handler(self, name: str) -> Optional[CommandHandler]:
@@ -166,6 +170,9 @@ def build_help_text(registry: InlineCommandRegistry, room_map_summary: str = "")
lines.append("")
for cmd in standard_cmds:
lines.append(f"- `::{cmd['name']}` — {cmd['help_text']}")
subcmds = cmd.get('subcommands', {})
for sub_name, sub_desc in subcmds.items():
lines.append(f" - `::{cmd['name']} {sub_name}` — {sub_desc}")
lines.append("")
# ── Sektion 2: RC-Plugin-spezifische Befehle ──────────────────────
@@ -182,6 +189,9 @@ def build_help_text(registry: InlineCommandRegistry, room_map_summary: str = "")
lines.append("")
for cmd in rc_cmds:
lines.append(f"- `::{cmd['name']}` — {cmd['help_text']}")
subcmds = cmd.get('subcommands', {})
for sub_name, sub_desc in subcmds.items():
lines.append(f" - `::{cmd['name']} {sub_name}` — {sub_desc}")
lines.append("")
# ── Sektion 3: Natürliche Sprach-Befehle ──────────────────────────