distype - v3.0.1
    Preparing search index...

    Interface GatewayOptions

    Gateway options.

    interface GatewayOptions {
        customGatewaySocketURL?: null | string;
        customGatewaySocketURLOverwrittenByResumeURL?: null | boolean;
        customGetGatewayBotURL?: null | string;
        disableBucketRatelimits?: boolean;
        guildsReadyTimeout?: number;
        intents?: IntentUtilsFactoryDirty;
        largeGuildThreshold?: number;
        presence?: null | GatewayPresenceUpdateData | GatewayPresenceUpdateData;
        sharding?: {
            offset?: number;
            shards?: number;
            totalBotShards?: number | "auto";
        };
        spawnAttemptDelay?: number;
        version?: number;
        wsOptions?: ClientOptions;
    }
    Index

    Properties

    customGatewaySocketURL?: null | string

    A custom socket URL to connect to. Useful if you use a proxy to connect to the Discord gateway. If customGatewayBotEndpoint is defined, its response's url parameter is overwritten by this. Note that gateway URL query parameters will still be sent.

    null
    
    customGatewaySocketURLOverwrittenByResumeURL?: null | boolean

    If customGatewaySocketURL is defined and this is true, the resume_gateway_url field in the READY dispatch is used instead of the customGatewaySocketURL. Otherwise, if customGatewaySocketURL is defined, it's used for connecting and resuming.

    null
    
    customGetGatewayBotURL?: null | string

    A custom URL to use as a substitute for GET /gateway/bot. Useful if you use a proxy to connect to the Discord gateway, and it handles bot instances / sharding. This should be the full URL, not just a route (Example: https://api.example.com/gateway, not /gateway). It is expected that making a request to this URL returns the same response that Discord normally would. If the response returns your system's socket URL as the url parameter, there is no need to specify customGatewaySocketURL. Additionally, if you use a custom base URL for the rest manager that returns custom information when GET /gateway/bot is called, this can be left undefined.

    null
    
    disableBucketRatelimits?: boolean

    If the rate limit on buckets (used for shard spawning) should be disabled. Only disable spawning rate limits if you are using a separate application to manage rate limits (customGatewaySocketURL and/or customGatewayBotEndpoint can be used to do so). Note that shards are still spawned in the order that they would with rate limiting enabled, just without a pause between bucket spawn calls.

    false
    
    guildsReadyTimeout?: number

    The time to wait in milliseconds after the last GUILD_CREATE event to consider that guilds are ready.

    15000
    

    Gateway intents. A numerical value is simply passed to the identify payload. An array of intent names will only enable the specified intents. all enables all intents, including privileged intents. nonPrivileged enables all non-privileged intents.

    0
    
    largeGuildThreshold?: number

    The number of members in a guild to reach before the gateway stops sending offline members in the guild member list. Must be between 50 and 250.

    50
    
    presence?: null | GatewayPresenceUpdateData | GatewayPresenceUpdateData

    The initial presence for the bot to use.

    null
    
    sharding?: {
        offset?: number;
        shards?: number;
        totalBotShards?: number | "auto";
    }

    Gateway sharding. Unless you are using a custom scaling solution (for example, running your bot across numerous servers or processes), it is recommended that you leave all of these options undefined.

    Type declaration

    • Optionaloffset?: number

      The number of shards to offset spawning by.

      For example, with the following configuration, the last 2 of the total 4 shards would be spawned.

      sharding: {
      totalBotShards: 4,
      shards: 2,
      offset: 2
      }

      This option should only be manually defined if you are using a custom scaling solution externally from the library and hosting multiple instances of your bot, to prevent unexpected behavior.

    • Optionalshards?: number

      The amount of shards to spawn. By default, GatewayOptions#sharding#totalBotShards is used.

    • OptionaltotalBotShards?: number | "auto"

      The number of shards the bot will have in total. This value is used for the num_shards property sent in the identify payload. This is NOT the amount of shards the process will spawn. For that option, specify GatewayOptions#sharding#shards. auto will use the recommended number from Discord.

    {}
    
    spawnAttemptDelay?: number

    The number of milliseconds to wait between spawn and resume attempts.

    2500
    
    version?: number

    The Gateway version to use.

    wsOptions?: ClientOptions

    Advanced WebSocket options.

    {}