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