TrojanerHD / TrojanerBot

My discord bot
MIT License
4 stars 2 forks source link

Make only one request to Twitch instead of for each server #90

Open TrojanerHD opened 9 months ago

TrojanerHD commented 9 months ago

Follow-up PR for #67

We do not want to make a request to Twitch for each server as shown here:

https://github.com/TrojanerHD/TrojanerBot/blob/21cfe104101b2689732f7f9cf8e083f9e425f05c/src/twitch/LiveChannel.ts#L10-L12

Instead we want to bundle the requests into one and make only one request to Twitch in order to prevent rate limiting when the bot runs on too many servers

MelanX commented 9 months ago

Keep in mind that a maximum count of 100 streams per request is allowed, see here: https://dev.twitch.tv/docs/api/reference/#get-streams