You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Plugin rules defined using @rule, @search, @find, and friends are currently forced to be case insensitive. Bot-owner users ask often enough about making certain custom triggers case-sensitive that we should allow for it in the API.
We've dropped enough old Python versions that we should be able to add keyword-only arguments to the relevant decorators.
Problems Solved
Use cases for this functionality mostly revolve around reducing accidental triggering of rules that overlap with common words/abbreviations. I can see a few places in first-party code where it could be useful, too, like in sopel-reddit's slash-reference matching.
Alternatives
Alternatives are pretty hacky: defining the case-insensitive rule or matching on all messages, and then matching a second time at the beginning of the plugin callable with a case-sensitive pattern.
Matching the same line twice is inefficient, on top of making the plugin code messy.
Notes
No response
The text was updated successfully, but these errors were encountered:
This would fit nicely with the feature request #462. After all, they both want to give more control over how the @rule decorator and friends match against the IRC message.
Requested Feature
Plugin rules defined using
@rule
,@search
,@find
, and friends are currently forced to be case insensitive. Bot-owner users ask often enough about making certain custom triggers case-sensitive that we should allow for it in the API.We've dropped enough old Python versions that we should be able to add keyword-only arguments to the relevant decorators.
Problems Solved
Use cases for this functionality mostly revolve around reducing accidental triggering of rules that overlap with common words/abbreviations. I can see a few places in first-party code where it could be useful, too, like in sopel-reddit's slash-reference matching.
Alternatives
Alternatives are pretty hacky: defining the case-insensitive rule or matching on all messages, and then matching a second time at the beginning of the plugin callable with a case-sensitive pattern.
Matching the same line twice is inefficient, on top of making the plugin code messy.
Notes
No response
The text was updated successfully, but these errors were encountered: