Problem with Channel Subscriber Check

Hello, i try to get information about users.
When i join in the channel, i get the userlist / chatter list.
Now i want a icon behind the name like subscriber or not.

i try the Reference | Twitch Developers and the Reference | Twitch Developers but here must match the user ID in the access Token. I get only the id from the chatter in the list and the broadcaster_id.

How can i check the user, is a subscriber from a streamer xyz?

EDIT: I didn’t found a solution for my problem. I cant access to a other user id accessToken. Or?

If you are in chat, the informat you seek is in the chat tags.

if you intend to use the API for this, you will require an access token from the broadcaster in order to read that data. The data “blongs to” the streamer/broadcasters so you need the streamer/broadcasters to read that data

Authentication is covered here Authentication | Twitch Developers

So it is not possible for a user to find out whether another user has a sub on the streamer channel? Just about the chat tags?

When i see Chatterino or Chatty what ever. This Tools load all users Subscribtion + Tier 1 or 2 or 3.
Without a Chat Tag. How is this possible? Can I get an accessToken from a user ID even if I’m not that user?

These applications read the IRCv3 tags for chat badges and display the relevant badge next to the user

Only if the user talks in the channel you are interested in.
Or you get permission from the streamer

Sure if you ask that user to authenticate against your clientID in order to provide an access token

But no one has write in the Channel. Example: User X is in the list and subscriber but doesnt write in the chat every time. This tools get the Subscriber status. So how can read chat badges from this user without chatting?

But when i access my app the scopes, the accessToken is only for my user_id.
How can i get other user_id accessToken or what ever for a API Call like[the_id_from_a_streamer_where_i_normal_user]&user_id=[the_id_from_a_other_user_without_a_accessToken]

You can’t. IRCv3 tags require someone to speak in the channel.

Chatty only shows badges next to users when they speak.
Chatty may then also store/cache that data for later display. But all it’s doing it storing it in cache for later and thus likely not 100% accurate, but close enough for chatty’s use case.

You need to get the broadcaster to grant access but then visitng a link and clicking [accept]
Which’ll then provide an access token that is valid for the broadcasters account.

This is basic oAuth.

oAuth allows other users to visit your website.
Click a link,
Which then grants access between their account and your client ID.
Your webserver then captures the resultant access token.

In order for you to read liriks subs then lirik needs to visti your oAuth flow and grant access
In order for you to read ninjas subs then ninja needs to visti your oAuth flow and grant access
In order for you to read your own subs then you need to visti your oAuth flow and grant access

For the streamers I work for I will send them to BarryCarlyonBot which will ask the user/broadcaster to authenticate/grant access. My server will capture the resultant access token and store it in my database for use.

There is this information without chatting and without other thinks:

I have already understood. I already have that.

So the streamer must first join my tool so that other users can see whether a user is a subscriber to this streamer.

How do you do that with the expire_in?
accesToken can lose its validity. Do you check your database every minute if the token has expired? Or do you have async settimeout for every expire_in?

You should be very careful about doing this sort of thing, and if you’re disclosing broadcasters subscriber list rather than just caching sub badges that have been in chat, then the broadcaster must be made fully aware your tool will publicise private information.

You don’t need to check every minute, tokens from the code flow last about 4 hours, an the expiry given tells you exactly that.

It’s entirely up to you how you refresh your tokens. Some choose to do it at set intervals using a cronjob or timers, others periodically poll that database for example every 30 minutes and if a token is within x amount of minutes from expiry refresh it, etc…

That looks like the popout user card with override CSS stlying

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