Repository navigation
Telegram channel: a thread sends you a result when you ask, and you answer from the chat #16536
Replies: 1 comment
|
This is close to something I want, so I'd like to build on it rather than open a competing proposal. I agree with what you left out: no automatic messages and no mirroring. My use case is one step further. I want to message a bot normally, not reply to something it sent, and have that land in one long-lived home thread. The home thread runs a model I chose and has the orchestrator MCP tools, so it can start and steer other threads ( That needs a small addition to your design, and it raises a question about shape: should this be Telegram-specific, or the first driver behind a small channel abstraction? Suggestion: drivers and instances, like providersT3 already separates
Every driver connects outbound, so nothing has to be reachable from outside, which keeps your long-polling property: Telegram The driver contract stays small. Platform details stay in the driver, and the core only sees normalized messages: interface ChannelDriver {
kind: ChannelDriverKind
capabilities: { threads: boolean; files: boolean; maxTextLength: number }
probe(config, secret): Effect<{ botName: string }>
connect(config, secret): Stream<InboundMessage>
send(target: ConversationRef, message: OutboundMessage): Effect<MessageRef>
createThread?(parent: ConversationRef, title: string): Effect<ConversationRef>
}Everything else is shared and written once:
On platforms with threads (Discord, Slack, Telegram topics), a T3 thread started from the home thread can get its own platform thread. Each piece of work then has its own place in the chat. ScopeTo keep this small, the first PR would add only the Telegram driver behind the contract: essentially your implementation, reshaped, plus the instance list and the home-thread setting. Discord would come later as the second driver. It would test whether the abstraction holds, and I'd rather find that out than design for it ahead of time. Still out of scope: automatic notifications, voice, and answering from groups. Questions
|
Uh oh!
There was an error while loading. Please reload this page.
This is not a notification system. I have read "notifications are an anti-pattern" and I am not asking to be pinged when something happens. Nothing here fires on its own. The agent sends something only when you tell it to ("send me the report on Telegram when you finish"), and what arrives is the result itself, a file or a message you can act on, not an alert that pulls you back into the app.
Why
At work we use Telegram for everything. When an agent produces something worth showing, a PDF, a chart, a short video, I open T3 Code, find the file and forward it by hand. And when someone answers "ok, now change X", I go back to the app to type it. The chat is already where the conversation is.
What I have working on my fork
It is built, tested, and running on my machine. Set up once in Settings → Integrations → Telegram with your own bot from BotFather:
Send. One MCP tool,
telegram_send: text, or a file that already exists. Images and MP4 show inline, anything else arrives as a document.Answer. Reply to any message the bot sent and your text becomes a new turn in the thread that sent it, even if that thread was idle.
Pick a thread.
/threadslists the open threads, one message each. Reply to the one you want.Groups can receive. Add the bot to a group, add the id it posts to Settings, and ask for it by name: "send it to the team group". This part is written and covered by tests; I have not tried it against a real group yet.
95-second recording. The settings step is stills from a test build; the rest is a real-time screen recording:
t3-telegram-demo-small.mp4
What I left out on purpose
How far this could go
Not part of this proposal, only where the same shape leads:
How it fits the codebase
One server service (long polling, so nothing has to be reachable from outside), one MCP toolkit, one settings section, one small table in the existing SQLite. The bot token lives in the secret store, like the Bitbucket tokens. A thread sends files from its own workspace; only a full-access thread can send a file from elsewhere on the machine. Mobile needs no new screen. Focused tests and a user guide are written.
What I would like to know
Related: #7046 (completion notifications) and #6933 (outbound completion webhook) are about being told that something happened. This is about getting the result where the conversation already is.
All reactions