module: add require account
feature
#1733
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fresh from my well-rested (not really) keyboard* comes this: a new plugin decorator. It lets you require that a user be authenticated to network services (NickServ or whatever) to use a given function.
I added a test for the new decorator, fixed a mistake in
require_chanmsg
's test, and made all therequire_*
decorators consistent in terms of code structure. A couple of them were using a silly trick to get thebot
andtrigger
args by name. Someone please take a good look at those changes too, to make sure I didn't forget something dumb (like how I almost forgot to passbot
andtrigger
to the actual function after checking the conditions and had to amend the commit).Here's a rendered preview of the documentation for
@module.require_account
:This idea was inspired by an account-related question from @RhinosF1 on IRC, and encouraged by @deathbybandaid. (But honestly, dbb gets excited about every idea. 😝)
* — I said I'd do "less than last year" for Hacktoberfest (when I made a PR every day), and technically I kept that promise. I made one PR less than last year.