interface ClientOptions {
    applicationShortname?: string;
    collectionLimits?: {
        announcementComments?: number;
        announcements?: number;
        calendarComments?: number;
        docComments?: number;
        docs?: number;
        interactions?: number;
        messages?: number;
        scheduledEvents?: number;
        scheduledEventsRSVPS?: number;
        threadComments?: number;
        threads?: number;
    };
    connectionMessage?: boolean;
    dataCollection?: boolean;
    forceDisableREST?: boolean;
    intents?: GatewayLayerIntent[];
    isOfficialMarkdownEnabled?: boolean;
    rest?: RESTOptions;
    restMode?: boolean;
    token: string;
    updateWarning?: boolean;
    waitForCaching?: boolean;
    wsReconnect?: boolean;
}

Properties

applicationShortname?: string

Application short name, enabling Commands & Interactions (uses slash commands).

/applicationShortname command_name

Please register commands using Client#registerApplicationCommand or bulkRegisterApplicationCommands.

collectionLimits?: {
    announcementComments?: number;
    announcements?: number;
    calendarComments?: number;
    docComments?: number;
    docs?: number;
    interactions?: number;
    messages?: number;
    scheduledEvents?: number;
    scheduledEventsRSVPS?: number;
    threadComments?: number;
    threads?: number;
}

Set your own limit to how much messages, threads, comments, events.. should be stored in cache before deletion.

connectionMessage?: boolean

This boolean is used to enable or disable the > Connection established. message when connection is successfully established.

dataCollection?: boolean

Consent to data collection, enabling us to improve the library, make statistics out of the data we collect, potentially leading us to make decisions based on them.

It can also be used to promote the TouchGuild library and deliver specific information like the average time in ms the gateway takes, leading us to optimize latency, and deliver a better & faster library.

We're using an API to forward collected data.

What is collected?

  • IDs of the application, including the owner of it, app shortname.
  • The build you're using, stable or dev.
  • Amount of execution per method.
  • Usage of Application Commands (boolean)

Data collecting is enabled by default if you use the development build.

Transparency is key, open-source is transparent, feel free to check the source-code.

Learn more about what we collect.

forceDisableREST?: boolean

NOT RECOMMENDED, CAN BREAK THINGS

REST methods are used to communicate with the Guilded API by sending requests. This feature was included in previous TouchGuild versions but we've changed how we manage REST requests.

Forcing disabling REST methods may crash the library when receiving events, reorganizing cache hierarchy, and more, they are used internally. Though you can still force disable those methods by setting this boolean to true, be aware that it isn't recommended at all.

false
intents?: GatewayLayerIntent[]

Intents, they have to be added into this array to enable them, and access to a variety of events and gateway information.

isOfficialMarkdownEnabled?: boolean

Fixes & improves Guilded API markdown and makes it Commonmark compliant.

Enabled by default, can be disabled to use old version of the Guilded markdown. (if facing issues for example)

REST Options are used for REST requests. You can change some properties there. This includes some properties like the baseURL and much more.

restMode?: boolean

REST-Only mode, does not initialize a gateway connection.

token: string

The app's bearer token, required to connect to the API.

updateWarning?: boolean

This boolean is used to enable or disable the update warning you receive when your version of TouchGuild is no longer the latest anymore.

waitForCaching?: boolean

If true, will wait for caching before emitting the event.

This will increase the event emit latency, but ensure that you receive the cached items in time.

By disabling this, you reduce latency between you & Guilded, and won't receive cached items in time.

true
wsReconnect?: boolean

Websocket auto reconnect on connection loss.

true