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
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?
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
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.
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…