The operations of one platform; Chat has the same ops, routed by
thread.platform.
posttakes standard Markdown that must fitlimits.message_length: it never splits or truncates, and failsTooLargewithout calling the platform. Mentions notify nobody, and no link preview shows unless the adapter's scoped options ask.fetch_messagefailsNotFoundfor a message that is gone.historypages lazily:"backward"runs newest to oldest,"forward"oldest to newest, andfrom_is exclusive. A thread's oldest message is its opener, the one message not addressed to the thread.downloadfailsTooLargeas soon as more thanmax_bytesarrive, and streams.start_threadis get-or-create: the thread undermessage_id.openeris the message a thread hangs off;Nonefor a channel or direct address, or when it was deleted.actionsare a flat list of elements beside the Markdown. Aneditreplaces the whole message, so one withoutactionsremoves them.follow_upsends the answer a command'sDeferpromised. It is never retried, takes no files, and failsNotFoundwith detailinteraction_expiredpastlimits.follow_up_age.
Functions#
post#
post(thread, *, markdown, reply_to=None, files=(), actions=()) -> Effect[Posted, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread | |
markdown | str | |
reply_to | ReplyTo | None = None | |
files | Sequence[File] = () | |
actions | Sequence[Action] = () |
Returns Effect[Posted, ChatError]
def post(
self,
thread: ChatThread,
*,
markdown: str,
reply_to: ReplyTo | None = None,
files: Sequence[File] = (),
actions: Sequence[Action] = (),
) -> Effect[Posted, ChatError]: ...edit#
edit(thread, message_id, *, markdown, actions=()) -> Effect[None, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread | |
message_id | str | |
markdown | str | |
actions | Sequence[Action] = () |
Returns Effect[None, ChatError]
def edit(
self, thread: ChatThread, message_id: str, *, markdown: str, actions: Sequence[Action] = ()
) -> Effect[None, ChatError]: ...delete#
delete(thread, message_id) -> Effect[None, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread | |
message_id | str |
Returns Effect[None, ChatError]
def delete(self, thread: ChatThread, message_id: str) -> Effect[None, ChatError]: ...fetch_message#
fetch_message(thread, message_id) -> Effect[ChatMessage, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread | |
message_id | str |
Returns Effect[ChatMessage, ChatError]
def fetch_message(
self, thread: ChatThread, message_id: str
) -> Effect[ChatMessage, ChatError]: ...history#
history(thread, *, direction, from_=None) -> Stream[ChatMessage, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread | |
direction | Direction | |
from_ | str | None = None |
Returns Stream[ChatMessage, ChatError]
def history(
self, thread: ChatThread, *, direction: Direction, from_: str | None = None
) -> Stream[ChatMessage, ChatError]: ...download#
download(thread, attachment, *, max_bytes) -> Stream[bytes, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread | |
attachment | Attachment | |
max_bytes | int |
Returns Stream[bytes, ChatError]
def download(
self, thread: ChatThread, attachment: Attachment, *, max_bytes: int
) -> Stream[bytes, ChatError]: ...start_thread#
start_thread(thread, message_id, *, name=None) -> Effect[ChatThread, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread | |
message_id | str | |
name | str | None = None |
Returns Effect[ChatThread, ChatError]
def start_thread(
self, thread: ChatThread, message_id: str, *, name: str | None = None
) -> Effect[ChatThread, ChatError]: ...get_thread#
get_thread(thread) -> Effect[ThreadInfo, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread |
Returns Effect[ThreadInfo, ChatError]
def get_thread(self, thread: ChatThread) -> Effect[ThreadInfo, ChatError]: ...opener#
opener(thread) -> Effect[ChatMessage | None, ChatError]| Parameter | Type | Description |
|---|---|---|
thread | ChatThread |
Returns Effect[ChatMessage | None, ChatError]
def opener(self, thread: ChatThread) -> Effect[ChatMessage | None, ChatError]: ...get_user#
get_user(id, *, in_=None) -> Effect[User, ChatError]| Parameter | Type | Description |
|---|---|---|
id | str | |
in_ | ChatThread | None = None |
Returns Effect[User, ChatError]
def get_user(self, id: str, *, in_: ChatThread | None = None) -> Effect[User, ChatError]: ...follow_up#
follow_up(deferred, *, markdown, actions=()) -> Effect[None, ChatError]| Parameter | Type | Description |
|---|---|---|
deferred | Defer | |
markdown | str | |
actions | Sequence[Action] = () |
Returns Effect[None, ChatError]
def follow_up(
self, deferred: Defer, *, markdown: str, actions: Sequence[Action] = ()
) -> Effect[None, ChatError]: ...