Conversation
The Conversation class represents a conversation between two or more inboxes.
Class: Conversation
Constructor
constructor(client: Client, id: string, data?: SafeConversation): Initializes a new conversation instance.
Properties
id: string: The unique identifier for this conversation.isActive: boolean | undefined: Indicates whether the conversation is active.addedByInboxId: string | undefined: The inbox ID that added the conversation.createdAtNs: bigint | undefined: Timestamp when the conversation was created (in nanoseconds).createdAt: Date | undefined: The creation date of the conversationmetadata: SafeConversation["metadata"] | undefined: Optional metadata associated with the conversation.
Instance Methods
async members(): Promise<SafeGroupMember[]>: Gets the conversation members.async sync(): Promise<SafeConversation>: Synchronizes conversation data from the network.async publishMessages(): Promise<void>: Publishes pending messages that were sent optimistically.async sendOptimistic(content: unknown, contentType?: ContentTypeId): Promise<string>: Prepares a message to be published.async send(content: unknown, contentType?: ContentTypeId): Promise<string>: Publishes a new message.async messages(options?: SafeListMessagesOptions): Promise<DecodedMessage[]>: Lists messages in this conversation.async consentState(): Promise<ConsentState>: Gets the consent state for this conversation.async updateConsentState(state: ConsentState): Promise<void>: Updates the consent state for this conversation.async messageDisappearingSettings(): Promise<SafeMessageDisappearingSettings | undefined>: Gets the message disappearing settings for this conversation.async updateMessageDisappearingSettings(fromNs: bigint, inNs: bigint): Promise<void>: Updates message disappearing settings for this conversation.async removeMessageDisappearingSettings(): Promise<void>: Removes message disappearing settings from this conversation.async isMessageDisappearingEnabled(): Promise<boolean>: Checks if message disappearing is enabled for this conversation.async stream(callback?: StreamCallback<DecodedMessage>): Promise<AsyncStream<DecodedMessage>>: Creates a stream for new messages in this conversation.async pausedForVersion(): Promise<string | undefined>: Returns the version that the conversation is paused for, if any.async getHmacKeys(): Promise<SafeHmacKey[]>: Retrieves HMAC keys for this conversation.async debugInfo(): Promise<ConversationDebugInfo>: Retrieves information for this conversation to help with debugging.
Last updated