Skip to content

serejaris/telegram-skills / skills/tg-classic-messages

tg-classic-messages

Verified

Use when sending or editing ordinary Telegram bot messages: sendMessage text, MarkdownV2/HTML escaping and entities, quotes, date_time, custom emoji, link previews, photos and documents with captions, albums, upload size limits, protect_content, copy, forward, delete. Also use to choose between a classic message and a rich message.

tg-classic-messages

Checked against the official docs on 2026-10-30: Bot API 10.3 (August 24, 2026). Pre-send rules below come from Formatting options, the method pages and Sending files. Nothing here was run against a live bot.

Classic or rich

Default to the classic message. Take sendRichMessage when the content needs structure the classic format lacks. examples/same-post.md builds one post both ways.

NeedClassicRich (tg-rich-messages)
Text up to 4096 charactersyesyes
Longer than 4096, one messageno, split into severalup to 32768
Headings, tables, lists, formulas, detailsnoyes
Link preview controllink_preview_optionsno such parameter
Media with a caption, spoiler flag, caption positioncaption, has_spoiler, show_caption_above_mediamedia blocks with their own captions
Album of 2-10 itemssendMediaGroupcollage, slideshow
PollsendPoll (tg-polls)no poll block
Old clientsrender everythingshow an update placeholder for features they lack (2026-08-25)

Editing is one method for both: editMessageText takes text or rich_message.

Limits

WhatLimit
text1-4096 characters after entities parsing
caption0-1024 characters after entities parsing
sendMediaGroup2-10 items; documents and audio only group with their own type
Upload by multipartphoto 10 MB, other files 50 MB
Upload by HTTP URLphoto 5 MB, other 20 MB; sendDocument by URL only for .PDF and .ZIP
By file_idno limit, but no type change, and a file_id belongs to one bot
Photo dimensionswidth + height at most 10000, ratio at most 20
Download with getFile20 MB
deleteMessages, copyMessages, forwardMessages1-100 ids
reply_parameters.quote0-1024 characters, exact substring of the replied message
Local Bot API serverupload 2000 MB, download unlimited, see tg-bot-ops

Measure against the limits after parsing, on the visible text: tags and escapes don't count. Entity offset and length are in UTF-16 code units, so an emoji outside the BMP counts as two: in Python, len(text.encode('utf-16-le')) // 2.

Text over 4096: split on paragraph boundaries, re-open entities in each part, and send in order with the pacing from tg-bot-ops. Over 1024 in a caption: send the media with a short caption and the text as a reply, or switch to rich.

Formatting

Pick one per message: parse_mode or an explicit entities list. Entities need no escaping, so generated text is safest that way.

  • HTML. Escape <, > and & in all dynamic text as &lt;, &gt;, &amp;. Only the listed tags work; an unknown tag fails the send.
  • MarkdownV2. Escape _ * [ ] ( ) ~ > # + - = | { } . !outside entities, including every.and-of plain text. Insidepreandcodeescape only `` `` and \; inside the (...) of a link only ) and \.
  • Markdown is legacy, without nesting, underline, spoiler, quotes, custom emoji or date_time.

Nesting: entities overlap only by full containment. bold, italic, underline, strikethrough and spoiler nest freely, except with pre and code. Quotes can't nest. In MarkdownV2 two adjacent quotes need an empty bold entity (**) between them.

  • Mentions. tg://user?id= works only inside an inline link or an inline keyboard button, never as plain text.
  • Quotes. <blockquote>, <blockquote expandable>.
  • Time in the reader's timezone (Bot API 9.5): <tg-time unix="1647531900" format="wDT">22:45 tomorrow</tg-time>, format per r|w?[dD]?[tT]?, and r stands alone. An empty format shows the text as written.
  • Custom emoji: <tg-emoji emoji-id="…">👍</tg-emoji>, with a real emoji inside as fallback. Allowed for bots with extra usernames bought on Fragment, or for messages sent directly to private chats, groups and supergroups when the bot's owner has Premium. Channels are not on that second list: without Fragment usernames, plan the post without custom emoji. Not tested live for this skill.
  • Effects: message_effect_id works in private chats only.

Link previews

link_preview_options on sendMessage and editMessageText:

  • is_disabled: true removes the preview.
  • url picks the page instead of the first link in the text.
  • prefer_small_media, prefer_large_media take effect only with an explicit url.
  • show_above_text moves the preview above the text.

Media

  • Prefer file_id for anything already sent; keep it per bot.
  • show_caption_above_media, has_spoiler sit on the media method or InputMedia*.
  • A send can return message_id 0: the server may schedule a heavy video for a big chat instead of sending at once. Treat 0 as unknown, never as a stored id.
  • Rebuild the multipart body on every retry, see tg-bot-ops.

Protecting, copying, deleting

  • protect_content guards one message against forwarding and saving. Protection for a whole chat is a client setting, see tg-capability-map.
  • disable_notification sends silently.
  • copyMessage has no link to the original. It can't copy service, paid media, giveaway or invoice messages; a quiz only if the bot knows correct_option_ids.
  • deleteMessage: under 48 hours old. A bot deletes its own messages and, in private chats, incoming ones. In channels it needs can_post_messages for its own posts and can_delete_messages for others. A dice in a private chat is deletable only after 24 hours.
  • pinChatMessage needs can_pin_messages in groups and can_edit_messages in channels.

Editing: editMessageText, editMessageCaption, editMessageMedia, editMessageReplyMarkup. Edits count against the chat's flood limits.

Before sending

  1. Dynamic text escaped for the chosen parse_mode, or sent as entities.
  2. Visible length within the limit.
  3. Preview checked in a private chat with the bot, on mobile as well.
  4. Delivery outcome handled as in tg-bot-ops: a timeout is unknown, not failed.

Sources

slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall