Interface GuildRequestOptions

The options for a guild API request

interface GuildRequestOptions {
    allowCache?: boolean;
    apiKey?: string;
    cacheFor?: number;
    fetchAdditionalStats?: boolean;
    guild?: string;
    ignoreVersion?: boolean;
    multipleChoicesSelector?: ((v, i, a) => boolean | Promise<boolean>);
    priority?: boolean;
    retries?: number;
    tag?: string;
    timeout?: number;
    uuid?: string;
}

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

fetchAdditionalStats?: boolean

Whether to display more precise and additional information

This may cause extra API requests.

Default

false
guild?: string

The name of the guild, case insensitive

Either this, uuid or tag has to be defined. This is overridden by uuid
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
multipleChoicesSelector?: ((v, i, a) => boolean | Promise<boolean>)

Type declaration

    • (v, i, a): boolean | Promise<boolean>
    • A function that will be executed with each of the choices as a parameter. It may return a Promise of a boolean. In that case, the selector will be executed for all values simultaneously. And the passing element with the lowest index will be selected. If the selector returns false for all choices, the error is thrown regardless

      Parameters

      Returns boolean | Promise<boolean>

      True, if the given choice should be selected

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

tag?: string

The tag of the guild, case sensitive

Either this, uuid or guild has to be defined. This is overridden by guild and uuid
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.
uuid?: string

The UUID of the guild

Either this, name or tag has to be defined.

Generated using TypeDoc