How to capture list of mods for a room?

I’m doing it like this in my mod checker (javascript). Shouldn’t be too different to do in python.

// The moderators of this room are: 3ventic, notventic, ohbot
// Check that the message starts with "The moderators of this"
if (message.indexOf('The moderators of this') === 0) {
    // Split from the colon
    var usernames = message.split(': ');
    // Check the array has 2 elements so the next line doesn't crash the app, if Twitch change the message format
    if (usernames.length > 1) {
        // Split the comma-separated list of names by comma
        usernames = usernames[1].split(', ');
        // usernames is [ '3ventic', 'notventic', 'ohbot' ]
    }
}
1 Like