Skip to main content

Inline button

An inline button is a clickable button displayed directly below a Telegram message, created with the Bot API's inline keyboard markup. Inline buttons can link to a URL, trigger a callback to a bot, or deep-link into a Telegram Mini App — turning a static post into an interactive call to action. For channel posts, inline buttons are the primary mechanism for adding links that stand out from the message body without requiring users to tap text embedded in the content.

One behaviour per button

A button declares exactly one action: open a URL, send callback data back to the bot, copy text to the clipboard, launch a Mini App, or start a login flow. Not every type works everywhere — Mini App buttons are available only in private chats with the bot, and some inline-query buttons are unsupported in channels. For channel posts the URL button is the dependable choice.

Callback data is a key, not a payload

Data attached to a callback button is limited to just 64 bytes, so it holds an identifier the bot resolves server-side rather than the application state itself. There is a second obligation: after a press, the client shows a progress indicator until the bot answers the callback query. Skipping that answer leaves the button visibly spinning even when the work already succeeded.

Buttons versus links inside the text

A button sits below the message rather than inside it, so it does not consume the text's character budget and it can be swapped later by editing only the markup, leaving the copy untouched. The cost is layout: buttons share the message width in rows, so a long label crowds anything placed beside it. Short imperative labels survive narrow phone screens best.

What can a button open, and what are the limits?

Each InlineKeyboardButton has a text label and exactly one action field. The url field takes an HTTP or tg:// link. The login_url field takes an HTTPS link that signs the user in. The callback_data field takes 1 to 64 bytes, and bytes are not characters: one Cyrillic letter uses two bytes in UTF-8, so a Cyrillic key holds about half as many letters as a Latin one. A safe key looks like approve:1042, which uses 12 bytes. A button can also carry a style, danger, success or primary, which colors it red, green or blue. A tg://user?id= link works only inside an inline link or a keyboard button, never as plain text in a message.

Adding buttons to posts in Autogram

In the Autogram post composer you can add a keyboard of buttons under a post, in rows. Each button is one of two kinds. A link button opens a web page or a Telegram link. A copy button copies a short text, such as a promo code, up to 256 characters, to the reader's clipboard. Autogram counts clicks on link buttons that lead outside Telegram, because it sends them through its own click redirect while it keeps the real link for you. Telegram does not attach a keyboard to an album, so buttons work on a post with text or one image, not on a post with several images. A post that belongs to a sold advertisement keeps the advertiser's content and takes no buttons. Autogram also uses callback buttons in one private message to you: the first post of a new automation can arrive with Publish and Skip buttons.

A worked example: one post, two buttons

Say a hypothetical shop channel announces a weekend sale. The post has two lines of text and one image. Under it, the editor adds a first row with one link button labeled Open the catalog, pointing to the sale page. A second row holds a copy button labeled Copy promo code, which puts the code on the reader's clipboard. The text stays short because the buttons carry the actions. After publishing, the editor previews the finished post on a phone, taps both buttons, and checks that the link opens the right page and the code pastes cleanly.

Mistakes that make buttons fail

The most common mistake is adding buttons to a post that cannot hold them, such as a multi-image album. Telegram does not attach buttons to an album, so use a post with text or one image. A second mistake is a vague label like Click here. Readers cannot tell what happens next, so name the result instead. A third is a link with a typo or a page that needs a login. Spot these by opening the published post from an account that is not a channel admin, so login-gated pages and other access problems show up.

How to check button performance

Autogram counts clicks on link buttons that lead outside Telegram, so those are the buttons you can compare with views. Copy buttons and Telegram links are not part of that count, so judge them by other signs. Change one thing at a time: the label, the position, or the link target. Run each version on similar posts and compare the results over several posts, not one. A single post can be skewed by its posting time. Keep the winning label as your default for the next posts.

Put these concepts to work

Automate your Telegram publishing with AI content, quality scoring, and smart scheduling.