Skip to main content
Module

x/dynablox_opencloud/src/helpers/RatelimitHelper.ts>RatelimitHelper

A Roblox OpenCloud API wrapper for Deno and NodeJS written in TypeScript.
Latest
class RatelimitHelper
import { RatelimitHelper } from "https://deno.land/x/dynablox_opencloud@v0.2.2/src/helpers/RatelimitHelper.ts";

Helper for OpenCloud ratelimit handling.

Constructors

new
RatelimitHelper(options: Ratelimit[])

Construct a new RatelimitHelper instance.

Properties

private
_currentId: number

The current subject ID.

private
readonly
_options: Ratelimit[]

The options given to the constructor.

private
_subjects: RegisteredSubject[]

A list of global and individual subjects with ratelimits.

Methods

deregisterSubject(id: number): void

De-register a registered subject by ID.

getNextRequestAvailability(
method: Method,
url: URL,
id?: number,
): Date | undefined

Gets the date of the request availability for a URL and method for a subject.

getRequestAvailability(
method: Method,
url: URL,
id?: number,
): boolean

Gets the request availability for a URL and method for a subject.

incrementRatelimits(
method: Method,
url: URL,
id?: number,
count?,
): void

Increment all global and individual ratelimits for a subject ID by count.

listSubjectRatelimits(
method: Method,
url: URL,
id?: number,
): SubjectRatelimit[]

List a subject's global and individual ratelimits, even if some are 0.

Register a new subject.

Remove expired ratelimits in the instance.

Static Methods

Get a subject's global limitations.

Get a subject's individual limitations.