diff --git a/plugins/voice.py b/plugins/voice.py index 7cb9089..c7f29e5 100644 --- a/plugins/voice.py +++ b/plugins/voice.py @@ -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