How Telegram Bots Use Rich Text Formatting: Headers, Native Tables, LaTeX Math, Spoilers & Bot API 7.x Entities
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.
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.
A bot sends a well-formatted message. Somebody forwards it. What arrives?
Formatting travels because it belongs to the message rather than being applied by the chat it is in. That is worth knowing from both sides: a well-structured bot reply keeps working when somebody passes it to a colleague, and anything you would not want circulated in that form should not be in the message at all. What does not travel is anything outside it — buttons attached to the message are the usual casualty.
What happens to a five-column table on a phone?
A chat bubble is not a page and the width is whatever the phone gives it. Columns that do not fit wrap, alignment collapses, and a table that made a comparison obvious turns into the hardest thing in the conversation to read. If the data genuinely needs five columns, the honest options are fewer rows, a file, or a link to somewhere that can lay it out properly.
When is a code block the right choice for ordinary text?
A code block preserves spacing and punctuation exactly and gives the reader a way to copy the contents without selecting by hand. That makes it right for reference numbers, identifiers, commands and anything where a stray character breaks the thing — regardless of whether it is code. Using it as emphasis is the misuse: it makes ordinary sentences harder to read and signals something the text does not mean.
A bot's reply is long but well structured. What should it lead with?
The first line is the only part guaranteed to be read, and in a chat it is also what appears in the notification and the chat list. Structure below it helps whoever continues; a heading at the top delays the answer by a line and repeats what the reader already knows. Restating the question is worse still — it fills the one line that mattered with information the user supplied.
task_alt
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.
settings Formatting bot output
- Put the answer in the first line It is the only guaranteed one.
- Assume a narrow screen Two or three columns at most.
- Fold the long part into a quote Short and complete at once.
- Use code blocks for exact strings Not for emphasis.
- Let the content earn the structure Bullets need a list.
- Check it in a real chat on a phone Before anybody else sees it.
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.
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.