Botapi 10.2#2605
Merged
Merged
Conversation
Collaborator
Author
|
@Badiboy I'm pretty much done except for one point (creating a handler to handle user payment subscription updates), so you may start reviewing so we can get over this asap |
Collaborator
Author
|
Double check tho might've missed something in between |
Collaborator
|
God, one more API update... ) |
Badiboy
requested changes
Jul 16, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates pyTelegramBotAPI to align with Telegram Bot API 10.2 by extending type models and client helpers for rich messages, ephemeral messaging, communities, and subscription updates.
Changes:
- Added new/updated
typesmodels and parsing for subscriptions, communities, and ephemeral message fields. - Extended sync/async API helpers and bot methods to support outgoing ephemeral parameters and ephemeral edit/delete endpoints.
- Updated tests and update-type lists to match the expanded
Updateschema.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_telebot.py |
Adjusts test helper Update construction to include the new subscription field. |
tests/test_handler_backends.py |
Updates positional Update construction to match the expanded constructor arity. |
telebot/util.py |
Extends update/service-message type lists for new API 10.2 event types. |
telebot/types.py |
Adds new API 10.2 objects/fields (rich message inputs, communities, ephemeral fields, subscriptions) and updates serialization/deserialization. |
telebot/asyncio_helper.py |
Adds receiver_user_id/callback_query_id send params and implements ephemeral edit/delete API calls (async). |
telebot/async_telebot.py |
Wires new send params, adds ephemeral edit/delete methods, and introduces subscription handlers (async bot). |
telebot/apihelper.py |
Adds receiver_user_id/callback_query_id send params and implements ephemeral edit/delete API calls (sync). |
telebot/__init__.py |
Wires new send params, adds ephemeral edit/delete methods, and introduces subscription handlers (sync bot). |
Comments suppressed due to low confidence (1)
telebot/types.py:10127
ReplyParameters.to_dict()always includesmessage_ideven when it isNone. When replying to an ephemeral message (onlyephemeral_message_idset), this will serialize{"message_id": null, ...}which is likely rejected by the Bot API and makes the new ephemeral reply feature unusable viareply_parameters. Also,self.message_idis now optional but is still typed asint.
def to_dict(self) -> dict:
json_dict = {
'message_id': self.message_id
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
@Badiboy should be done |
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.
July 14, 2026
Bot API 10.2
Rich Messages
Ephemeral Messages
Communities
General