Closed imaspeer closed 4 years ago
Unfortunately, that tag comes directly from Twitch and is marked deprecated in their documentation. It should be ignored. Instead, use the badges tag to look for subscriber or founder.
client.on('message', (channel, tags, message, self) => {
if(self) return;
let isSub = false;
if(tags.badges) {
isSub = 'subscriber' in tags.badges || 'founder' in tags.badges;
}
console.log(`${tags.username} is ${isSub ? '' : 'not'} a subscriber.`);
});
I'm also having this issue. thanks for the example code @AlcaDesign
I wonder if we still should additionally check for userstate.subscriber
or is the code above enough?
Will a normal subscriber (non founder) have "subscriber" in the badges object? 🤔
Subscriber and founder are mutually exclusive badges. They mean the same thing (as far as being subscribed matters) but will not be included in the badges at the same time.
👍🏻
and I guess my question was stupid because I just realized of course a subscriber will have subscriber
in their badges! duh!
Then I'm not sure why we still have .subscriber
in the userstate
object..... 🤔
It's still there because Twitch sends the data. tmi.js isn't excluding that data but it is marked deprecated in the official Twitch documentation.
Actual behaviour: The subscriber value in the userstate object is false for users who have the founder badge.
Expected behaviour: The subscriber value should always be true for users who have the founder badge, as it means they have an active subscription to the channel (in addition to being among the 10/25 first subs).
Server configuration