diff --git a/src/ChatProcess.py b/src/ChatProcess.py index e3ac3d8..65e4736 100644 --- a/src/ChatProcess.py +++ b/src/ChatProcess.py @@ -118,7 +118,7 @@ class Chat: role = "user" name = msg.author.global_name # use re not make name match ^[a-zA-Z0-9_-]{1,64}$ by removing all non-alphanumeric characters - name = re.sub(r"[^a-zA-Z0-9_-]", "", name) + name = re.sub(r"[^a-zA-Z0-9_-]", "", name, flags=re.UNICODE) if not await moderate(self.openai_api_key, msg.content): self.context.append( {