|
|
@@ -34,6 +34,18 @@ Resolves the room by ID or case-insensitively by name, then posts. A name shared
|
|
|
|
|
|
**Mentions instead of DMs:** to notify a user inside a channel, mention them in the message TEXT (`@login, hier ist …`) — Chatto renders room-text mentions. A bot cannot deliver a personal notification any other way (see the DM limitation below).
|
|
|
|
|
|
+### chatto_get_message(room_id|room_name, event_id|event_ids, follow_reply_chain?) — read messages by ID
|
|
|
+
|
|
|
+Resolves the room (same `_resolve_room` as the send tools) and fetches the message(s) via `client.batch_get_messages` / `get_message`. Returns every field: body, author_user_id + author_login (hydrated via `batch_get_room_members`, best-effort — an unreadable directory costs the names, not the messages), created/updated/deleted timestamps, `in_reply_to`, `thread_root_event_id`, attachments, reactions, pinned, link preview, thread summary. Use it whenever a `reply_to=` / `in_reply_to` reference or any event ID appears in a message or session metadata.
|
|
|
+
|
|
|
+- `follow_reply_chain` (0-10): walks the `in_reply_to` chain backwards (one RPC per hop) and returns the ancestors oldest-first in `reply_chain`.
|
|
|
+- `event_ids[]`: batch fetch; unknown IDs come back in `missing_event_ids` instead of failing the whole call. A single unknown `event_id` refuses cleanly.
|
|
|
+- **Not gated on the mention lists**: reading posts nothing and answers nothing, so any room the server lets the bot see is readable — the server's visibility rules are the only gate.
|
|
|
+
|
|
|
+### chatto_get_history(room_id|room_name, thread_root_event_id?, limit?) — read recent context
|
|
|
+
|
|
|
+Reads the newest messages of a room (`client.get_room_events`) or of one thread (`client.get_thread_events`), returned oldest-first (sorted by the timestamps each message carries, not the server's ordering). `limit` 1-100 (default 20), `has_older` in the result says whether more history exists. Author logins come from the timeline page's own `users_by_id` directory first; actors missing there are hydrated via `batch_get_room_members`. Same room resolution and the same thread-root rule as `chatto_send_room` (a reply inside a thread is refused as a root). Not gated on the mention lists either — the server's own visibility rules decide what the bot may read.
|
|
|
+
|
|
|
### chatto_send_dm(user_login|user_id, message) — DM a user
|
|
|
|
|
|
Looks up the user by login or ID and posts into the DM room.
|