Skip to content

ClientOptions

typedef · Source

Options for a client. Type: Object

Properties

DMChannelVoiceStatusSync

optional

DMChannelVoiceStatusSync: number

The amount of time in milliseconds that the Client to register the event with each DM channel (0=Disable)

Default: 0

captchaRetryLimit

optional

captchaRetryLimit: number

Captcha retry limit

Default: 3

captchaSolver

optional

captchaSolver: CaptchaSolver | null

Captcha Solver

TOTPKey

optional

TOTPKey: string

TOTP key / 2FA Key for two-factor authentication This is a 32-character Base32 string (excluding spaces), typically shown only once during your 2FA setup (QR code), or in the "Manual Entry" section. The library automatically removes spaces and converts the secret to uppercase. Example value: 'ftc3 uz6q 5lpw 2kew 4thr vtyp n2cu topn' or 'WSLIVE6EKYSRMVRBZLFGG2KVIVJMMQY5'

closeTimeout

optional

closeTimeout: number

The amount of time in milliseconds to wait for the close frame to be received from the WebSocket. Don't have this too high/low. It's best to have it between 2000-6000 ms. (e.g. recommended shard count, shard count of the ShardingManager)

Default: 5000

makeCache

optional

makeCache: CacheFactory

Function to create a cache. You can use your own function, or the Options class to customize the Collection used for the cache. Overriding the cache used in GuildManager, ChannelManager, GuildChannelManager, RoleManager, and PermissionOverwriteManager is unsupported and will break functionality

messageCacheLifetime

optional

messageCacheLifetime: number

DEPRECATED: Pass lifetime to sweepers.messages instead. How long a message should stay in the cache until it is considered sweepable (in seconds, 0 for forever)

Default: 0

messageSweepInterval

optional

messageSweepInterval: number

DEPRECATED: Pass interval to sweepers.messages instead. How frequently to remove messages from the cache that are older than the message cache lifetime (in seconds, 0 for never)

Default: 0

allowedMentions

optional

allowedMentions: MessageMentionOptions

Default value for MessageOptions#allowedMentions

invalidRequestWarningInterval

optional

invalidRequestWarningInterval: number

The number of invalid REST requests (those that return 401, 403, or 429) in a 10 minute window between emitted warnings (0 for no warnings). That is, if set to 500, warnings will be emitted at invalid request number 500, 1000, 1500, and so on.

Default: 0

partials

optional

partials: Array<PartialType>

Structures allowed to be partial. This means events can be emitted even when they're missing all the data for a particular structure. See the "Partial Structures" topic on the guide for some important usage information, as partials require you to put checks in place when handling data.

Default: ['USER', 'CHANNEL', 'GUILD_MEMBER', 'MESSAGE', 'REACTION', 'GUILD_SCHEDULED_EVENT']

restWsBridgeTimeout

optional

restWsBridgeTimeout: number

Maximum time permitted between REST responses and their corresponding WebSocket events

Default: 5000

restTimeOffset

optional

restTimeOffset: number

Extra time in milliseconds to wait before continuing to make REST requests (higher values will reduce rate-limiting errors on bad connections)

Default: 500

restRequestTimeout

optional

restRequestTimeout: number

Time to wait before cancelling a REST request, in milliseconds

Default: 15000

restSweepInterval

optional

restSweepInterval: number

How frequently to delete inactive request buckets, in seconds (or 0 for never)

Default: 60

restGlobalRateLimit

optional

restGlobalRateLimit: number

How many requests to allow sending per second (0 for unlimited, 50 for the standard global limit used by Discord)

Default: 0

rejectOnRateLimit

optional

rejectOnRateLimit: Array<string> | RateLimitQueueFilter

Decides how rate limits and pre-emptive throttles should be handled. If this option is an array containing the prefix of the request route (e.g. /channels to match any route starting with /channels, such as /channels/222197033908436994/messages) or a function returning true, a RateLimitError will be thrown. Otherwise the request will be queued for later

retryLimit

optional

retryLimit: number

How many times to retry on 5XX errors (Infinity for an indefinite amount of retries)

Default: 1

failIfNotExists

optional

failIfNotExists: boolean

Default value for ReplyMessageOptions#failIfNotExists

Default: true

presence

optional

presence: PresenceData

Presence data to use upon login

Default: { status: 'online', since: 0, activities: [], afk: false }

waitGuildTimeout

optional

waitGuildTimeout: number

Time in milliseconds that Clients with the GUILDS intent should wait for missing guilds to be received before starting the bot. If not specified, the default is 15 seconds.

Default: 15_000

sweepers

optional

sweepers: SweeperOptions

Options for cache sweeping

Default: {}

ws

optional

ws: WebsocketOptions

Options for the WebSocket

http

optional

http: HTTPOptions

HTTP options

Unofficial software. Not affiliated with or supported by Discord.