From 847657cad1d613694732ef10b5adca80759cca96 Mon Sep 17 00:00:00 2001 From: Paillat Date: Thu, 2 Nov 2023 17:04:49 +0100 Subject: [PATCH] Update ChatProcess.py --- src/ChatProcess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ChatProcess.py b/src/ChatProcess.py index e7f63ca..3d6eab8 100644 --- a/src/ChatProcess.py +++ b/src/ChatProcess.py @@ -118,7 +118,7 @@ class Chat: name = "assistant" else: role = "user" - name = msg.author.global_name + name = msg.author.display_name or msg.author.global_name or msg.author.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, flags=re.UNICODE) if name == "":