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

  1. Open the bot — tap @tgpe_editor_bot, press Start, then send /app
  2. 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.themeParams and mirrored onto CSS variables. Switch Telegram's theme and the Mini App updates instantly.
  • Language — auto-detected from your Telegram language_code. Russian for ru*, English otherwise. Currently English and Russian are supported.
  • Safe-area insets — the layout respects iOS notch / Dynamic Island.

Layout

ViewportLayout
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.

ButtonActionShortcut
BBoldCmd/Ctrl + B
IItalicCmd/Ctrl + I
UUnderlineCmd/Ctrl + U
SStrikethrough
LinkInsert / toggle linkCmd/Ctrl + K
PhotoPick photo or video(file picker)
AudioPick an audio file(file picker)
⋯ MoreLists, 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

ShortcutAction
Cmd/Ctrl + BBold
Cmd/Ctrl + IItalic
Cmd/Ctrl + UUnderline
Cmd/Ctrl + KLink dialog
EnterNew line
EscapeClose modals / cancel rename
TabMove focus
SpaceActivate focused button

Media

Tap Photo or Audio to open the native picker.

Limits

KindFormatsMax size
PhotoJPEG, PNG, WebP, GIF10 MB
VideoMP4, MOV, WebM50 MB
AudioMP3, M4A, AAC50 MB

Currently one media item per post. Picking again replaces the previous one. Albums are on the roadmap.

Upload flow

  1. Pick a file — a local 256-px thumbnail appears immediately
  2. The Mini App uploads to the bot in the background; the slot shows a spinner
  3. The bot returns a file_id and a server-rendered thumb
  4. The slot shows the final preview; the main button switches to Share to Telegram
  5. Transient failures auto-retry up to three times with exponential backoff (500 ms → 1 s → 2 s + jitter)

Platform quirks

PlatformPickerNote
iOSDocument picker (Photos / Files / iCloud)blob: URLs are reliable
AndroidNative file pickerblob: URLs are unreliable in the WebView — the Mini App uses data: URLs and falls back to the server thumb when createImageBitmap fails
Telegram DesktopNative OS dialogInherits desktop theme
Telegram WebHTML5 file inputlocalStorage / 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

ModeMax characters
Text only4096
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)

  1. Tap Share to Telegram
  2. The Mini App waits for any in-flight upload, then asks the backend to prepare an inline message
  3. The backend builds the message and returns a prepared_message_id valid for ~5 minutes
  4. The Mini App calls Telegram.WebApp.shareMessage(prepared_message_id)
  5. Telegram opens its native share sheet — pick a chat or channel
  6. 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:

  1. localStorage.tgpe:current — local recovery cache
  2. 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

BackendLimit
localStorage~5–10 MB (browser) — about 50 KB per draft
Telegram CloudStorage1024 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

ErrorMessageAction
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

CodeMessage
empty_postWrite something before sharing.
too_longPost is too long. Telegram allows up to 4,096 characters.
invalid_stateSomething's wrong with this draft. Try copying the text manually.
telegram_apiTelegram is having trouble. Please try again.
auth_required / auth_invalidAuthentication failed. Please reopen the Mini App.
network_errorCouldn't reach our servers. Check your connection.
unsupportedUpdate Telegram to share directly. Or use Copy as MarkdownV2.

Troubleshooting

IssueFix
"Mini App is not running in Telegram"Open @tgpe_editor_bot inside Telegram and send /app
Drafts don't sync between devicesCloudStorage 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 AndroidServer-side thumb fallback should kick in. If it doesn't, send a console log to support.
"Post is too long" under 4096A media item is attached — caption limit is 1024. Remove the media or shorten the caption.
Can't find a chat in the share sheetType the chat name in the share-sheet search.
"via @bot" label on channel postsExpected 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.