curious.commands.ratelimit¶
Utilities for ratelimiting a command.
Classes
BucketNamer |
A simple namespace for storing bucket functions. |
CommandRateLimit (*, limit, time, …) |
Represents a ratelimit for a command. |
RateLimiter () |
Represents a ratelimiter. |
-
class
curious.commands.ratelimit.
BucketNamer
[source]¶ Bases:
object
A simple namespace for storing bucket functions.
-
staticmethod
AUTHOR
()[source]¶ A bucket namer that uses the author ID as the bucket.
Return type: str
-
staticmethod
-
class
curious.commands.ratelimit.
CommandRateLimit
(*, limit: int, time: float, bucket_namer: typing.Callable[curious.commands.context.Context, str] = <function BucketNamer.AUTHOR>)[source]¶ Bases:
object
Represents a ratelimit for a command.
Parameters:
-
class
curious.commands.ratelimit.
RateLimiter
[source]¶ Bases:
object
Represents a ratelimiter. This ensures that commands meet the ratelimit before being ran.