chat: Fix crash

This commit is contained in:
John Cote 2021-06-30 10:53:39 -04:00
parent f9c4a31271
commit 33918d1ec0

View file

@ -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