Getting /mods list via API

Googled a bit, but I didn’t find anything useful, even in New Twitch API, so here I am.
How do I get mod list for a specific channel via API?

That information is not currently available in the API.

So, am I supposed to check, for every chatter, if it’s a mod or not throught USERS endpoint? What if I want to always have the complete list of moderators?
How do Nightbot and others chatbots get the updated list everytime?

Under the context of a chatbot:

A chatbot can request IRC tags, which provide information about if the user is a mod or not.

As documented here:

Under “PRIVMSG (Twitch Tags)” as the tag “mod” or the tag “user-type” of value mod

So I could avoid using USERS endpoint, but still there’s no way to obtain the complete moderators list, am I right? I’ll probably continue keeping a hand-written mod list for my channel: as far as I know: accessing a list is way faster than “parsing” a string, and my list is not so big.

Without metrics based on languages, you’d find it about the same speed or the difference neligable. Further more you’d be testing a boolean/numeric rather than a string. And immediately accounts for a moderator changing their username. Since to get a TwitchID you’d have to parse the tags…

Your bot can call .mods itself and parse the response.

Personally I’d advise just parsing the tags, since you may have subscriber only commands, that need to parse the tags.

Also means the moment a new mod exists you already know they are a mod.

Basically, just parse the tags, it’s better overal

1 Like

Very nice. Thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.