# 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 conversation
* `metadata: 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cryptalks-organization-1.gitbook.io/cryptalk-sdk/conversation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
