Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules: use @require_admin instead of if trigger.admin #1456

Merged
merged 2 commits into from
Mar 5, 2019

Conversation

Exirel
Copy link
Contributor

@Exirel Exirel commented Jan 23, 2019

There is a decorator in sopel.module.require_admin that check for trigger.admin, but it wasn't used everywhere!

So I fixed this, and added a reply=False optional argument, that, when True, uses bot.reply instead of bot.say.

It's a very small improvement.

@dgw dgw added this to the 7.0.0 milestone Jan 23, 2019
@dgw dgw added the Tweak label Jan 23, 2019
@Exirel Exirel force-pushed the decorator-is-admin branch from 219a413 to 0054382 Compare January 24, 2019 09:16
@Exirel Exirel force-pushed the decorator-is-admin branch from 0054382 to 5aa70ae Compare February 6, 2019 13:57
@Exirel
Copy link
Contributor Author

Exirel commented Feb 6, 2019

Note: rebase to stay up-to-date with the master branch.

@dgw this is a fairly small change, so it's perfect for a quick & easy merge.

@Exirel Exirel force-pushed the decorator-is-admin branch from 5aa70ae to 9b86bfb Compare February 15, 2019 09:43
@Exirel Exirel force-pushed the decorator-is-admin branch 2 times, most recently from 13bfdb8 to 77f1720 Compare March 5, 2019 11:00
@Exirel Exirel force-pushed the decorator-is-admin branch from 77f1720 to 0a3e3aa Compare March 5, 2019 14:13
Copy link
Member

@dgw dgw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added "Documentation" label so maybe I'll remember to document the new parameter in changelogs…

Maybe. 😁

@dgw dgw merged commit 3b4d840 into sopel-irc:master Mar 5, 2019
@Exirel
Copy link
Contributor Author

Exirel commented Mar 5, 2019

Maybe. 😁

Maybe eventually. 😉

@dgw
Copy link
Member

dgw commented Mar 5, 2019

In the distant future:

Changes between 8.8.3 and 9.0.0
===============================

[...]

API changes
-----------

* `module.require_admin()` now takes an optional boolean argument `reply` (default `False`)
  * This was added back in 7.0.0, but we forgot about it until now

🤣

@Exirel Exirel deleted the decorator-is-admin branch March 21, 2019 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants