Enforce rate limits for certain commands or modules #95
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature Request
Description
We need a way to enforce rate limits so that users can't invoke certain commands too often. I'd love for this to be in Commandler, but I can't think of a single generic way to implement it, unless we only create the annotation and have users implement a
RateLimitCheckerclass to be be injected at runtime.This is required for commands that are resource heavy or incur a bill. For example if someone feels like spamming
ping, we don't really care, that's on them. However, if someone is going to spamlocale detect, that'll cause a problem as this is a billed API, so we want to limit it per minute or hour to a reasonable figure.Interface
The value
1800, being the number of seconds to wait before the command can be performed again. It should be possible to put the annotation on whole modules too, which will share the ratelimit across all commands in it.