Fixed issue where emotes didn't render properly

This commit is contained in:
nuttylmao
2025-06-12 03:33:36 +10:00
parent 48b033fd87
commit 2c780d52e3
2 changed files with 188 additions and 5 deletions
+2 -2
View File
@@ -368,7 +368,7 @@ async function TwitchChatMessage(data) {
}
else {
// For non-word emotes, ensure they are surrounded by non-word characters or boundaries
regexPattern = `(?:^|[^\\w])${emoteName}(?:$|[^\\w])`;
regexPattern = `(?<=^|[^\\w])${emoteName}(?=$|[^\\w])`;
}
const regex = new RegExp(regexPattern, 'g');
@@ -447,7 +447,7 @@ async function TwitchAnnouncement(data) {
}
else {
// For non-word emotes, ensure they are surrounded by non-word characters or boundaries
regexPattern = `(?:^|[^\\w])${emoteName}(?:$|[^\\w])`;
regexPattern = `(?<=^|[^\\w])${emoteName}(?=$|[^\\w])`;
}
const regex = new RegExp(regexPattern, 'g');