Uptime command on YouTube

Asked Oct 6, 2022·1 reply·Last activity 3 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

How do I create an uptime command using nightbot on a YouTube Livestream chat?
I have tried the following codes but both showed an output that said [invalid variable]

!commands add !uptime $(youtube $(channelname) "{{displayName}} has been live for {{uptimeLength}}")

$(youtube $(channel) "Stream uptime: {{uptimeLength}}")

1 reply

Hey @Perky Raccoon!

Short answer is: you don't.

YouTube doesn't expose the elapsed time through their API, so Nightbot can't refer to it for timestamps; even if you were building your own solution, you wouldn't be able to get the data you want.

Overall, YouTube's Live API is very limited, it's impossible to make a $(twitch)-like variable for it, for now at least, maybe in the future YouTube will have a better API. :crossed_fingers: