Skip to content

weixin-ts / bot/src / WeixinBotOptions

Interface: WeixinBotOptions

Defined in: bot/src/types.ts:259

Configuration options for the WeixinBot client

Properties

apiTimeoutMs?

optional apiTimeoutMs?: number

Defined in: bot/src/types.ts:273

Regular API timeout in ms

Default

ts
15000

appId?

optional appId?: string

Defined in: bot/src/types.ts:267

iLink App ID


baseUrl?

optional baseUrl?: string

Defined in: bot/src/types.ts:263

API base URL

Default

ts
'https://ilinkai.weixin.qq.com'

cdnBaseUrl?

optional cdnBaseUrl?: string

Defined in: bot/src/types.ts:265

CDN base URL

Default

ts
'https://novac2c.cdn.weixin.qq.com/c2c'

longPollTimeoutMs?

optional longPollTimeoutMs?: number

Defined in: bot/src/types.ts:271

Long-poll timeout in ms

Default

ts
35000

session?

optional session?: string

Defined in: bot/src/types.ts:285

Session file path for token persistence. When set, token is automatically saved after login and loaded on next start. Avoids repeated QR scanning across restarts. The file is automatically deleted when the server reports the session is expired.

Example

ts
const bot = new WeixinBot({ session: '.weixin-bot.session.json' })

token?

optional token?: string

Defined in: bot/src/types.ts:261

Bot authentication token (can be obtained via login())


version?

optional version?: string

Defined in: bot/src/types.ts:269

Client version string (e.g. '1.0.0')

Released under the MIT License.