ComfyJS icon indicating copy to clipboard operation
ComfyJS copied to clipboard

Problem with invisible characters from Chatterino/7TV

Open declider opened this issue 1 year ago • 0 comments

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()

declider avatar Sep 24 '23 22:09 declider