Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with invisible characters from Chatterino/7TV #54

Open
declider opened this issue Sep 24, 2023 · 0 comments
Open

Problem with invisible characters from Chatterino/7TV #54

declider opened this issue Sep 24, 2023 · 0 comments

Comments

@declider
Copy link

declider commented Sep 24, 2023

Some third-party tools may insert "invisible" characters into the message you send, and this can sometimes make the message difficult to parse.

For example this:

ComfyJS.onChat = ( user, message, flags, self, extra ) => {
    console.log(message.split(" "))
}

can output this:
example1
or this:
example2

So far I have found this working fix:

message = message.replace("  "," ").replace(/[\uD800-\uDFFF]/gi, []).trim()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant