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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user