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
When using sopel.module.rule, you can have the variable $nick in the regex pattern:
r'$nickhello' # will match "Bot: hello"
r'$nick hello' # won't match "Bot: hello", but "Bot: hello" (two spaces)
The $nick variable is super confusing as it should probably accept \s* instead of \s+ so a pattern like r'$nick hello' would be way easier to read and be less prone to error.
The solution
I don't know yet. Is \s* an acceptable change? Do we need to wait until Sopel 8 for that?
Notes
More documentation about these variables is required. Also this comes from a review by @dgw on #1873 where he points out that my comment should be more visible, and not just in a corner of the test suite.
The text was updated successfully, but these errors were encountered:
The problem
When using
sopel.module.rule
, you can have the variable$nick
in the regex pattern:The
$nick
variable is super confusing as it should probably accept\s*
instead of\s+
so a pattern liker'$nick hello'
would be way easier to read and be less prone to error.The solution
I don't know yet. Is
\s*
an acceptable change? Do we need to wait until Sopel 8 for that?Notes
More documentation about these variables is required. Also this comes from a review by @dgw on #1873 where he points out that my comment should be more visible, and not just in a corner of the test suite.
The text was updated successfully, but these errors were encountered: