fix: Failure caused by welcome message sent by the server.

Fixes #281.
This commit is contained in:
Terry Geng 2021-05-26 09:24:43 +08:00
parent 3200c83fd0
commit efab8928f5
No known key found for this signature in database
GPG Key ID: F982F8EA1DF720E7

View File

@ -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'):