reactiflux / discord-irc

Connects Discord and IRC channels by sending messages back and forth.
MIT License
1.2k stars 293 forks source link

Message Splitting #129

Closed dwhagar closed 7 years ago

dwhagar commented 7 years ago

Messages aren't split correctly, even when the irc options are set with a lower split value, they are still default split at 512 characters.

dwhagar commented 7 years ago

The system is not listening to the "messageSplit" from the node-irc API, or if it is, it is setting a different one

dwhagar commented 7 years ago

After some investigation on my own. The ircClient object is not splitting the message by the messageSplit IRC option. Not only that, but, it appears to be counting the characters in the message without including the message prefix with the Discord username, including colors, so that it cuts off the last several characters of the message being split, before it splits it.

I know it is passing the options on because the real name and username are used as configured.

Here is a copy of my config:

[{
        "nickname": "Dicord-Bridge",
        "server": "irc.darkmyst.org",
        "discordToken": "omitted"
        "autoSendCommands": [
                ["PRIVMSG", "NickServ", "IDENTIFY omitted"]
        ],
        "channelMapping": {
                "#burning-sweetly": "#BlazingUmbra-OOC",
                "#blazingumbra": "#BlazingUmbra"
        },
        "ircOptions": {
                "userName": "bridge",
                "realName": "IRC to Discord Bridge",
                "messageSplit": 350,
                "encoding": "UTF-8"
        },
        "commandCharacters": ["!", "^"]
}]
ekmartin commented 7 years ago

messageSplit isn't actually used by node-irc, see https://github.com/martynsmith/node-irc/pull/385. I left a comment on the PR, but it doesn't seem like node-irc has been committed to for a while.

ekmartin commented 7 years ago

This should be fixed in version 2.1.5, as the node-irc pull request was merged and released.