Bot API 10.1#2600
Open
ranjitsingha wants to merge 6 commits into
Open
Conversation
…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.
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)
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bot API 10.1
Rich Messages
RichTextBold,RichTextItalic,RichTextUnderline,RichTextStrikethrough,RichTextSpoiler,RichTextDateTime,RichTextTextMention,RichTextSubscript,RichTextSuperscript,RichTextMarked,RichTextCode,RichTextCustomEmoji,RichTextMathematicalExpression,RichTextUrl,RichTextEmailAddress,RichTextPhoneNumber,RichTextBankCardNumber,RichTextMention,RichTextHashtag,RichTextCashtag,RichTextBotCommand,RichTextAnchor,RichTextAnchorLink,RichTextReferenceandRichTextReferenceLink, which represent different types of rich formatted text.RichText, which represents rich formatted text.RichBlockCaption, which represents the caption of a rich formatted text.RichBlockTableCell, which represents a cell in a table.RichBlockListItem, which represents an item in a list.RichBlockParagraph,RichBlockSectionHeading,RichBlockPreformatted,RichBlockFooter,RichBlockDivider,RichBlockMathematicalExpression,RichBlockAnchor,RichBlockList,RichBlockBlockQuotation,RichBlockPullQuotation,RichBlockCollage,RichBlockSlideshow,RichBlockTable,RichBlockDetails,RichBlockMap,RichBlockAnimation,RichBlockAudio,RichBlockPhoto,RichBlockVideo,RichBlockVoiceNoteandRichBlockThinking, which represent different types of blocks in a rich formatted message.RichBlock, which represents a block in a rich formatted message.RichMessage, which represents a rich formatted message.rich_messageto the classMessage.InputRichMessage, describing a rich message to send.InputRichMessageContentand allowed it to be used asInputMessageContentin results of inline, guest, and Web App queries.sendRichMessage, allowing bots to send rich messages.sendRichMessageDraft, allowing bots to stream partial rich messages.rich_messageto the methodeditMessageText, allowing bots to edit rich messages.Join Request Queries
supports_join_request_queriesto the classUser.guard_botto the classChatFullInfo.query_idto the classChatJoinRequest.answerChatJoinRequestQuery.sendChatJoinRequestWebApp.Polls
Linkand the fieldlinkto the classPollMedia.InputMediaLinkand allowed it to be used asInputPollOptionMedia.