dgw / sopel-rep

Lets users "luv" and "h8" other users on IRC. Functional clone of a mIRC script someone used in a channel I was in.
Other
0 stars 1 forks source link

Use `search` decorator to look for inline karma commands #43

Open dgw opened 3 months ago

dgw commented 3 months ago

This allows reusing the same pattern defined as a module-level constant in sopel_rep.plugin instead of building it multiple times to suit different contexts.

Note: Cannot switch to the find decorator because each match triggers a separate instance of the decorated callable; the "first valid action" logic in karma_cmd() wouldn't work with that.

I think this resolves #36; can't see anything else obvious in the plugin that could use updating as far as decorators/matching.