Skip to content

Commit

Permalink
Merge pull request elizaOS#2059 from elizaOS/revert-2048-fix/knowledg…
Browse files Browse the repository at this point in the history
…e-chinese

revert: elizaOS#2048
  • Loading branch information
shakkernerd authored Jan 9, 2025
2 parents 1d5d74a + 6b66808 commit b5e1c9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/client-discord/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ export class MessageManager {
);

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

// short responses where eliza should stop talking and disengage unless mentioned again
if (
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/knowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export function preprocess(content: string): string {
// Remove multiple newlines
.replace(/\n{3,}/g, "\n\n")
// Remove special characters except those common in URLs
.replace(/[^\p{L}\p{N}\s\-_./:?=&]/gu, "")
.replace(/[^a-zA-Z0-9\s\-_./:?=&]/g, "")
.trim()
.toLowerCase()
);
Expand Down

0 comments on commit b5e1c9d

Please sign in to comment.