Move picker router/client additions off PR #218's lines (no merge conflict)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Logan Cusano
2026-10-04 20:05:56 -04:00
co-authored by Claude Opus 5.5
parent a2c840f186
commit 2457d2d734
2 changed files with 17 additions and 17 deletions
@@ -30,6 +30,19 @@ class C2Client:
return {"guild_id": str(guild_id), "org_id": None, "systems": [], "nodes": [],
"streams": [], "bots": [], "error": True}
async def put_guild_directory(self, guild_id: int | str, payload: dict) -> bool:
"""This server's name + voice channels, for the web node-page picker
(server-26#213). Names only — no members, no messages, no tokens."""
try:
async with httpx.AsyncClient(timeout=10) as client:
r = await client.put(f"{self.base}/discord/guilds/{guild_id}/directory",
json=payload, headers=self._headers())
r.raise_for_status()
return True
except Exception as e:
logger.error(f"C2 put_guild_directory({guild_id}) failed: {e}")
return False
async def start_stream(self, payload: dict) -> tuple[bool, dict]:
"""Returns (ok, body). On a refusal body carries detail/code/invite."""
try:
@@ -68,19 +81,6 @@ class C2Client:
logger.error(f"C2 stop_guild failed: {e}")
return None
async def put_guild_directory(self, guild_id: int | str, payload: dict) -> bool:
"""This server's name + voice channels, for the web node-page picker
(server-26#213). Names only — no members, no messages, no tokens."""
try:
async with httpx.AsyncClient(timeout=10) as client:
r = await client.put(f"{self.base}/discord/guilds/{guild_id}/directory",
json=payload, headers=self._headers())
r.raise_for_status()
return True
except Exception as e:
logger.error(f"C2 put_guild_directory({guild_id}) failed: {e}")
return False
# ------------------------------------------------------------------
# Trips
# ------------------------------------------------------------------