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

[feature] optional plugin.rate (& friends) argument to limit admins #2435

Open
dgw opened this issue Mar 26, 2023 · 0 comments
Open

[feature] optional plugin.rate (& friends) argument to limit admins #2435

dgw opened this issue Mar 26, 2023 · 0 comments

Comments

@dgw
Copy link
Member

dgw commented Mar 26, 2023

Requested Feature

Basically, the following:

@plugin.rate(600, message='Wait your turn!', include_admins=True)
def game_func(bot, trigger):
    # some e.g. reward-collection or PvP-combat function that users
    # *including bot admins* are only allowed to call after a cooldown

(Of course, apply to the limit-type-specific decorators as well.)

Problems Solved

There's no way at the moment for plugin devs to rate-limit triggers by admins, without resorting to manual workarounds.

This snippet from one of my mIRC-script clones demonstrates a potential use case. (It also returns a message with the remaining time, and pulls the allowed rate from a config value. Those would be separate feature requests in core, though remaining time is included in the list of requested message placeholders in #2325.)

Alternatives

No response

Notes

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants