Bot API 10.3 update - #2626
Conversation
Fix Update.removed_chat_boost_handlers not called in Asnyc.
Bump version
Test fix.
There was a problem hiding this comment.
🟡 Changes recommended
Async draft support remains incomplete, markup deserialization loses data, and several changed signatures break positional callers.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates the library for Telegram Bot API 10.3 across types, request helpers, handlers, and metadata.
Changes:
- Adds Bot API 10.3 types and serialization fields.
- Extends synchronous/asynchronous sending and update dispatch.
- Updates tests, documentation, and package version to 4.37.0.
File summaries
| File | Description |
|---|---|
telebot/types.py |
Adds 10.3 types and fields. |
telebot/__init__.py |
Updates synchronous APIs and handlers. |
telebot/async_telebot.py |
Updates asynchronous APIs and handlers. |
telebot/apihelper.py |
Serializes new synchronous request parameters. |
telebot/asyncio_helper.py |
Serializes new asynchronous request parameters. |
telebot/util.py |
Registers new update and content types. |
tests/test_types.py |
Tests new type serialization. |
tests/test_telebot.py |
Updates Update fixture construction. |
tests/test_handler_backends.py |
Updates positional Update fixtures. |
telebot/version.py |
Sets version 4.37.0. |
pyproject.toml |
Sets package version 4.37.0. |
docs/source/conf.py |
Sets documentation version 4.37.0. |
README.md |
Advertises Bot API 10.3 support. |
Review details
Suppressed comments (3)
telebot/types.py:3738
- Adding this parameter before
can_manage_direct_messagesandcan_manage_tagssilently shifts existing positional constructor calls, assigning those rights to the wrong fields. Append the new right after the existing optional rights.
custom_title: Optional[str] = None, can_send_welcome_messages: Optional[bool] = None,
can_manage_direct_messages: Optional[bool] = None,
can_manage_tags: Optional[bool] = None, **kwargs):
telebot/types.py:8397
- The new right is inserted before two existing positional parameters, so old
ChatAdministratorRights(...)calls can now assign direct-message and tag permissions to the wrong fields. Move it aftercan_manage_tagsto keep the constructor backward compatible.
can_delete_stories: bool = False, can_send_welcome_messages: Optional[bool] = None, can_manage_direct_messages: Optional[bool] = None,
can_manage_tags: Optional[bool]=None, **kwargs) -> None:
telebot/types.py:17194
- This insertion shifts the existing positional
captionargument tois_compact, producing an invalid payload instead of the caller's caption. Addis_compactaftercaptionto preserve the prior constructor ordering.
is_compact: Optional[bool] = None,
caption: Optional[RichText] = None,
- Files reviewed: 13/13 changed files
- Comments generated: 18
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Some more fixes tomorrow. |
|
@coder2020official Looks done. |
|
Saw it, will review it tomorrow |
| def send_live_photo( | ||
| self, chat_id: Union[int, str], live_photo: Union[Any, str], photo: Union[Any, str], | ||
| message_thread_id: Optional[int]=None, business_connection_id: Optional[str]=None, | ||
| message_thread_id: Optional[int]=None, direct_messages_topic_id: Optional[int]=None, |
There was a problem hiding this comment.
I'd still like placing new parameters at the end.. just to be safe..
WTF? Was direct_messages_topic_id missing since bot api 10.0?
|
On a quick glance, this looks fine |
|
@coder2020official Go? :) |
|
yes |
Description
Bot API 10.3 updates.
Changes
Bot API 10.3 types and serialization
RichMessageButtonRichTextButtonRichBlockButtons/InputRichBlockButtonsRichBlockExpandableBlockQuotation/InputRichBlockExpandableBlockQuotationRichBlockDocument/InputRichBlockDocumentDisabledButton.EphemeralMessageParameters.MessageGenerationStopped.CommunityChatJoined.API helpers and sending methods
ephemeral_message_parameters.Backward compatibility
receiver_user_idandcallback_query_idparameters.EphemeralMessageParameters.ephemeral_message_parametersobject priority when both old and new forms are passed.Update dispatch and handlers
Update.stopped_message_generationin bothTeleBotandAsyncTeleBot.stopped_message_generation_handleradd_stopped_message_generation_handlerregister_stopped_message_generation_handlerstopped_message_generationtoutil.update_types.community_chat_joinedtoutil.content_type_service.removed_chat_boostupdates were collected but never dispatched.typed_middleware_handlersto cover all supported top-level update types, including:purchased_paid_mediamanaged_botguest_messagesubscriptionstopped_message_generation