DiscordBotClientOptions
Defined in: bot/bot.type.ts:2
Options for createDiscordBotClient.
Properties
Section titled “Properties”baseUrl?
Section titled “baseUrl?”
optionalbaseUrl?:string
Defined in: bot/bot.type.ts:9
Override base URL for testing. Defaults to https://discord.com/api/v10. The bot token is sent to whatever host this names, so never derive it from untrusted input.
botToken
Section titled “botToken”botToken:
string
Defined in: bot/bot.type.ts:4
Bot token from the Discord developer portal (Bot → Reset Token).
fetch?
Section titled “fetch?”
optionalfetch?: (input,init?) =>Promise<Response>
Defined in: bot/bot.type.ts:11
Override fetch for testing. Defaults to globalThis.fetch.
Parameters
Section titled “Parameters”string | URL | Request
RequestInit
Returns
Section titled “Returns”Promise<Response>
maxRetries?
Section titled “maxRetries?”
optionalmaxRetries?:number
Defined in: bot/bot.type.ts:18
Retries after a 429 (rate limit) before giving up. Defaults to 3.
Each retry waits for the Retry-After Discord sends; a wait longer than 10 seconds fails immediately.
sleep?
Section titled “sleep?”
optionalsleep?: (ms) =>Promise<void>
Defined in: bot/bot.type.ts:20
Wait between rate-limit retries; a test seam. Defaults to setTimeout.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”Promise<void>
timeoutMs?
Section titled “timeoutMs?”
optionaltimeoutMs?:number
Defined in: bot/bot.type.ts:13
Per-request deadline in milliseconds. Defaults to 15000.