sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
951 stars 405 forks source link

tell: avoid errors produced by empty tellee #2584

Closed SnoopJ closed 6 months ago

SnoopJ commented 6 months ago

Description

This changeset is an alternative to #2582 that transforms the tellee as early as possible.

The use of lstrip("@") in this patch means that an arbitrary number of prefixing @s will be removed, so that @@Someone is transformed into Someone where it would previously have been transformed to @Someone, but since this is an edge case to begin with, I don't think it's any problem.

Longer term, we'd like to have better awareness of if tellee is a valid nick or not. I've filed #2583 for this purpose.

Checklist

dgw commented 6 months ago

Note to self: Manually close #2582 when merging, since GH artificially doesn't allow merging a PR to auto-close another PR. (I say "artificially" because you can auto-close issues, and "all PRs are issues but not all issues are PRs" according to the GH API.)