fix: voice trigger not receiving audio from pymumble

pymumble passes a User object, not a dict. The isinstance(user, dict)
check returned False, setting name to None and silently discarding
every voice packet. Use try/except for dict-like access instead.
This commit is contained in:
user
2026-02-22 03:59:24 +01:00
parent c4908f2a63
commit 221cb1f06b

View File

@@ -86,7 +86,10 @@ def _on_voice(bot, user, sound_chunk):
ps = _ps(bot)
if not ps["listen"] and not ps["trigger"]:
return
name = user["name"] if isinstance(user, dict) else None
try:
name = user["name"]
except (KeyError, TypeError):
name = None
if not name or name == bot.nick:
return
pcm = sound_chunk.pcm