How to get subscription level of user in chat without calling twitch api?

I dont want to generate excessive data tranfers between twitch and my chatbot, but i do want to make some top-tier subscribers commands\features in chat/

When you have IRCv3 tags enabled you get extra data like this:

<- @badges=moderator/1,subscriber/24,bits/10000;color=#FF4BD3;display-name=Matt_Thomas;emotes=;id=91b26539-469d-447e-a338-0079e44f5fce;mod=1;room-id=60343212;sent-ts=1493851243246;subscriber=1;tmi-sent-ts=1493851242665;turbo=0;user-id=35805066;user-type=mod :matt_thomas!matt_thomas@matt_thomas.tmi.twitch.tv PRIVMSG #schyax :derp

Looking at the breakdown by line:

badges=moderator/1,subscriber/24,bits/10000;
color=#FF4BD3;
display-name=Matt_Thomas;
emotes=;
id=91b26539-469d-447e-a338-0079e44f5fce;
mod=1;
room-id=60343212;
sent-ts=1493851243246;
subscriber=1;
tmi-sent-ts=1493851242665;
turbo=0;user-id=35805066;
user-type=mod
:matt_thomas!matt_thomas@matt_thomas.tmi.twitch.tv PRIVMSG #schyax :derp

You can see the badges area subscriber/24 - This means 24 months. The values will only be that of the sub badges but I think it might work for your needs.

This only apples to badges and months subbed, I think the user is on about tiers.

Tiers can be fetched either via the twitch API or cached when they resub as documented under pub sub https://dev.twitch.tv/docs/v5/guides/PubSub/

The long and short of it is that if you want the tier ($4.99/$9.99/$24.99) you’ll have to make a number of API calls at bot boot, and then update via pubsub.

You could record data from the chat, when they sub there is a USERNOTICE

msg-param-sub-plan=1000;

1000 is 4.99
2000 is 9.99
3000 is 24.99
Prime is Prime

Add it to a database/text file with a date/time stamp or something, and set it to remove it in ~30 or so days. It should keep the list fairly current but the bot would have to be active 24/7 to stay current.

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