feat(discord-bridge): comanda /infra cu confirmare prin butoane

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KddsXCqEbKMhdFJDYbAsx8
This commit is contained in:
Claude Agent
2026-09-13 10:18:12 +00:00
parent 56027e2e6c
commit c87fa06b55
3 changed files with 398 additions and 1 deletions

View File

@@ -12,6 +12,8 @@ from __future__ import annotations
import logging
import infra_actions
log = logging.getLogger("discord-bridge.slash")
try: # pragma: no cover - depinde de mediu
@@ -82,6 +84,14 @@ def build_tree(client, bridge):
async def _help(interaction):
await bridge.handle_slash(interaction, "help")
@tree.command(name="infra", description="Infrastructura: stare, oprire/pornire cluster, UPS, DR")
@app_commands.describe(actiune="Ce faci", simulare="Doar simulare (implicit da unde exista)")
@app_commands.choices(actiune=[
app_commands.Choice(name=a["label"][:100], value=k) for k, a in infra_actions.ACTIONS.items()
])
async def _infra(interaction, actiune: app_commands.Choice[str], simulare: bool | None = None):
await bridge.handle_slash(interaction, "infra", actiune=actiune.value, simulare=simulare)
return tree