Skip to main content
Use platform narrowing when you need Telegram-specific actions.

Starting a conversation

Resolve a user by their Telegram user ID and open a space. You can also pass a chatId parameter to target a specific Telegram chat:
const tg = telegram(app);
const user = await tg.user("123456789");
const space = await tg.space.create(user);

await space.send("Hello from Spectrum.");

Supported features

FeatureSupport
Text messagesSend and receive
MarkdownSend, rendered as Telegram HTML via parse_mode
Streaming text / markdownSend, with native draft preview in private chats
Media, photos, documents, audio, and videoSend and receive
ReactionsSend and receive
Threaded repliesSend and receive
Typing indicatorsSend
Message editsSend and receive, including text and markdown
Custom Bot API callsVia platform-specific actions