zigdon / xkcd-Bucket

Bucket is the channel bot for #xkcd
http://wiki.xkcd.com/irc/Bucket
121 stars 31 forks source link

Add plugin signal for when no factoids/functions match #99

Closed dgw closed 7 years ago

dgw commented 7 years ago

Intended to make it possible for plugins to intercept e.g. "don't know" being fired, but hopefully has broader applications than the original idea of adding a signal in elsif ( $bag{addressed} ).

I will use this PR to quickly pull the new signal into my production instance and start toying with writing a plugin that uses it. Will merge if it serves the purpose correctly, and make changes if not.

dgw commented 7 years ago

Well, this certainly made the original goal (silencing don't know responses in PM) really easy. 15 lines, mostly boilerplate. Going to try and come up with some other ideas to play with the new signal in more complicated situations.

dgw commented 7 years ago

I meant to merge this myself after trying some more use cases, but OK.