zoton2 / Twitch-Team-Hosting-Bot

A Twitch.tv hosting bot for hosting channels from a team onto other offline channel(s).
7 stars 6 forks source link

Check Twitch API multiple times before attempting to host #8

Closed zoton2 closed 8 years ago

zoton2 commented 8 years ago

Sometimes the Twitch API's streams endpoint can return someone as offline, even if they are online. They also cache the data on their end, so you can't simply do 2 queries in a row. This means the bot sometimes attempts to host on a channel that is currently online.

The best solution I can think to this is to check the API, wait 1 minute, then check it again and combine the results. Maybe the check needs to be even longer?