Table of Contents
EventSub
Twitch eventsub is the way that the bot gets events from twitch, like chat messages, bans, cheers, etc.
Twitch offers two ways to receive these events: webhook and websocket. Conduits are wrappers, not actual transport methods.
Websockets are significantly easier to setup and were used for a while by this bot, but are buggy as fuck. They randomly get deleted and recreated until the rate-limit of 3 of the same type is reached, then everything goes to shit. This is why I ditched websockets.
Webhooks are much more complicated to set up.
You need an HTTP server with SSL on a public url receiving requests that both validates and processes the request.
Twurple has everything builtin for doing this, but as I already have a reverse proxy with certbot SSL certificate creation set up, I'm just using that.
The url twitcheventsub.qwerinope.com points to my VPS on Hetzner running the bot.
For development, it will now use ngrok to tunnel webhook traffic to the computer running the bot.