What my bot did previously:
- Connect to TMI using an implicit grant flow token from twitchapps
- Join the channels it’s supposed to be in (including its own, based on the username in the config)
- When it sees a message that breaks the link rules in any of the channels that have added it,
/deletethem using the message ID from the TMI message and send a message notifying the user over TMI (both using the channel in the IRC message)
What it does now:
- Connect to TMI using an implicit grant flow token for an app I had to register (no change there, other than the token itself)
- Use the client ID that’s now in the configuration file (there’s the new config) to reach out to Helix (there’s the new Helix client) to determine its own user ID based on the username provided in the config
- Join all the channels it needs to be in
- When it sees a message that breaks the link rules in any of the channels that have added it:
- Send a request through Helix to delete it (using its own user ID, its own client ID from the config, the broadcaster ID from the TMI message, and the message ID from the TMI message)
- Reply to the user notifying them their message was deleted over TMI (using the channel from the IRC message)
Maybe from Twitch’s perspective, but not from mine. I can tell you two regressions in my bot already, from me updating it and failing to consider all the differences between sending commands through Helix and TMI. First, it lost the ability to tell when its commands are being blocked (because someone added it to their channel and didn’t add it as a mod) and put a channel in jail for a bit, because I was relying on NOTICEs from TMI for that (easy fix, but the more obviously scary issue). It also broke my metrics, which is a harder fix, and more annoying to me; since my metrics were provided through the crate that handles my TMI connection, I need to figure out how to piggyback on that and send my own metrics, and redesign my Grafana dashboard to show new metrics.
When you add in additional components I need to use, there’s more ways for me to mess them up. And it’s not like development is my job; this is something I maintain mostly because it solves a problem a friend brought up with other mod bots in a discussion in their mod chat and I figured “hey, I can write a bot that does better” (and I did! it works pretty well, in my channel and the few others that it’s in). I spent the time to get it working, rewrote it entirely to change languages, but I have a full-time job and my bot isn’t it. I imagine most bot and extension devs on Twitch are in similar situations, where they can support their product, but only really in their free time. Adding on a second API that we have to use means we have to write a significant amount of new code, and that code can have issues, and even if we managed to prioritize updating the code to use the new API (to make sure our product doesn’t stop working in the future) those issues can linger.
And hopefully you can tell from my brief descriptions of my bot’s flow before and after that this is some pretty significant new stuff I need to do, in addition to most of the old stuff. That counter to the justification from Jon in yesterday’s stream, this isn’t removing complexity by letting me do everything over Helix, it’s adding complexity by making me use Helix when I had no reason to before.
Thankfully I think the only person running my bot is myself, so it was a transparent switch for any of the people using it, and nobody else has to worry about registering an application and adding a client ID to the config… but I know there are other open-source bots out there people use, and there are probably going to be a lot of people needing to do similar updates pretty soon.