ConversationContext
Defined in: sdks/agent/src/core/ConversationContext.ts:17
Context for a conversation event and its client.
Extends
Section titled “Extends”ClientContext<ContentTypes>
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”ContentTypes
Section titled “ContentTypes”ContentTypes = unknown
ConversationType
Section titled “ConversationType”ConversationType extends Conversation = Conversation
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConversationContext<
ContentTypes,ConversationType>(__namedParameters):ConversationContext<ContentTypes,ConversationType>
Defined in: sdks/agent/src/core/ConversationContext.ts:24
Create a context for a conversation.
Parameters
Section titled “Parameters”__namedParameters
Section titled “__namedParameters”client
Section titled “client”The client that owns the conversation.
conversation
Section titled “conversation”ConversationType
The conversation that emitted the event.
Returns
Section titled “Returns”ConversationContext<ContentTypes, ConversationType>
Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”client
Section titled “client”Get Signature
Section titled “Get Signature”get client():
Client
Defined in: sdks/agent/src/core/ClientContext.ts:23
Return the wrapped XMTP client.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”conversation
Section titled “conversation”Get Signature
Section titled “Get Signature”get conversation():
ConversationType
Defined in: sdks/agent/src/core/ConversationContext.ts:61
Return the conversation that triggered this context.
Returns
Section titled “Returns”ConversationType
Methods
Section titled “Methods”consentState()
Section titled “consentState()”consentState():
Promise<ConsentState>
Defined in: sdks/agent/src/core/ConversationContext.ts:66
Return the conversation consent state.
Returns
Section titled “Returns”Promise<ConsentState>
getClientAddress()
Section titled “getClientAddress()”getClientAddress():
string
Defined in: sdks/agent/src/core/ClientContext.ts:18
Return the account identifier used by the client, when available.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”ClientContext.getClientAddress
isAllowed()
Section titled “isAllowed()”isAllowed():
Promise<boolean>
Defined in: sdks/agent/src/core/ConversationContext.ts:72
Whether the conversation consent state is allowed.
Returns
Section titled “Returns”Promise<boolean>
isDenied()
Section titled “isDenied()”isDenied():
Promise<boolean>
Defined in: sdks/agent/src/core/ConversationContext.ts:77
Whether the conversation consent state is denied.
Returns
Section titled “Returns”Promise<boolean>
isDm()
Section titled “isDm()”isDm():
this is ConversationContext<ContentTypes, Dm>
Defined in: sdks/agent/src/core/ConversationContext.ts:38
Narrow this context to a direct-message conversation.
Returns
Section titled “Returns”this is ConversationContext<ContentTypes, Dm>
isGroup()
Section titled “isGroup()”isGroup():
this is ConversationContext<ContentTypes, Group>
Defined in: sdks/agent/src/core/ConversationContext.ts:43
Narrow this context to a group conversation.
Returns
Section titled “Returns”this is ConversationContext<ContentTypes, Group>
isUnknown()
Section titled “isUnknown()”isUnknown():
Promise<boolean>
Defined in: sdks/agent/src/core/ConversationContext.ts:82
Whether the conversation consent state is unknown.
Returns
Section titled “Returns”Promise<boolean>
sendRemoteAttachment()
Section titled “sendRemoteAttachment()”sendRemoteAttachment(
unencryptedFile,uploadCallback?):Promise<void>
Defined in: sdks/agent/src/core/ConversationContext.ts:48
Encrypt and send a remote attachment through the supplied upload callback.
Parameters
Section titled “Parameters”unencryptedFile
Section titled “unencryptedFile”File
uploadCallback?
Section titled “uploadCallback?”Returns
Section titled “Returns”Promise<void>