RateLimiter

Retrieves rate limit buckets and handles rate limits by combining BucketAccessor and RateLimitHandler.

You can also make your own implementation by either implementing this interface directly or by delegating both interfaces.

Persistent bucket storage

Since createDefault stores buckets in-memory, the rate limits applied will be lost upon restart, however you can use createDefaultProxied, and then pass a ProxyManager which stores your buckets in persistent storage.

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract suspend fun getBucket(context: BContext, event: GenericCommandInteractionEvent, commandInfo: ApplicationCommandInfo): Bucket
abstract suspend fun getBucket(context: BContext, event: GenericComponentInteractionCreateEvent, rateLimitReference: ComponentRateLimitReference): Bucket
abstract suspend fun getBucket(context: BContext, event: MessageReceivedEvent, commandInfo: TextCommandInfo): Bucket
Link copied to clipboard
abstract suspend fun <T : GenericCommandInteractionEvent, IReplyCallback> onRateLimit(context: BContext, event: T, commandInfo: ApplicationCommandInfo, probe: ConsumptionProbe)
abstract suspend fun onRateLimit(context: BContext, event: MessageReceivedEvent, commandInfo: TextCommandInfo, probe: ConsumptionProbe)