Closed glittershark closed 3 years ago
as an example of the use case:
https://github.com/jsjohnst/lita-pagerduty/blob/master/lib/lita/handlers/pagerduty_utility.rb#L20
Thank you for the PR! This is a great idea I had never considered. I have only two hesitations compared to what I originally had in mind with regards to #100:
Add support for passing a Proc to routes instead of a regular expression for matching - this proc will then be called with the message in the context of the handler object and should return a boolean indicating whether the route matches or not.
This allows for dynamically defined routing, plus support for configuring things like command names and prefixes, which is useful as plugin configuration is only available on a handler instance, not the singleton.
Probably addresses most of what #100 is asking for