ircanywhere/irc-factory — pull request #9 by Jazcash (2014-03-25 13:37:27+00:00)
Title: Added Quake-style colouring and message splitting

So I'm still just a JS newbie, but I added this to my own project and figured it'd be worth offering it to you just in case you wanted it. Again, I'm a newbie so if you _do_ like it, feel free to refactor the code or change whatever you like.

The colour support is essentially just an easier way for irc-factory users to print coloured IRC messages like so:

`^1Hello ^16World` would write `Hello` in red with an empty space and then `World` in red and bold following it. The colour codes are a caret symbol (^) followed by a number using these conventions: http://wiki.swiftirc.net/index.php?title=Colours#List_of_colours_available

16 is bold, 17 is italic, 18 is strike-through, 19 is underlined and 20 is reset. Text with background is defined by separating two colour numbers with a comma like so: `^0,1Hello` - prints `Hello` in white with a black background (^foreground,background).

---------------------------

The message splitting just splits messages that are too long (457+ characters in the Webirc client I was testing with) into multiple lines or trims them with `...` depending on which flag is passed to `irc.privmsg`. If no flag is passed at all, it just attempts to print it but may cause a `request too long` error from the server and disconnect the bot if the message is too long. Maybe you'd want to make one of the aforementioned options default instead of allowing messages that are too long?

---------------------------

Anyway, like I said, I just wanted to give you the option of using these if you wanted to, don't feel you have to!