One of my other, minor projects utilizing the Twitch API and was mainly done as practice. It’s inspired by Nightdev’s uptime tool (now removed), and is meant to be used in conjunction with Nightbot’s custom API (or urlfetch) variable.
CHANNELNAME with the channel you want to check the uptime for (must be live) and it will return hours and/or minutes.
https://decapi.me/twitch/uptime?channel=decicus – This would return either
decicus is offline, or something like
1 hour, 3 minutes or just
3 minutes depending on if I am currently livestreaming or not.
If you want to add this as a Nightbot command, you just have to put the command result as:
It will automatically use the correct channel where the command was created, so no need to change anything about the command!
If you want, you can add custom text before and after the
$(urlfetch) part, but it has to be before the
$ and after the
If you found some use out of this, I would recommend my post about custom APIs, which covers this and many more scripts that might be useful to have in your bot.