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

Can node-irc determine who is a mod? #340

Closed
johnRivs opened this issue Mar 20, 2015 · 6 comments
Closed

Can node-irc determine who is a mod? #340

johnRivs opened this issue Mar 20, 2015 · 6 comments

Comments

@johnRivs
Copy link

I'm using node-irc on twitch.tv, which has an IRC based chat. When I connect via another IRC client, it properly shows the mods, so I'm assuming twitch is providing the info.

Is there a way to retrieve the list of mods or check if a certain user is a mod?

@sim642
Copy link
Contributor

sim642 commented Mar 29, 2015

There's a dictionary of user channel modes in client.chans['#channel'].users where client is your node-irc Client object, have a look at that.

@johnRivs
Copy link
Author

No luck :/

Returns an object with the users like this:

{ guitar_gamer: '',
  flem7825: '',
  steven2116: '',
  tallon4496: '',
  dekrullevaar: '',
  jonmarsten: '' }

Even mods have an empty string.

@jirwin
Copy link
Collaborator

jirwin commented Apr 2, 2015

As an example, check out how I do it with my IRC bot at https://github.com/jirwin/treslek/blob/master/lib/treslek.js#L114.

@johnRivs
Copy link
Author

johnRivs commented Apr 2, 2015

I think it's just how Twitch.tv handles his chat. Neither of those methods find a @ on a mod's name. Also, the mode key on the returned object is always set to o, no matter who says it.

Thanks for the help though.

@punmechanic
Copy link

Twitch.tv should have allowances for checking who is a mod or not. I'm also working on a twitch bot, the following is an excerpt from the twitch docs.

http://help.twitch.tv/customer/portal/articles/1302780-twitch-irc

JOIN: Opening a Chat Room & Obtaining a User List
Usage: JOIN #channelname

Notes:
After a successful JOIN, the following will take place:

You will be sent a list of users that are currently in the channel.
A number of MODEs will be set from the jtv user to signify that a user can moderate chat. Users that can moderate chat are are defined as Channel Moderators, Admin's and Staff.
< JOIN #channelname
> JOIN #channelname
> 353: = #channelname nickname nickname2 nickname3 nickname4 anotherNickname
> 353: = #channelname nickname25 nickname26 nicknameN
> 366: #channelname End of /NAMES list
> jtv MODE #channelname +o channel_moderator
> jtv MODE #channelname +o channel_moderator2
> jtv MODE #channelname +o staff_user
> jtv MODE #channelname +o twitch_global_mod_user

@johnRivs
Copy link
Author

johnRivs commented Apr 8, 2015

Just switched to http://www.schmoopiie.com/docs/twitch-irc/

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

4 participants