LIVE PORTAL • Telegram v11.8 API Synchronized • Free Animated Stickers
translate Translated

How Telegram Bots Use Rich Text Formatting: Headers, Native Tables, LaTeX Math, Spoilers & Bot API 7.x Entities

play_circle Video tip • Bots

Messages from bots can carry more structure than people usually give them — headings, tables, quotes that fold away, code, formulas. All of it renders in an ordinary chat bubble, with no attachment and nothing to open.

Which raises a question that has nothing to do with capability: how much structure a message in a chat can carry before it stops being a message.

What you will be able to do

  • check_circle Know what a bot can put in a bubble.
  • check_circle Choose structure that helps on a phone.
  • check_circle Use folding quotes for the long part.
  • check_circle Say what survives being passed on.
play_circle Official Telegram video short — rich formatting in bot messages
1080p clip from @TelegramTips • 0:15
AUTOPLAY

Everything here is still one message in a chat, which is the constraint worth designing against.

data_object The bubble is narrow and always will be

Most formatting mistakes in bot output come from being written on a wide screen and read on a narrow one. A table with five columns is legible in the editor and becomes a stack of wrapped fragments on a phone, which is where nearly all of it is read.

The useful discipline is to treat width as fixed and short. Two or three columns, values that are short enough not to wrap, headings that are one word. Anything that does not fit that is not a table problem — it is a sign that the answer wants to be a file, a link, or several messages.

The same applies to length. A bubble can hold a great deal and a reader cannot: a message that fills two screens is skimmed to its first line and then scrolled past, however well it is structured underneath.

unfold_less
The folding quote is the most useful of these A collapsible block lets a message be short and complete at once — the answer visible, the log, the trace or the terms tucked behind a tap. It is the one piece of structure that makes long output better rather than merely tidier.

A bot sends a well-formatted message. Somebody forwards it. What arrives?

What happens to a five-column table on a phone?

When is a code block the right choice for ordinary text?

A bot's reply is long but well structured. What should it lead with?

preview
Read your bot's output on a phone before shipping it Not in a terminal, not in a preview tool — in a real chat, on a real handset. Almost every formatting decision that looks reasonable while building looks different there, and that is the only view that counts.

short_text Structure is not the same as clarity

There is a pattern worth naming, because well-meaning bots fall into it constantly: a reply with headings, bullets, a table and a quote, all of it applied to two sentences of content. The formatting makes the message look considered and makes it three times longer to read.

A useful rule is that structure should be earned by the content. Bullets when there genuinely is a list. A table when things are being compared across the same attributes. A heading only when there is more than one section. Applied to anything shorter, all of it is decoration on a message that would have been better as a paragraph.

Restraint is also what makes the structure work when it appears. If every reply is formatted, none of them stands out; if formatting shows up when the content has a shape, readers learn that it means something.

priority_high
Do not format text you did not write Bolding parts of a quoted message, or restructuring a user's own words into a list, changes emphasis that belonged to somebody else. Format your output, leave their input as it was.

settings Formatting bot output

  1. Put the answer in the first line It is the only guaranteed one.
  2. Assume a narrow screen Two or three columns at most.
  3. Fold the long part into a quote Short and complete at once.
  4. Use code blocks for exact strings Not for emphasis.
  5. Let the content earn the structure Bullets need a list.
  6. Check it in a real chat on a phone Before anybody else sees it.
menu_book
Part of the beginner curriculum Step 52 — Formatting, quotes and rich text

This page is the same toolkit from a bot's side. The curriculum step is how you use it by hand: which formatting exists, how to apply it while typing, and what survives being quoted and forwarded.

insights Visual recap

Rich formatting in bot messages at a glance

Why the bubble width governs everything, what the folding quote solves, when a code block is right, what survives forwarding, and why structure has to be earned, on one page. Tap to open it at full resolution.

Infographic summarising rich text formatting in Telegram bot messages
Enlarged Preview
Click anywhere outside or press ESC to close viewer
smart_display Telegram Video Short
1080p HD
Official Source: @TelegramTips Post #44 Press ESC or click outside to close