Skip to content

Commit 6b66808

Browse files
authored
Revert "fix: update regex to allow Unicode characters in message processing"
1 parent fd83719 commit 6b66808

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/client-discord/src/messages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@ export class MessageManager {
972972
);
973973

974974
// strip all special characters
975-
messageContent = messageContent.replace(/[^\p{L}\p{N}\s\-_./:?=&]/gu, "");
975+
messageContent = messageContent.replace(/[^a-zA-Z0-9\s]/g, "");
976976

977977
// short responses where eliza should stop talking and disengage unless mentioned again
978978
if (

packages/core/src/knowledge.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export function preprocess(content: string): string {
141141
// Remove multiple newlines
142142
.replace(/\n{3,}/g, "\n\n")
143143
// Remove special characters except those common in URLs
144-
.replace(/[^\p{L}\p{N}\s\-_./:?=&]/gu, "")
144+
.replace(/[^a-zA-Z0-9\s\-_./:?=&]/g, "")
145145
.trim()
146146
.toLowerCase()
147147
);

0 commit comments

Comments
 (0)