Telegram Post Editor — Mini App
Compose richly formatted Telegram posts inside Telegram itself. Format-perfect preview, drafts that sync to your Telegram CloudStorage, and a one-tap share flow that keeps every entity — bold, italic, links, blockquotes — intact.
The Mini App is the lightweight companion to the Telegram Post Editor desktop app — same formatting engine, same preview, but accessible from any device that runs Telegram.
How to Open
The Mini App lives inside @tgpe_editor_bot — open the bot in Telegram and send /app to launch it. Works on iOS, Android, Telegram Desktop, and Telegram Web.
After tapping Start, send /app to launch the
Mini App.
Two ways to launch
- Open the bot — tap @tgpe_editor_bot, press Start, then send
/app - Bot menu commands —
/start(welcome),/help(full feature list),/app(launcher)
Tap /start before your first upload
Telegram requires the bot to have an open chat with you before it can store uploaded media on your behalf. If you skip /start, your first photo or audio upload will fail with "Tap Start in @tgpe_editor_bot first, then try again." Open the bot's chat, tap Start, and retry.
First Launch
When the Mini App opens you'll see a welcome screen with your Telegram first name, a one-line tagline, and a "Get Telegram Post Editor for desktop" link in the top-right.
Theme & language — automatic
- Theme — pulled from
Telegram.WebApp.themeParamsand mirrored onto CSS variables. Switch Telegram's theme and the Mini App updates instantly. - Language — auto-detected from your Telegram
language_code. Russian forru*, English otherwise. Currently English and Russian are supported. - Safe-area insets — the layout respects iOS notch / Dynamic Island.
Layout
| Viewport | Layout |
|---|---|
| Narrow (< 768px) | Two tabs: Edit / Preview. Editor state is preserved when switching. |
| Wide (≥ 768px) | Side-by-side: editor on the left (60%), preview on the right (40%). |
Formatting
The toolbar covers the formatting types Telegram actually renders.
| Button | Action | Shortcut |
|---|---|---|
| B | Bold | Cmd/Ctrl + B |
| I | Italic | Cmd/Ctrl + I |
| U | Underline | Cmd/Ctrl + U |
| S | Strikethrough | — |
| Link | Insert / toggle link | Cmd/Ctrl + K |
| Photo | Pick photo or video | (file picker) |
| Audio | Pick an audio file | (file picker) |
| ⋯ More | Lists, blockquote, code block, remove link, clear formatting | — |
Supported nodes: bold, italic, underline, strikethrough, link, paragraph, heading, ordered & unordered lists, blockquote, code block.
Differences from desktop: no in-toolbar gallery (separate Photo/Audio buttons), no channel management, simpler link dialog, no spoiler or emoji-picker UI yet.
Keyboard shortcuts
| Shortcut | Action |
|---|---|
| Cmd/Ctrl + B | Bold |
| Cmd/Ctrl + I | Italic |
| Cmd/Ctrl + U | Underline |
| Cmd/Ctrl + K | Link dialog |
| Enter | New line |
| Escape | Close modals / cancel rename |
| Tab | Move focus |
| Space | Activate focused button |
Media
Tap Photo or Audio to open the native picker.
Limits
| Kind | Formats | Max size |
|---|---|---|
| Photo | JPEG, PNG, WebP, GIF | 10 MB |
| Video | MP4, MOV, WebM | 50 MB |
| Audio | MP3, M4A, AAC | 50 MB |
Currently one media item per post. Picking again replaces the previous one. Albums are on the roadmap.
Upload flow
- Pick a file — a local 256-px thumbnail appears immediately
- The Mini App uploads to the bot in the background; the slot shows a spinner
- The bot returns a
file_idand a server-rendered thumb - The slot shows the final preview; the main button switches to Share to Telegram
- Transient failures auto-retry up to three times with exponential backoff (500 ms → 1 s → 2 s + jitter)
Platform quirks
| Platform | Picker | Note |
|---|---|---|
| iOS | Document picker (Photos / Files / iCloud) | blob: URLs are reliable |
| Android | Native file picker | blob: URLs are unreliable in the WebView — the Mini App uses data: URLs and falls back to the server thumb when createImageBitmap fails |
| Telegram Desktop | Native OS dialog | Inherits desktop theme |
| Telegram Web | HTML5 file input | localStorage / IndexedDB only — no CloudStorage sync |
Preview & Length Limits
The preview renders a Telegram-styled bubble of your formatted text plus media (if attached) and an optional link preview card.
Length thresholds
| Mode | Max characters |
|---|---|
| Text only | 4096 |
| With media (caption) | 1024 |
The character counter updates with a 120 ms debounce (Android-friendly). It changes color at the 80%, 95%, and 100% thresholds — blue → yellow → red, and bold red over the limit. Caption mode auto-switches when you attach or remove media.
Sharing
The big button at the bottom is the share trigger. It enables when the post has at least one character or attached media, and disables while uploading or while the post is over its limit.
Modern Telegram (Bot API ≥ 8.0)
- Tap Share to Telegram
- The Mini App waits for any in-flight upload, then asks the backend to prepare an inline message
- The backend builds the message and returns a
prepared_message_idvalid for ~5 minutes - The Mini App calls
Telegram.WebApp.shareMessage(prepared_message_id) - Telegram opens its native share sheet — pick a chat or channel
- Telegram delivers the message; the Mini App shows "Posted! Your message is on its way."
Older Telegram (no shareMessage)
The button label becomes "Copy as MarkdownV2". The Mini App serializes your post to Telegram-flavored Markdown, copies it to the clipboard, and shows a toast: "Copied! Paste in any Telegram chat."
The "via @bot" label
The Mini App posts via Telegram's inline-message plumbing, so channel posts show a "via @tgpe_editor_bot" byline. To post as the channel directly without the label, use the desktop app with the bot as a channel admin (Post Messages permission).
Drafts
Auto-save
Every keystroke (debounced) saves to:
localStorage.tgpe:current— local recovery cache- Telegram CloudStorage under your active draft id, when CloudStorage is available
On reload the Mini App restores in this order: CloudStorage active draft → localStorage backup → blank editor.
Drafts screen
Open the folder icon in the header to see your drafts: title, last-modified date, first-line preview. Tap to open, pencil to rename (60 char max — Enter saves, Escape cancels), trash to delete (with confirmation).
Storage limits
| Backend | Limit |
|---|---|
localStorage | ~5–10 MB (browser) — about 50 KB per draft |
| Telegram CloudStorage | 1024 keys per user (Telegram cap) — each draft is one key |
Offline
Drafts work fully offline — edits save locally. Share requires a connection and shows "Couldn't reach our servers." until you're back online.
CloudStorage unavailable
Telegram Web and very old clients don't expose CloudStorage. The Mini App shows a banner — drafts still save locally, but they won't sync across devices.
Channel Posting
Channel management lives in the desktop app. The Mini App relies on Telegram's share sheet, which lets you pick any chat or channel where you can post.
For clean channel posts without the "via @tgpe_editor_bot" label, use the desktop app with the bot added as a channel administrator with the Post Messages permission.
Errors & Empty States
Upload errors
| Error | Message | Action |
|---|---|---|
| Empty file | "File is empty." | Pick another file |
| Too large | "File is too large. Limit is N MB." | Compress and retry |
| Bad MIME | "This file type is not supported." | Use photo / video / audio |
| Bot chat unavailable | "Tap Start in @tgpe_editor_bot first, then try again." | Open the bot, tap Start |
| Network / 5xx | (auto-retry up to 3 times, then "Upload failed") | Wait or retry manually |
Share errors
| Code | Message |
|---|---|
| empty_post | Write something before sharing. |
| too_long | Post is too long. Telegram allows up to 4,096 characters. |
| invalid_state | Something's wrong with this draft. Try copying the text manually. |
| telegram_api | Telegram is having trouble. Please try again. |
| auth_required / auth_invalid | Authentication failed. Please reopen the Mini App. |
| network_error | Couldn't reach our servers. Check your connection. |
| unsupported | Update Telegram to share directly. Or use Copy as MarkdownV2. |
Troubleshooting
| Issue | Fix |
|---|---|
| "Mini App is not running in Telegram" | Open @tgpe_editor_bot inside Telegram and send /app |
| Drafts don't sync between devices | CloudStorage is unavailable in this client (Web / old client). Use the desktop app for cross-device sync. |
| Media upload says "Tap Start in @bot first" | Open a chat with the bot, tap Start, then retry the upload |
| Photos blank on Android | Server-side thumb fallback should kick in. If it doesn't, send a console log to support. |
| "Post is too long" under 4096 | A media item is attached — caption limit is 1024. Remove the media or shorten the caption. |
| Can't find a chat in the share sheet | Type the chat name in the share-sheet search. |
| "via @bot" label on channel posts | Expected for Mini App posts. For unbranded channel posts, use the desktop app with the bot as a channel admin. |
FAQ
Where does the Mini App run?
Inside Telegram on iOS, Android, Telegram Desktop (macOS/Windows/Linux), and Telegram Web. Open @tgpe_editor_bot and send /app to launch it.
Do I need to install anything?
No. The Mini App opens directly inside Telegram. There is also a desktop version for advanced workflows — channel management, MCP integration, and self-hosted server mode.
Why does my channel post show "via @bot"?
The Mini App shares posts using Telegram's inline-message plumbing, which adds a "via @bot" label. To post as the channel directly without the label, use the desktop app with the bot added as a channel administrator.
Do drafts sync across devices?
Yes — drafts save to Telegram CloudStorage and are restored when you open the Mini App on another device. Web and very old clients without CloudStorage fall back to local browser storage.
What's the character limit?
4096 characters for text-only posts. With a photo or video attached, the caption limit is 1024.
Is there a spoiler or emoji picker?
Not yet. Spoiler exists in the editor core but isn't exposed in the Mini App toolbar. There's no built-in emoji picker — use Telegram's native one or paste from the OS.
Can I send albums (multiple photos)?
Not yet — one media item per post. Albums are on the roadmap.
Built with the VibeCoder Heretic methodology — where autonomous AI agents handle the heavy lifting so developers can focus on what matters.