It needs direct access to the db, so in my case it’s on the same vm as my instance.
It theoretically could be done in the webhook filter, it’s a full (but limited) language, I’d just need to add support for some functions.
Those are not really webhooks for public use but for the instance admins, so filtering by posts mentioning Taylor Swift should be more than enough. But yeah, you can just send everything to your bot if it can handle that.