Skip to content

ConversationContext

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:16

Context for a conversation event and its client.

ContentTypes = unknown

ConversationType extends Conversation = Conversation

new ConversationContext<ContentTypes, ConversationType>(__namedParameters): ConversationContext<ContentTypes, ConversationType>

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:23

Create a context for a conversation.

Client<ContentTypes>

The client that owns the conversation.

ConversationType

The conversation that emitted the event.

ConversationContext<ContentTypes, ConversationType>

ClientContext.constructor

get client(): Client<ContentTypes>

Defined in: sdks/js/agent-sdk/src/core/ClientContext.ts:23

Return the wrapped XMTP client.

Client<ContentTypes>

ClientContext.client


get conversation(): ConversationType

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:59

Return the conversation that triggered this context.

ConversationType


get isAllowed(): boolean

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:64

Whether the conversation consent state is allowed.

boolean


get isDenied(): boolean

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:69

Whether the conversation consent state is denied.

boolean


get isUnknown(): boolean

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:74

Whether the conversation consent state is unknown.

boolean

getClientAddress(): string | undefined

Defined in: sdks/js/agent-sdk/src/core/ClientContext.ts:18

Return the account identifier used by the client, when available.

string | undefined

ClientContext.getClientAddress


isDm(): this is ConversationContext<ContentTypes, Dm<ContentTypes>>

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:37

Narrow this context to a direct-message conversation.

this is ConversationContext<ContentTypes, Dm<ContentTypes>>


isGroup(): this is ConversationContext<ContentTypes, Group<ContentTypes>>

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:42

Narrow this context to a group conversation.

this is ConversationContext<ContentTypes, Group<ContentTypes>>


sendRemoteAttachment(unencryptedFile, uploadCallback): Promise<void>

Defined in: sdks/js/agent-sdk/src/core/ConversationContext.ts:47

Encrypt and send a remote attachment through the supplied upload callback.

File

AttachmentUploadCallback

Promise<void>