Client options

Reference for new Client(token, options). Every option is optional; defaults are shown.

Reference for new Client(token, options). Every option is optional; defaults are shown.

Core

OptionDefaultMeaning
intents3243773 (all non-privileged)Gateway intents. Array of GatewayIntentBits, array of name strings, or a raw number. See Intents.
allowedMentions{ everyone: false, roles: false, users: false, repliedUser: true }Default mention allowances for createMessage / editMessage. Overridable per call.
autoreconnecttrueReconnect after gateway drops and failed connect() attempts.
compresstrueRequest zlib-stream compression if zlib-sync is installed; silently off otherwise.
connectionTimeout30000Milliseconds to wait for the websocket handshake.
defaultImageFormatImageFormat.JPEGDefault format for avatar/icon URL helpers.
defaultImageSize128Default image size; a power of two between 16 and 4096.
disableEvents{}Map of GatewayDispatchEvents to true to skip parsing them entirely.
getAllUsersfalseRequest every guild member on startup. Requires the GuildMembers intent and greatly delays ready.
guildCreateTimeout2000Milliseconds to wait for GUILD_CREATE after READY before firing ready.
largeThreshold250Member count above which a guild is "large" (members not sent inline). Discord caps at 250.
messageLimit100Max cached messages per channel. 0 keeps none.

Sharding

OptionDefaultMeaning
maxShards1Shard count, or "auto" for Discord's recommendation.
firstShardID / lastShardID-Shard range for multi-process sharding.
shards-Explicit array of shard IDs to run.
shardConcurrency"auto"Shards that may identify in parallel.
maxReconnectAttemptsInfinityReconnect attempts before giving up.
maxResumeAttempts10Resume attempts before a fresh identify.
reconnectDelay(_, n) => (n + 1) ** 0.7 * 20000Delay (ms) before the next reconnect.

See Gateway and sharding.

REST (options.rest)

OptionDefaultMeaning
agentshared keep-alive agentCustom HTTP(S) agent. Athena now defaults to a pooled keep-alive agent; supplying one overrides it.
baseURL/api/v10API base path.
domaindiscord.comAPI domain.
httpstrueSet false for a plain-HTTP local proxy.
requestTimeout15000Max milliseconds a request may be in flight.
latencyThreshold30000Above this measured latency, Athena emits a warn.
ratelimiterOffset0Manual offset on ratelimit reset math.
disableLatencyCompensationfalseTurn off the latency-aware ratelimit adjustment.
forceQueueingfalseHold all requests until shardPreReady.

See REST and ratelimits.

Caching (options.cache)

Opt-in per-cache factory overrides (users, members, messages, and more). Unset caches use the default in-memory store, so leaving this undefined keeps current behaviour. See Caching and memory and Scaling to millions.

WebSocket (options.ws)

Raw ws client options (headers, agent, TLS). Athena copies rest.agent into ws.agent if unset.

Default presence

Set status after construction, before or during ready:

client.presence = {
  status: PresenceUpdateStatus.Online,
  afk: false,
  since: null,
  activities: [{ name: 'with Athena', type: ActivityType.Playing }]
};