telebot-ts API Documentation - v1.0.0
    Preparing search index...

    Interface RateLimitOptions

    Options for configuring the rateLimit middleware.

    interface RateLimitOptions {
        keyGenerator?: (context: CallbackContext) => string;
        limit?: number;
        onLimitExceeded?: (context: CallbackContext) => void | Promise<void>;
        windowMs?: number;
    }
    Index
    keyGenerator?: (context: CallbackContext) => string

    Custom key extractor function. Defaults to extracting the user ID or chat ID.

    limit?: number

    Maximum allowed requests per key within the time window.

    1
    
    onLimitExceeded?: (context: CallbackContext) => void | Promise<void>

    Optional callback invoked when an update exceeds the rate limit.

    windowMs?: number

    Time window in milliseconds.

    1000 (1 second)