fix(voice): show clear error when voice dependencies are missing

When PyNaCl or davey is not installed, joining a voice channel fails
with a raw exception. Now shows a human-readable message pointing
the user to reinstall with voice support.

Closes #1336
This commit is contained in:
0xbyt4
2026-03-15 11:58:48 +03:00
committed by teknium1
parent 773f3c1137
commit 1cacaccca6

View File

@@ -2435,6 +2435,9 @@ class GatewayRunner:
except Exception as e:
logger.warning("Failed to join voice channel: %s", e)
adapter._voice_input_callback = None
err_lower = str(e).lower()
if "pynacl" in err_lower or "nacl" in err_lower or "davey" in err_lower:
return "Voice dependencies are missing (PyNaCl / davey). Please reinstall Hermes with voice support enabled."
return f"Failed to join voice channel: {e}"
if success: