In this article
Three backticks turn the lines that follow into a code block: monospaced, coloured according to the language, with a header naming it and a control that copies the contents.
The copy button is the part that matters. What the reader gets is exactly your characters — no surrounding chat, no corrected quotation marks, no lost indentation.
What you will be able to do
- check_circle Send code that arrives exactly as written.
- check_circle Declare the language so it is coloured correctly.
- check_circle Use inline code for the short things.
- check_circle Know when to send a file instead.
The block carries a language label and a copy control in its header.
code A container, not a font
Pasting code into an ordinary message is where most of the wasted time in technical chats comes from. Indentation collapses, quotation marks get replaced with curly ones, a long line wraps somewhere meaningless, and the person on the other end retypes it and introduces a different bug.
A code block makes the text an object. Nothing in it is interpreted as formatting, the copy control puts precisely those characters on the clipboard, and on a desktop a wide line scrolls sideways rather than wrapping. That is worth more than the colours.
The colours still help, and they depend on Telegram knowing the language. It will guess, and the guess is usually right for anything with obvious keywords, but writing the language after the opening backticks removes the question and labels the block for whoever reads it later.
Four ways to send something technical
The last one is the answer more often than people think.
data_object Several lines that must survive
short_text One thing inside a sentence
keyboard Backticks, menu, shortcut
description When a block is the wrong shape
A block preserves exactly what you typed. Past a screenful, send the file and quote the lines.
settings Sending a block
- Open with three backticks And the language name if you know it.
- Write or paste the code Indentation is preserved as typed.
- Close with three backticks Or use the formatting menu on selected text.
- Use single backticks for one-liners Commands, paths, reference numbers.
- Tell people about the copy control Most recipients never notice it.
- Attach a file past a screenful And quote only the relevant lines.
This page is one kind of block. The curriculum step is the whole set: bold and italic, quotes and collapsible quotes, spoilers, and how formatting survives being copied out of Telegram into something else.
At a glance
- 1Code blocks
Wrap code so it arrives exactly as written.
- 2Language label
Name the language for colouring.
- 3Long code
Send a file and quote the key lines.
Updated