ChatClient
TheChatClient provides methods for interacting with X Chat (direct messages), including sending messages, managing conversations, and handling media.
send_message
Sends an encrypted message to a specific Chat conversation.The Chat conversation ID.
Request body containing the message content.
Response data confirming the message was sent.
get_conversation
Retrieves messages and key change events for a specific Chat conversation with pagination support.The Chat conversation ID.
Maximum number of message events to return.
Token for pagination to retrieve the next page of results.
A comma separated list of ChatMessageEvent fields to display.
Iterator that yields pages of conversation messages. Automatically handles pagination.
send_typing_indicator
Sends a typing indicator to a specific Chat conversation on behalf of the authenticated user.The Chat conversation ID.
Response confirming the typing indicator was sent.
media_download
Downloads encrypted media bytes from an XChat conversation.The Chat conversation ID.
The media hash key returned from the upload initialize step.
Response containing raw binary bytes with content type application/octet-stream.