Skip to content

HTTPRatelimit

The HTTPRatelimit class manages the rate limiting for HTTP requests. It tracks the remaining requests that can be made and handles the reset of these limits after a specified duration.

Properties

remaining

HTTPRatelimit.remaining  :: number

limit

HTTPRatelimit.limit  :: number

resetAfterThread

HTTPRatelimit.resetAfterThread  :: thread?

Methods

setRemaining

HTTPRatelimit : setRemaining (

     self: HTTPRatelimit
     remaining: number
)  -> ()

Sets the remaining number of requests that can be made.

resetAfter

HTTPRatelimit : resetAfter (

     self: HTTPRatelimit
     seconds: number
)  -> ()

Resets the remaining requests after a specified number of seconds.

setLimit

HTTPRatelimit : setLimit (

     self: HTTPRatelimit
     limit: number
)  -> ()

Sets the maximum number of requests that can be made.

isConsumed

HTTPRatelimit : isConsumed (

     self: HTTPRatelimit
)  -> boolean

Checks if the rate limit has been consumed.

Functions

new

HTTPRatelimit . new (

     remaining: number?
     limit: number?
)  -> ()

Creates a new instance of HTTPRatelimit.