Skip to main content
Defined in: testing/transcripts/record.ts:92 Transparent IProvider wrapper that records a transcript.

Type Parameters

Implements

Constructors

Constructor

Defined in: testing/transcripts/record.ts:119

Parameters

Returns

RecordingProvider<P>

Properties

id

Defined in: testing/transcripts/record.ts:93 Stable transport tag (e.g. ‘baileys’, ‘telegram’) — used to namespace conversation keys if one Bot ever runs multiple providers concurrently.

Implementation of

IProvider.id

capabilities

Defined in: testing/transcripts/record.ts:94

Implementation of

IProvider.capabilities

inner

Defined in: testing/transcripts/record.ts:95

ingest?

Defined in: testing/transcripts/record.ts:97 Push ingress for webhook transports (Cloud API POST, Telegram/Discord webhook, Discord interaction endpoint). The host HTTP server calls this with the raw body (and, optionally, the request headers for signature checks); the provider normalizes and emits via onEvent. May return a value the host can use as the HTTP status (e.g. 200 accepted / 403 bad signature). Socket-first providers (Baileys, Discord gateway) omit it.

Parameters

Returns

unknown

Implementation of

IProvider.ingest

downloadMedia?

Defined in: testing/transcripts/record.ts:98 Lazy media retrieval behind one signature for every download model.

Parameters

Returns

Promise<Buffer<ArrayBufferLike> | ReadableStream>

Implementation of

IProvider.downloadMedia

serializeMediaRef?

Defined in: testing/transcripts/record.ts:99 Durable journaling (BotConfig.durability): turn a live MediaRef into a JSON-safe, versioned reference that rehydrateMediaRef can rebuild in another process, so a replayed message (crash recovery, background retry) can still download its media. Synchronous, cheap and side-effect free; a throw counts as “not durable”. Return undefined for a ref that must not be journaled (e.g. view-once media). Never include credentials: the result is stored at rest with the inbound record.

Parameters

Returns

| SerializedMediaRef | undefined

Implementation of

IProvider.serializeMediaRef

rehydrateMediaRef?

Defined in: testing/transcripts/record.ts:100 Rebuild the MediaRef of a replayed message from what serializeMediaRef wrote. ref is the journaled ref without its token. Pure decoding: it must not need the transport to be connected. stored comes from storage and is UNTRUSTED: reject an invalid, unknown-version or tampered value with a ProviderError.

Parameters

Returns

| MediaRef | Promise<MediaRef>

Implementation of

IProvider.rehydrateMediaRef

getMessage?

Defined in: testing/transcripts/record.ts:101 Read-back seam for poll aggregation, quote-body resolution, retry decrypt. Providers that don’t need it no-op / omit it. Replaces the constructor- injected getMessage callback baked into BaileysProvider today.

Parameters

Returns

Promise< | InboundMessage<unknown> | undefined>

Implementation of

IProvider.getMessage

markRead?

Defined in: testing/transcripts/record.ts:102

Parameters

Returns

Promise<void>

Implementation of

IProvider.markRead

typing?

Defined in: testing/transcripts/record.ts:103

Parameters

Returns

Promise<void>

Implementation of

IProvider.typing

deleteMessage?

Defined in: testing/transcripts/record.ts:104

Parameters

Returns

Promise<void>

Implementation of

IProvider.deleteMessage

editMessage?

Defined in: testing/transcripts/record.ts:105

Parameters

Returns

Promise<SendResult<unknown>>

Implementation of

IProvider.editMessage

acknowledgeInteraction?

Defined in: testing/transcripts/record.ts:106

Parameters

Returns

Promise<void>

Implementation of

IProvider.acknowledgeInteraction

maxTurns

Defined in: testing/transcripts/record.ts:110 Max turns kept in memory (oldest dropped first).

Methods

start()

Defined in: testing/transcripts/record.ts:150

Returns

Promise<void>

Implementation of

IProvider.start

stop()

Defined in: testing/transcripts/record.ts:151

Returns

Promise<void>

Implementation of

IProvider.stop

onEvent()

Defined in: testing/transcripts/record.ts:153 Subscribe to the normalized event stream. Returns an unsubscriber.

Parameters

Returns

() => void

Implementation of

IProvider.onEvent

send()

Defined in: testing/transcripts/record.ts:158 Send normalized content. Rejects with a typed error (section 8) on failure.

Parameters

Returns

Promise<SendResult<unknown>>

Implementation of

IProvider.send

Accessors

selfId

Get Signature

Defined in: testing/transcripts/record.ts:147 The bot’s own user id once connected (for group mention matching). Optional.
Returns
string | null The bot’s own user id once connected (for group mention matching). Optional.

Implementation of

IProvider.selfId

connection

Get Signature

Defined in: testing/transcripts/record.ts:148 A single primary connection handle for DEBUGGING ONLY. Not a structural guarantee of exactly one connection (Discord may hold many shard sockets). Core must NOT reach through this for behavior.
Returns
unknown A single primary connection handle for DEBUGGING ONLY. Not a structural guarantee of exactly one connection (Discord may hold many shard sockets). Core must NOT reach through this for behavior.

Implementation of

IProvider.connection