From 33918d1ec03febe0267be75e2ff28d1f2321bd03 Mon Sep 17 00:00:00 2001 From: John Cote Date: Wed, 30 Jun 2021 10:53:39 -0400 Subject: [PATCH] chat: Fix crash --- otp/chat/WhiteList.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/otp/chat/WhiteList.py b/otp/chat/WhiteList.py index af06589..8c17a7e 100644 --- a/otp/chat/WhiteList.py +++ b/otp/chat/WhiteList.py @@ -14,7 +14,10 @@ class WhiteList: self.numWords = len(self.words) def cleanText(self, text): - text = text.decode('utf-8').strip('.,?!') + if type(text) == bytes: + text = text.decode('utf-8').strip('.,?!') + else: + text = text.strip('.,?!') text = text.lower().encode('utf-8') return text