Skip to content

Bot API 10.1#2600

Open
ranjitsingha wants to merge 6 commits into
eternnoir:masterfrom
ranjitsingha:master
Open

Bot API 10.1#2600
ranjitsingha wants to merge 6 commits into
eternnoir:masterfrom
ranjitsingha:master

Conversation

@ranjitsingha

@ranjitsingha ranjitsingha commented Jun 12, 2026

Copy link
Copy Markdown

Bot API 10.1

Rich Messages

  • Added the classes RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextSpoiler, RichTextDateTime, RichTextTextMention, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextCode, RichTextCustomEmoji, RichTextMathematicalExpression, RichTextUrl, RichTextEmailAddress, RichTextPhoneNumber, RichTextBankCardNumber, RichTextMention, RichTextHashtag, RichTextCashtag, RichTextBotCommand, RichTextAnchor, RichTextAnchorLink, RichTextReference and RichTextReferenceLink, which represent different types of rich formatted text.
  • Added the class RichText, which represents rich formatted text.
  • Added the class RichBlockCaption, which represents the caption of a rich formatted text.
  • Added the class RichBlockTableCell, which represents a cell in a table.
  • Added the class RichBlockListItem, which represents an item in a list.
  • Added the classes RichBlockParagraph, RichBlockSectionHeading, RichBlockPreformatted, RichBlockFooter, RichBlockDivider, RichBlockMathematicalExpression, RichBlockAnchor, RichBlockList, RichBlockBlockQuotation, RichBlockPullQuotation, RichBlockCollage, RichBlockSlideshow, RichBlockTable, RichBlockDetails, RichBlockMap, RichBlockAnimation, RichBlockAudio, RichBlockPhoto, RichBlockVideo, RichBlockVoiceNote and RichBlockThinking, which represent different types of blocks in a rich formatted message.
  • Added the class RichBlock, which represents a block in a rich formatted message.
  • Added the class RichMessage, which represents a rich formatted message.
  • Added the field rich_message to the class Message.
  • Added the class InputRichMessage, describing a rich message to send.
  • Added the class InputRichMessageContent and allowed it to be used as InputMessageContent in results of inline, guest, and Web App queries.
  • Added the method sendRichMessage, allowing bots to send rich messages.
  • Added the method sendRichMessageDraft, allowing bots to stream partial rich messages.
  • Added the parameter rich_message to the method editMessageText, allowing bots to edit rich messages.

Join Request Queries

  • Added the field supports_join_request_queries to the class User.
  • Added the field guard_bot to the class ChatFullInfo.
  • Added the field query_id to the class ChatJoinRequest.
  • Added the method answerChatJoinRequestQuery.
  • Added the method sendChatJoinRequestWebApp.

Polls

  • Added the class Link and the field link to the class PollMedia.
  • Added the class InputMediaLink and allowed it to be used as InputPollOptionMedia.

…inks)

New types: RichText (25 inline subtypes), RichBlock (24 block subtypes),
RichMessage, InputRichMessage, InputRichMessageContent, Link, InputMediaLink.

New methods: sendRichMessage, sendRichMessageDraft, answerChatJoinRequestQuery,
sendChatJoinRequestWebApp. All methods added to sync/async TeleBot and helpers.

Field additions: User.supports_join_request_queries, ChatFullInfo.guard_bot,
ChatJoinRequest.query_id, Message.rich_message, PollMedia.link.

Bumps version to 4.35.0.
check_json only shallow-copies, so nested Subclass._from_dict(shared_dict)
calls mutated the caller's dict in place (RichBlockList, RichBlockTable,
and all media/collage/slideshow/map blocks with nested captions/items/cells).
Route nested conversions through RichBlock.de_json, which copies first and
dispatches correctly via the type map.

Also allow InputMediaLink as InputPollOptionMedia per the Bot API 10.1 spec.
@ranjitsingha ranjitsingha changed the title Add Bot API 10.1 support (Rich Messages, Join Request Queries, Poll Links) Bot API 10.1 Jun 12, 2026
InputRichMessage takes html/markdown/is_rtl/skip_entity_detection
strings, not page_blocks. RichMessage uses 'blocks' (not 'page_blocks')
and adds is_rtl.
Receive-side block classes were off-spec:
- Type strings: block_quotation->blockquote, pull_quotation->pullquote,
  preformatted->pre, section_heading->heading (de_json dispatch + TYPE_MAP)
- Field renames: page_blocks->blocks (ListItem, Collage, Slideshow, Details)
- RichBlockListItem: label is a String (not RichText); add has_checkbox,
  is_checked, value
- RichBlockSectionHeading: level->size
- RichBlockBlockQuotation: text->blocks (Array of RichBlock), caption->credit
- RichBlockDetails: header->summary
- RichBlockList: drop is_ordered (not in spec)
Comment thread telebot/types.py Outdated
ranjitsingha added a commit to ranjitsingha/pyTelegramBotAPI that referenced this pull request Jun 13, 2026
Addresses review feedback on PR eternnoir#2600: the 25 RichText* and 24 RichBlock*
subclasses used condensed one-line docstrings, unlike the rest of the
library. Rewrite them in the project's reStructuredText format with a
description, Telegram documentation link, per-parameter :param:/:type:,
and :return:/:rtype:, matching the base classes. Docs-only; no logic
changes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Addresses review feedback on PR eternnoir#2600: the 25 RichText* and 24 RichBlock*
subclasses used condensed one-line docstrings, unlike the rest of the
library. Rewrite them in the project's reStructuredText format with a
description, Telegram documentation link, per-parameter :param:/:type:,
and :return:/:rtype:, matching the base classes. Docs-only; no logic
changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants