DefaultRateLimiter

class DefaultRateLimiter(val scope: RateLimitScope, bucketFactory: BucketFactory, deleteOnRefill: Boolean = true) : RateLimiter, RateLimitHandler, BucketAccessor(source)

Default RateLimiter implementation, based on DefaultRateLimitHandler and DefaultBucketAccessor.

Note: The rate limit message won't be deleted in a private channel, or if the refill delay is longer than 10 minutes.

Parameters

scope

Scope of the rate limit, see RateLimitScope values.

deleteOnRefill

Whether the rate limit message should be deleted after the refill delay.

See also

Constructors

Link copied to clipboard
constructor(scope: RateLimitScope, bucketFactory: BucketFactory, deleteOnRefill: Boolean = true)

Properties

Link copied to clipboard

Functions

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