Skip to content

Problem with invisible characters from Chatterino/7TV #54

@declider

Description

@declider

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions