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