From efab8928f5b2d406bc8f413947c4e16d93908a1c Mon Sep 17 00:00:00 2001 From: Terry Geng Date: Wed, 26 May 2021 09:24:43 +0800 Subject: [PATCH] fix: Failure caused by welcome message sent by the server. Fixes #281. --- mumbleBot.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mumbleBot.py b/mumbleBot.py index cae943b..58d997e 100644 --- a/mumbleBot.py +++ b/mumbleBot.py @@ -246,6 +246,11 @@ class MumbleBot: def message_received(self, text): raw_message = text.message.strip() message = re.sub(r'<.*?>', '', raw_message) + if text.actor == 0: + # Some server will send a welcome message to the bot once connected. + # It doesn't have a valid "actor". Simply ignore it here. + return + user = self.mumble.users[text.actor]['name'] if var.config.getboolean('commands', 'split_username_at_space'):