Type alias ClientOptions

ClientOptions: {
    cache?: {
        cacheCalendars?: boolean;
        cacheCalendarsRsvps?: boolean;
        cacheChannels?: boolean;
        cacheForumTopics?: boolean;
        cacheMemberBans?: boolean;
        cacheMessageReactions?: boolean;
        cacheMessages?: boolean;
        cacheServers?: boolean;
        cacheSocialLinks?: boolean;
        cacheWebhooks?: boolean;
        fetchMessageAuthorOnCreate?: boolean;
        removeCalendarRsvpOnDelete?: boolean;
        removeCalendarsOnDelete?: boolean;
        removeChannelOnDelete?: boolean;
        removeMemberBanOnUnban?: boolean;
        removeMemberOnLeave?: boolean;
        structureBuilder?<K, V>() => CacheStructure<K, V>;
    };
    gateway?: {
        discardEvent?(event, data) => boolean;
    };
    rest?: {
        headers?: Record<string, string>;
        proxyURL?: string;
        version?: 1;
    };
    token: string;
    ws?: {
        headers?: Record<string, string>;
    };
}

Options for constructing the client.

Type declaration

  • Optional cache?: {
        cacheCalendars?: boolean;
        cacheCalendarsRsvps?: boolean;
        cacheChannels?: boolean;
        cacheForumTopics?: boolean;
        cacheMemberBans?: boolean;
        cacheMessageReactions?: boolean;
        cacheMessages?: boolean;
        cacheServers?: boolean;
        cacheSocialLinks?: boolean;
        cacheWebhooks?: boolean;
        fetchMessageAuthorOnCreate?: boolean;
        removeCalendarRsvpOnDelete?: boolean;
        removeCalendarsOnDelete?: boolean;
        removeChannelOnDelete?: boolean;
        removeMemberBanOnUnban?: boolean;
        removeMemberOnLeave?: boolean;
        structureBuilder?<K, V>() => CacheStructure<K, V>;
    }

    The cache options for the client.

    • Optional cacheCalendars?: boolean

      Whether to cache calendars.

      Default

      true
      
    • Optional cacheCalendarsRsvps?: boolean

      Whether to cache calendar RSVPs.

      Default

      true
      
    • Optional cacheChannels?: boolean

      Whether to cache channels.

      Default

      true
      
    • Optional cacheForumTopics?: boolean

      Whether to cache forum topics.

      Default

      true
      
    • Optional cacheMemberBans?: boolean

      Whether to cache member bans.

      Default

      true
      
    • Optional cacheMessageReactions?: boolean

      Whether to cache message reactions.

      Default

      true
      
    • Optional cacheMessages?: boolean

      Whether to cache messages.

      Default

      true
      
    • Optional cacheServers?: boolean

      Whether to cache servers.

      Default

      true
      
    • Optional cacheSocialLinks?: boolean

      Whether to cache member social links.

      Default

      true
      
    • Optional cacheWebhooks?: boolean

      Whether to cache webhooks.

      Default

      true
      
    • Optional fetchMessageAuthorOnCreate?: boolean

      Whether to fetch the author of a message when it is created and cache it.

      Default

      false
      
    • Optional removeCalendarRsvpOnDelete?: boolean

      Whether to remove a calendar RSVP from the cache when it is deleted.

      Default

      true
      
    • Optional removeCalendarsOnDelete?: boolean

      Whether to remove a calendar from the cache when it is deleted.

      Default

      true
      
    • Optional removeChannelOnDelete?: boolean

      Whether to remove a channel from the cache when it is deleted.

      Default

      true
      
    • Optional removeMemberBanOnUnban?: boolean

      Whether to remove a member's ban from the cache when they are unbanned.

      Default

      true
      
    • Optional removeMemberOnLeave?: boolean

      Whether to remove a member from the cache when they leave a server.

      Default

      true
      
    • structureBuilder?:function
      • The function to create a new instance of CacheStructure.

        Remarks

        You can use this to provide your own implementation of CacheStructure, which will be used to cache data in the client in a future update.

        Type Parameters

        • K

        • V

        Returns CacheStructure<K, V>

  • Optional gateway?: {
        discardEvent?(event, data) => boolean;
    }

    Gateway handling options

  • Optional rest?: {
        headers?: Record<string, string>;
        proxyURL?: string;
        version?: 1;
    }

    The RestManager options.

    • Optional headers?: Record<string, string>

      The headers that will be supplied in each request that the client, or more precisely, RestManager, will send.

      Remarks

      It's generally only recommended to supply headers that may be required for Guilded experiments, as vital headers will be supplied by Guilded.js.

    • Optional proxyURL?: string

      The base url of the API you want to send requests to. By default, this will send it to guilded's rest API. This is meant for big bot developers who want to use a proxy rest system.

      Remarks

      If you want to use a custom API url, you can set this property to your custom url.

    • Optional version?: 1

      The version of the API to be used for making requests. By default, this will use the latest version that the library supports.

      Default

      1
      

      Remarks

      You can set the API version to 1 if you want to use the stable API.

  • token: string

    The bot's token.

    Remarks

    The token is required to authenticate with the Guilded API.

  • Optional ws?: {
        headers?: Record<string, string>;
    }

    Options that will be given directly to WebSocket.

    • Optional headers?: Record<string, string>

      The headers that will be supplied when WebSocket is being initialized and its request is made.

      Remarks

      It's generally only recommended to supply headers that may be required for Guilded experiments, as vital headers will be supplied by Guilded.js.

Generated using TypeDoc