Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
beauwest opened this issue Dec 4, 2012 · 8 comments
Closed

Comments

@beauwest
Copy link

beauwest commented Dec 4, 2012

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!

@beauwest
Copy link
Author

beauwest commented Dec 4, 2012

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.

@beauwest
Copy link
Author

beauwest commented Dec 4, 2012

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

@quentinxs
Copy link
Contributor

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.

@beauwest
Copy link
Author

beauwest commented Dec 6, 2012

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!

@beauwest
Copy link
Author

beauwest commented Dec 6, 2012

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

@quentinxs
Copy link
Contributor

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.

@beauwest
Copy link
Author

beauwest commented Dec 7, 2012

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.

@quentinxs
Copy link
Contributor

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).

@osslate osslate closed this as completed May 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants