mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 01:06:19 +00:00
fixed bug with special characters
This commit is contained in:
@@ -92,6 +92,9 @@ async def chat_process(self, message):
|
|||||||
else:
|
else:
|
||||||
role = "user"
|
role = "user"
|
||||||
name = msg.author.name
|
name = msg.author.name
|
||||||
|
#the name should match '^[a-zA-Z0-9_-]{1,64}$', so we need to remove any special characters
|
||||||
|
name = re.sub(r"[^a-zA-Z0-9_-]", "", name)
|
||||||
|
|
||||||
msgs.append({"role": role, "content": f"{content}", "name": name})
|
msgs.append({"role": role, "content": f"{content}", "name": name})
|
||||||
if message.content.lower().find("undude") != -1:
|
if message.content.lower().find("undude") != -1:
|
||||||
# prompt += "System: Undude detected. Botator is now mad. He will start talking in capital letters.\n"
|
# prompt += "System: Undude detected. Botator is now mad. He will start talking in capital letters.\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user