serejaris/telegram-skills / skills/tg-classic-messages
tg-classic-messages
VerifiedUse 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.
| Need | Classic | Rich (tg-rich-messages) |
|---|---|---|
| Text up to 4096 characters | yes | yes |
| Longer than 4096, one message | no, split into several | up to 32768 |
| Headings, tables, lists, formulas, details | no | yes |
| Link preview control | link_preview_options | no such parameter |
| Media with a caption, spoiler flag, caption position | caption, has_spoiler, show_caption_above_media | media blocks with their own captions |
| Album of 2-10 items | sendMediaGroup | collage, slideshow |
| Poll | sendPoll (tg-polls) | no poll block |
| Old clients | render everything | show an update placeholder for features they lack (2026-08-25) |
Editing is one method for both: editMessageText takes text or rich_message.
Limits
| What | Limit |
|---|---|
text | 1-4096 characters after entities parsing |
caption | 0-1024 characters after entities parsing |
sendMediaGroup | 2-10 items; documents and audio only group with their own type |
| Upload by multipart | photo 10 MB, other files 50 MB |
| Upload by HTTP URL | photo 5 MB, other 20 MB; sendDocument by URL only for .PDF and .ZIP |
By file_id | no limit, but no type change, and a file_id belongs to one bot |
| Photo dimensions | width + height at most 10000, ratio at most 20 |
Download with getFile | 20 MB |
deleteMessages, copyMessages, forwardMessages | 1-100 ids |
reply_parameters.quote | 0-1024 characters, exact substring of the replied message |
| Local Bot API server | upload 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<,>,&. 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 perr|w?[dD]?[tT]?, andrstands 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_idworks in private chats only.
Link previews
link_preview_options on sendMessage and editMessageText:
is_disabled: trueremoves the preview.urlpicks the page instead of the first link in the text.prefer_small_media,prefer_large_mediatake effect only with an expliciturl.show_above_textmoves the preview above the text.
Media
- Prefer
file_idfor anything already sent; keep it per bot. show_caption_above_media,has_spoilersit on the media method orInputMedia*.- A send can return
message_id0: 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_contentguards one message against forwarding and saving. Protection for a whole chat is a client setting, seetg-capability-map.disable_notificationsends silently.copyMessagehas no link to the original. It can't copy service, paid media, giveaway or invoice messages; a quiz only if the bot knowscorrect_option_ids.deleteMessage: under 48 hours old. A bot deletes its own messages and, in private chats, incoming ones. In channels it needscan_post_messagesfor its own posts andcan_delete_messagesfor others. A dice in a private chat is deletable only after 24 hours.pinChatMessageneedscan_pin_messagesin groups andcan_edit_messagesin channels.
Editing: editMessageText, editMessageCaption, editMessageMedia, editMessageReplyMarkup. Edits count against the chat's flood limits.
Before sending
- Dynamic text escaped for the chosen
parse_mode, or sent asentities. - Visible length within the limit.
- Preview checked in a private chat with the bot, on mobile as well.
- Delivery outcome handled as in
tg-bot-ops: a timeout is unknown, not failed.
Sources
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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: 198k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| 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: 194k | Updated | Claude CodeCodex | Verified | Install |