Chat Module
Convenience methods for Bluesky direct message (DM) and chat operations.
Wraps the chat.bsky.convo.* XRPC endpoints with a simplified API.
All methods require an authenticated AtpAgent.
The chat proxy header (atproto-proxy: did:web:api.bsky.chat#bsky_chat) is applied
automatically -- callers do not need to use withChatProxy manually.
Functions and values
| Function or value |
Description
|
|
|
|
|
Full Usage:
addReaction agent convoId messageId emoji
Parameters:
AtpAgent
-
An authenticated AtpAgent.
convoId : ^a
-
A ConvoSummary or string conversation ID.
messageId : string
-
The ID of the message to react to.
emoji : string
-
The emoji reaction value (e.g., a Unicode emoji string).
Returns: Task<Result<unit, XrpcError>>
Ok () on success, or an XrpcError.
Modifiers: inline Type parameters: ^a |
Add an emoji reaction to a message in a conversation.
|
|
|
Full Usage:
deleteMessage agent convoId messageId
Parameters:
AtpAgent
-
An authenticated AtpAgent.
convoId : ^a
-
A ConvoSummary or string conversation ID.
messageId : string
-
The ID of the message to delete.
Returns: Task<Result<unit, XrpcError>>
Ok () on success, or an XrpcError.
Modifiers: inline Type parameters: ^a |
Delete a message from a conversation for the authenticated user only. The message remains visible to other participants.
|
|
|
Full Usage:
getConvo agent convoId
Parameters:
AtpAgent
-
An authenticated AtpAgent.
convoId : ^a
-
A ConvoSummary or string conversation ID.
Returns: Task<Result<ConvoSummary, XrpcError>>
A ConvoSummary on success, or an XrpcError.
Modifiers: inline Type parameters: ^a |
Get a single conversation by its ID.
|
Full Usage:
getConvoForMembers agent members
Parameters:
AtpAgent
-
An authenticated AtpAgent.
members : Did list
-
A list of DIDs of the conversation members (excluding the authenticated user, who is added automatically).
Returns: Task<Result<ConvoSummary, XrpcError>>
A ConvoSummary, or an XrpcError.
|
Get an existing conversation with the specified members, or create a new one if none exists.
|
Full Usage:
getConvoImpl agent convoId
Parameters:
AtpAgent
convoId : string
Returns: Task<Result<ConvoSummary, XrpcError>>
|
|
Full Usage:
getMessages agent convoId limit cursor
Parameters:
AtpAgent
-
An authenticated AtpAgent.
convoId : ^a
-
A ConvoSummary or string conversation ID.
limit : int64 option
-
Maximum number of messages to return. Pass None for the server default.
cursor : string option
-
Pagination cursor from a previous response. Pass None for the most recent messages.
Returns: Task<Result<Page<ChatMessage>, XrpcError>>
A page of ChatMessage with an optional cursor, or an XrpcError.
Modifiers: inline Type parameters: ^a |
Get messages in a conversation, ordered by most recent first.
|
|
|
|
|
|
|
Full Usage:
listConvos agent limit cursor
Parameters:
AtpAgent
-
An authenticated AtpAgent.
limit : int64 option
-
Maximum number of conversations to return. Pass None for the server default.
cursor : string option
-
Pagination cursor from a previous response. Pass None for the first page.
Returns: Task<Result<Page<ConvoSummary>, XrpcError>>
A page of ConvoSummary with an optional cursor, or an XrpcError.
|
List the authenticated user's conversations, ordered by most recent activity.
|
|
|
|
|
|
|
|
|
Full Usage:
removeReaction agent convoId messageId emoji
Parameters:
AtpAgent
-
An authenticated AtpAgent.
convoId : ^a
-
A ConvoSummary or string conversation ID.
messageId : string
-
The ID of the message to remove the reaction from.
emoji : string
-
The emoji reaction value to remove.
Returns: Task<Result<unit, XrpcError>>
Ok () on success, or an XrpcError.
Modifiers: inline Type parameters: ^a |
Remove an emoji reaction from a message in a conversation.
|
|
|
Full Usage:
sendMessage agent convoId text
Parameters:
AtpAgent
-
An authenticated AtpAgent.
convoId : ^a
-
A ConvoSummary or string conversation ID.
text : string
-
The message text content. Links, mentions, and hashtags are auto-detected.
Returns: Task<Result<ChatMessage, XrpcError>>
The sent message as a ChatMessage, or an XrpcError.
Modifiers: inline Type parameters: ^a |
Send a message to a conversation. Rich text (links, mentions, hashtags) is
automatically detected and resolved, matching the behaviour of
|
Full Usage:
sendMessageImpl agent convoId text
Parameters:
AtpAgent
convoId : string
text : string
Returns: Task<Result<ChatMessage, XrpcError>>
|
|
|
|
|