From e72def0fdc2f69fe514dd659af53decfb00d8a70 Mon Sep 17 00:00:00 2001 From: William Brown Date: Sat, 21 Apr 2018 13:33:23 -0500 Subject: [PATCH] Fixing issue where message is unassigned --- magicked_admin/server/chat/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/magicked_admin/server/chat/chat.py b/magicked_admin/server/chat/chat.py index 32f8c012..f3666ccb 100644 --- a/magicked_admin/server/chat/chat.py +++ b/magicked_admin/server/chat/chat.py @@ -55,6 +55,7 @@ def run(self): message_tree = html.fromstring(message_html) # xpath returns a list but theres only ever one of each because i split earlier username_arr = message_tree.xpath('//span[starts-with(@class,\'username\')]/text()') + message = message_tree.xpath('//span[@class="message"]/text()')[0] if len(username_arr) < 1: logger.debug("Message without username '{}' ({})" .format(message, self.server.name)) @@ -68,7 +69,6 @@ def run(self): continue user_type = user_type_arr[0] - message = message_tree.xpath('//span[@class="message"]/text()')[0] admin = True if "admin" in user_type else False self.handle_message(username, message, admin)