Interface LeaderboardRequestOptions<LbType>

The base options for a generic API request

interface LeaderboardRequestOptions {
    allowCache?: boolean;
    apiKey?: string;
    cacheFor?: number;
    ignoreVersion?: boolean;
    leaderboard: LbType;
    limit: number;
    priority?: boolean;
    retries?: number;
    timeout?: number;
}

Type Parameters

  • LbType

Hierarchy

Properties

allowCache?: boolean

Whether to allow this request to use the cache or ongoing requests if available

Requests using cache or other requests do not count towards the ratelimit and return a lot faster.
apiKey?: string

The API key to use in this request

The key has to be registered in the config.
If this is not given, the registered key with the most free requests will be selected.
cacheFor?: number

The amount of time the request should be cached for, overwrites the defaults specified in the config

ignoreVersion?: boolean

Whether to ignore version errors

You can use this to resolve temporary conflicts while the library awaits being updated. Otherwise it should stay enabled.

Default

false
leaderboard: LbType

The type of Leaderboard to fetch

limit: number

The maximum amount of entries, maximum of 1000

Default

100
priority?: boolean

Whether this request should be put to the front of the queue, executing before any non-priority requests are handled

Default

false
retries?: number

The amount of times to retry the request on error

timeout?: number

The amount of milliseconds a until the request should be rejected

Be aware that each retry has it's own timeout, meaning 30,000 ms of timeout may lead to a 90,000 ms wait until a request is rejected on 2 retries.

Generated using TypeDoc