Tmi.js Library chat event not firing for long messages

I’m using the tmi.js library, and having a small issue. The following code functions correctly for all messages under a certain character limit (not sure what the limit is exactly, about a paragraph of text), but any larger messages I type into chat don’t seem to call the method at all!

client.on(“chat”, function (channel, userstate, message, self) {
if (self) return;
console.log(“message was received”)
}

If you’re sending the message as a test in a chat but the message is over 500 characters, you will see it on Twitch but no one else will receive it. This is part of the IRC standard. I don’t know why Twitch still shows the message and/or doesn’t tell you. (They should really limit the length of the input box) Here’s a sample message that’s 500 characters:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. In fringilla metus nec libero ultricies egestas. Integer tortor purus, efficitur ac ante in, rhoncus maximus est. Nam id justo erat. Suspendisse orci orci, tempor quis venenatis quis, gravida sed massa. Vestibulum blandit turpis nisl, sed tincidunt quam porttitor sed. Integer efficitur, est in vehicula placerat, massa ex rhoncus nibh, ut commodo libero tortor eu dolor. Phasellus id euismod ante. Fusce eget dignissim est. Nullam non nullam.

Try that and then try it again with a couple of extra letters.

1 Like

Got it, thank you =)

I thought tmi.js had patched for this. I don’t use it myself so I don’t have the character problem

You may want to raise a bug with the tmi.js developers on their GitHub

The question is not about sending messages, which tmi.js is capable of handling to some degree. It’s about receiving messages with the library. And I am a/the tmi.js developer(s). :wink:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.