| Resource | What it covers |
|---|---|
of.messages | Direct + mass messaging: list, send, delete, markRead, search, per-message reactions (like, unlike, pin, unpin, hide), templates, mass-message queue lifecycle (queueCreate, queueUpdate, queueCancel, queueSize, queueBuyers, queueChart), reply-on-subscribe template. |
of.chats | Chat list, retrieve, mark-read / mark-unread (single + batch), priority counts, mediaGallery, searchMessages, retrieveMessage, delete chat, unpin all. |
of.notifications | List, count, mark-all-read, transports, per-category settings. |
Recipes
const chats = await of.chats.list({ limit: 20, order: "recent" });
const first = chats.list[0];
const msgs = await of.messages.list(first.withUser.id, { limit: 30 });
await of.messages.send(first.withUser.id, {
text: "Hi!",
// mediaFiles: [...], price: 0, lockedText: false // for paid messages
});