Closed joshuaepstein closed 3 years ago
It'd be nice if you were more specific about why it wasn't working. Maybe you could explore the values and figure that out but here's a new solution:
client.on('message', (channel, tags, message, self) => {
if(self) return;
const badges = tags.badges || {};
const isBroadcaster = badges.broadcaster;
const isMod = badges.moderator;
const isModUp = isBroadcaster || isMod;
});
Also you can join the Twitch API Discord for help related questions. Issues are for issues with the library.
For reference, this is how you determine if the bot is a moderator:
const botUserState = client.userstate[channel];
const amMod = botUserState !== undefined && botUserState.mod === true;
The "userstate" object is automatically updated by the client when the "join" event happens or the "chat" event happens, so you don't have to micro-manage it.
This isnt working for me, do you have a fix