MODE messages don't appear to work correctly with JustinTV/TwitchTV chat. #123

beaudesigns opened this Issue Dec 4, 2012 · 8 comments


None yet
3 participants

Hey there!

I came across an issue where I'm trying to capture the operators. The event gets fired correctly, but here is what I get:

RAW line:
:jtv MODE #crapbot +o beauwest

MESSAGE response:
{ prefix: 'jtv',
nick: 'jtv',
user: undefined,
host: undefined,
command: 'MODE',
rawCommand: 'MODE',
commandType: 'normal',
args: [ '#crapbot', '+o' ] }

The problem is that I have no way of telling which user is modded or unmodded. It may be that JTV IRC sends those messages differently than other IRC servers. One thought I had was passing, along with "message", the raw line so I could do my own parsing if it's different.

Anyway, if you need more info let me know!

I think I may have found a solution. In irc.js: line 161: var modeArg;

I changed it to: var modeArg = modeArgs[0]; to give it a default.

Adding o to the next line works as well. if ( mode.match(/^[bklo]$/) ) {


qsheets commented Dec 6, 2012

You may want to make sure you have the latest and greatest version of node-irc, as the issue may have already been resolved. The code you're referring to has changed, and that particular section is now near line 246.

I have the latest version available on NPM: 0.3.4.

Looks like that's from about 8 months ago though. I'll pull down a fresh copy from github and link it that way. Thanks!

FYI, this code issue is still occurring in the latest code. Adding o to the RegEx for matching the mode corrects it.


qsheets commented Dec 7, 2012

Ok, the problem is node-irc is looking for a message (005) from the IRC server that tells it exactly which modes are supported and the JTV server, being the custom server that it is, just doesn't send it. It does, however, send another message that should include a bunch of supported modes but... well here's a comparison:

Format: 004: [server] [version] [user-modes] [chan-modes] [modes-with-params]

What JTV sends out:

004: 0.0.1 w n

What a typical IRC server sends out:

004: ircd-seven-1.1.3 DOQRSZaghilopswz CFILMPQbcefgijklmnopqrstvz bkloveqjfI

So all we can verify from the server is that JTV supports "wallops" and "no external messages" which doesn't provide us much to work with to establish a baseline for it.

That makes sense. I wonder if the best method to allow for custom servers would be to create a configuration option that can be passed to new irc.Client() that would let you specify any supported modes.


qsheets commented Dec 7, 2012

Of course, it wouldn't hurt to file a bug with @justintv and see if you can't get them to add rpl_isupport (005) to the messages the server sends out upon connection. Because that reply does a lot more than just say the modes the server allows. It tells the client exactly what the server supports (hence, the name).

@sigkell sigkell closed this May 29, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment