Pillar 2 of 3
Direct messages and comments arrive on a single message resource with one shape, and replies go back out through the same call.
Live on TelegramCoverage today
The inbox is live on Telegram — channels, groups and direct chats — and read-only everywhere else. Support for the remaining networks is in build behind the same resource, so adding them will not change the shape of your code.The model
One resource, two kinds of thread. A direct message and a comment thread are the same object withkind set to dm or comment, because an integration triaging “what came in and what has nobody answered” wants one list rather than two.
One conversation shape
A Telegram group and a direct chat carry the same participant, unread count and last message. Only
kind and network differ.Replies go back the same way
One call answers either. A comment thread gets a public reply; a direct message gets a private one — Nylon picks the right API from the thread.
Unread is a queue, not a view
Reading a thread does not clear it. Marking read is its own call, so two agents on one inbox do not clear each other’s work.
Told, not polled
The inbox webhook events fire as things happen — arrived, sent, delivered, read, edited, unsent, reacted to — so nothing has to sit in a loop asking. Everything they report is stored regardless: the webhook is a notification about the inbox, not the inbox itself.
Endpoints
Pagination
The inbox is cursor-paged, unlike the rest of the API. An inbox reorders while you read it — every arriving message moves a thread to the top — so an offset would show you the same conversation on page one and page two while something else slipped through the gap. Passmeta.pagination.next_cursor back as cursor.
Replying
Message kinds
kind and network are part of the shape rather than of Telegram, so a
comment thread on a network added later needs no change at the call site. A
Telegram chat — whether a private message, a group or a channel — is one
conversation, because a chat is the place you answer.
Connecting
Telegram has no consent screen, because a bot only learns a chat exists once somebody speaks to it. Connecting is two steps, both in Telegram:- Add Nylon’s bot to the channel, group or chat, as an admin so it can post.
- Send
/connect <code>in that chat. The code comes from Connections → Telegram in Nylon and lasts 15 minutes.
Every Nylon connection posts as the same bot, so there is no token to store,
rotate or reconnect. Replies are sent as the bot, not as a person.