martynsmith / node-irc

NodeJS IRC client library
GNU General Public License v3.0
1.33k stars 424 forks source link

The length of the sent messages is limited and does not change in the settings! #575

Open Phazeus opened 1 year ago

Phazeus commented 1 year ago

When sending a message whose length exceeds about 250 characters (I didn't count exactly, but the messages are short), the message is cut off. The messageSplit:2048 parameter does not help, the behavior does not change. What can be done? (Server allow to send long messages)

madprops commented 1 year ago

I think it cuts off at around 440 chars. I had problems with this when there's emojis involved. I think emojis are not being counted correctly. And some parts get cut. So I'm splitting messages myself with:

      if (message.length > 400) {
        let lines = message.match(/.{1,250}/g)

        for (let line of lines) {
          App.irc_client.say(channel, line)
        }
      }

This splits the message into smaller 250 length chunks.

madprops commented 1 year ago

Also just discovered this: https://morioh.com/p/f65839a85d1d

madprops commented 1 year ago

https://github.com/matrix-org/node-irc