mrphlip / lrrbot

LoadingReadyRun Twitch chatbot
https://lrrbot.com/
Apache License 2.0
30 stars 20 forks source link

Implement regex searching for show when updated #1519

Closed Anaerin closed 5 months ago

Anaerin commented 7 months ago

Here's some preliminary code to attempt to find a show name from the Twitch title when it's updated. It uses a new column, "rule" in the shows table to store the RegEx to find the show ID. It's fairly simple, and I've tried to make it reasonably bulletproof, so if there's 0 or multiple matches it doesn't do anything. It'll also automatically remove an override if the title has changed and a new show has been found.

I've tried to match my code style to what's already there. I've also not tested this on a live instance, as the repo is missing necessary things to do that, like a DB skeleton. This is also the first time I've written Python, so please be gentle. :D

andreasots commented 7 months ago

We have setup instructions in our README that should help you to set up a local testing instance.

Also your database migration is missing.