Default Rate Limit Handler
class DefaultRateLimitHandler(scope: RateLimitScope, deleteOnRefill: Boolean = true) : RateLimitHandler(source)
Default RateLimitHandler implementation based on rate limit scopes.
Text command rate limits are sent to the user in the event's channel, if the bot cannot talk, then it is sent to the user's DMs, or returns if not possible.
Interactions are simply replying an ephemeral message to the user.
All messages sent to the user are localized messages from DefaultMessages and will be deleted when expired.
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.
delete On Refill
Whether the rate limit message should be deleted after expiring
See also
Functions
Link copied to clipboard
open suspend override fun <T : GenericComponentInteractionCreateEvent, IReplyCallback, IMessageEditCallback> onRateLimit(context: BContext, event: T, probe: ConsumptionProbe)
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)