Stream Live Alerts



[Moved to Feature Requests by IllusionaryOne]

I realise this could just a much belong in the feature requests section, but I’m more curious as to the technical restrictions.

So yeah: What are the technical delays/restrictions on being able to post golive announcements in Discord for other streamers?

I’m trying to keep the number of bots in my server to a minimum (1). I could add mee6, but I’d be adding it solely for go live announcements, and if there is a realistic chance of PB doing this, I’d rather wait.


I cannot think of any, per se. I mean, some sort of looping mechanism against the Twitch API would have to be created to check those streams – and stay within Twitch’s API limits. That is where the trick lies, I think. I mean, lots of bots just throw caution to the wind and just hammer the hell out of the Twitch API (even we do to a point - but you may have noticed we cache data from Twitch and reduced our calls a bit). That said, I would probably check streams every 30-60 seconds to see if they have gone live, but not more often.

My usual boilerplate statement aside about APIs and limits :slight_smile:

The /streams/ endpoint allows for a multiple list of channels to be checked for online status. However, remember that you must have their numeric ID now, and not the channel (user) name, so you would you want to cache the IDs of the folks that you want to lookup (PhantomBot does this) with the API call we provide to Twitch from our library — however you may consider a new call to check multiple users all at once.

{"_total":2,“users”:[{“display_name”:“IllusionaryOne”,"_id":“77632323”,“name”:“illusionaryone”,“type”:“user”,“bio”:“Name is IllusionaryOne. I’m thirty-something. Gamer. Software engineer. Anime consumer. Variety streamer.”,“created_at”:“2014-12-21T06:40:53.245504Z”,“updated_at”:“2017-07-06T05:00:23.058572Z”,“logo”:“"},{“display_name”:“Cereth”,"_id":"21292708”,“name”:“cereth”,“type”:“user”,“bio”:“Final Fantasy speedrunner [5, 6, 7, 9, 10, 13-2 and Crystal Chronicles]”,“created_at”:“2011-03-22T12:20:34.110453Z”,“updated_at”:“2017-07-09T16:35:23.637162Z”,“logo”:“”}]},21292708
{"_total":1,“streams”:[{"_id":25708911472,“game”:“Final Fantasy V”,“broadcast_platform”:“other”,“community_id”:“848d95be-90b3-44a5-b143-6e373754c382”,“community_ids”:[“848d95be-90b3-44a5-b143-6e373754c382”],“viewers”:187,“video_height”:720,“average_fps”:60.0100857287,“delay”:0,“created_at”:“2017-07-09T15:01:48Z”,“is_playlist”:false,“stream_type”:“live”,“preview”:{“small”:“",“medium”:“”,“large”:“”,“template”:“{width}x{height}.jpg”},“channel”:{“mature”:false,“status”:"!4JF | Pure Chaos 4 Job Fiesta! | SMN/NIN/BER/THF (SNES)”,“broadcaster_language”:“en”,“display_name”:“Cereth”,“game”:“Final Fantasy V”,“language”:“en”,"_id":21292708,“name”:“cereth”,“created_at”:“2011-03-22T12:20:34.110453Z”,“updated_at”:“2017-07-09T16:35:23.637162Z”,“partner”:true,“logo”:“",“video_banner”:“”,“profile_banner”:“”,“profile_banner_background_color”:"",“url”:“”,“views”:4952415,“followers”:51549,“broadcaster_type”:"",“description”:"Final Fantasy speedrunner [5, 6, 7, 9, 10, 13-2 and Crystal Chronicles]”}}]}

Note that the endpoint only returns live channels by default, hence why only one record came back (I am not online).

Hope that helps. Yes, it is possible, but, need to work within the constraints of how often Twitch wants us hitting the API and using caching of data effectively to reduce the number of hits.



OK cool. So it is possible, just not yet implemented. :smiley:

Now’s the bit where I ask if it can be moved to Feature Requests? Just because I said I wouldn’t. Also new forums and it’s not already there.


So, since I managed to sneak this into feature requests, I’ve been thinking about how/what I’d like to see. Obviously this may not be possible, or I might just need to duplicate a module once it’s done or something, but I’ll just dump the words here and see what comes of it.

Aside from the obvious things of being able to create a list to get called out, I’d quite like to have the announcement be separately customisable between the owner/main broadcaster and other people.

If at all possible, based on my ideas and what I have in mind, I’d like it to have two different groups, so that I could set one announcement type for some streamers, and a different announcement for the others. This might end up involving me having to duplicate the module, but that’s fine.

Ideally, I think the best way to do this would be to have customisable announcements for each channel targeted, though I’ve no idea if this would be practical. Based on what I understood of the earlier technical post, it would be a separate check for each channel, which I think means you could have a separate response for each as well, but I defer to those who actually understand coding.


Currently working on this, the code is mostly done and on github, the user will probably have to specify the channel id though, since it will save us a few API calls.


Cool. I don’t suppose we could get instructions on how to do this? Or a command perhaps? !getid [channelname] I don’t know. :smiley:

But yeah, looking forward to this a lot.


There are sites for this, like you just look under account unique id.


OK cool :smiley:


I’ll see how I code the module, maybe I’ll make it auto grab it and cache it in the database.


I’m happy to grab the ID if needed myself. Just thinking of those who won’t want to do that. :smiley:


So, I’ve been thinking about this for a while, and rather than start a new topic, I thought I’d update this one. This is from an end user point of view, not a backend angle, because I can’t technical at all.

Given that we already have the account link function, I would ideally see it have something like !account live on/off randomstreamername, so that we can turn on notifications for users.

Alternatively, it could be self-activated, so it would look more like !account live on/off, and it would activate your own shoutout.

This could also possibly be done with both of these functions. Hoping this makes sense.


Sounds reasonable until Helix becomes the default. The streams endpoint is rate limited. You will get (by default) 30 queries in a minute - that includes the need to query your own streams endpoint to see if you are on/offline. That amount, in theory, may be allowed to be 120 queries, but that depends upon the type of query being made. So, in theory, to continue to support your own queries, and provide for others, you could pick, let us say, 14-30 people so you can query enough for yourself as well – assuming you still want Helix to pull data for other relevant parts of your stream – followers, subscribers, stream up/down, followage, clips, … you get the idea. Also, we would have to query to get the ID from their username (unless it is already cached) - there are potentially 2 queries per user at least once.

Here is a query in Helix to determine if I am on/offline…

< Ratelimit-Limit: 30
< Ratelimit-Remaining: 29
< Ratelimit-Reset: 1515130185
< Twitch-Trace-Id: 365a078733296702776cef72ba764481
< X-Ctxlog-Logid: 1-5a4f0d0e-7dce31a5439119f114eae639
< Front-End-Https: on
< Timing-Allow-Origin:
< Date: Fri, 05 Jan 2018 05:28:46 GMT
< Content-Length: 27
< Connection: keep-alive
< Set-Cookie: AWSALB=jsBLQ91SMRk+s8SVU9Yn9uJXOqk7nnYng01ZJ+BT++5wfsQD3SfQzQVEtRPTYr68e4c0j+ndGKYKjEpSvqdwFiYQJ8WZqrRG6qIxpuWxkh+xv4C481PAoZYrveGu; Expires=Fri, 12 Jan 2018 05:28:46 GMT; Path=/

  • Connection #0 to host left intact

Note the rate limit? 29 remaining? Helix will be much more interesting than what we are used to with the v5 API.

We are going to look at migrating to Helix probably middle of the year – we want to give Twitch plenty of time to get the APIs from v5 ported over that we need and give them time to shake things out. We also need to architect in paying attention to the rate limit and time that it is refreshed to either queue up or dispose of queries to Twitch. Once we move, get ready for much tighter rate limits, unfortunately. Then, at the end of the year, v3 and v5 are going away. So, even if we try to cling to them, we have a date already on the tombstone from Twitch.


Sounds good. I don’t think there’s more than 10 people I’d want to add, if that, so that would be fine.

Shame about the rate limits, I guess, but if it doesn’t catch fire on a regular basis, then a fair tradeoff. :stuck_out_tongue:


The API does allow you to do multiple queries, up to 100 in one call, but that really isn’t well documented anywhere except for helix if I remember right. I’m sure hoping that helix will have better features and endpoints than v3 and v5, but as of right now it’s not too promising. :stuck_out_tongue:


This is something I’d love to have as well. If I could oust the unreliable Now Live bot, that would be great. I have a handful of friends I’d like to announce in my Discord when they go live so this would be perfect.

Is there an ETA for this? Or maybe a WIP module we could check out?