remove html from incoming messages

#246
This commit is contained in:
Azlux 2021-04-03 14:17:41 +02:00
parent ee5a54b33b
commit e5f623f6c3

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import re
import threading import threading
import time import time
import sys import sys
@ -238,7 +238,8 @@ class MumbleBot:
# All text send to the chat is analysed by this function # All text send to the chat is analysed by this function
def message_received(self, text): def message_received(self, text):
message = text.message.strip() raw_message = text.message.strip()
message = re.sub(r'<.*?>', '', raw_message)
user = self.mumble.users[text.actor]['name'] user = self.mumble.users[text.actor]['name']
if var.config.getboolean('commands', 'split_username_at_space'): if var.config.getboolean('commands', 'split_username_at_space'):