I have a discord bot but wanted to have it check if a specific user is live.
edit: got the response back as 200 ok. but not sure how to tell if it is live.
the documents response and this response are very different: ( the stream object come back as null. https://dev.twitch.tv/docs/v5/reference/streams/#get-stream-by-user
I think that’s ok. You just get the response from Server.
You can also parse the result as JSON and check ‘[stream][stream-type]’ value, that can be null (not streaming), 'rerun’ (on a vodcast), otherwise streamer is live (I can’t remember the actual valie for live streaming).
Yes, if you get a {“stream”: null}, then the channel is offline, if the channel is live you get the full stream object as shown in the example on the docs.