Closed beauwest closed 10 years ago
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]$/) ) {
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.
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: tmi.twitch.tv 0.0.1 w n
What a typical IRC server sends out:
004: asimov.freenode.net 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.
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).
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!