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

plugin: `require_bot_privilege()` implies `require_chanmsg()` #2580

Closed dgw closed 6 months ago

dgw commented 7 months ago

Description

If the bot needs a channel privilege for a given callable, it probably wants to do something related to channel operations, and triggering such a callable in response to a private message makes no sense.

Sorry about trying to add something into 8.0.0 this late… I've been writing the 8.0 migration guide tonight, and when I ran across #2405 I realized that #2399 should have contemplated doing this too. If we're gonna "breaking change" privilege-decorator stuff, we should do it all in one major version.

If others agree that this is a good idea we can just merge the patch that's already ready to go and get on with finishing the release. (That's why I didn't open an issue first, to shorten the discuss -> implement -> review cycle.)

Checklist

dgw commented 6 months ago

Each assertion now has the message, and I skipped the logger call given @Exirel's valid point about "span" (🇫🇷? 😁) in the logs.

Ready to be merged over the weekend unless one of y'all swings by with a last-minute objection. 🙂