Skip to content

Botapi 10.2#2605

Merged
Badiboy merged 9 commits into
eternnoir:masterfrom
coder2020official:botapi-102
Jul 18, 2026
Merged

Botapi 10.2#2605
Badiboy merged 9 commits into
eternnoir:masterfrom
coder2020official:botapi-102

Conversation

@coder2020official

@coder2020official coder2020official commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

July 14, 2026
Bot API 10.2

Rich Messages

Ephemeral Messages

Communities

  • Introduced initial support for Communities - several supergroups, channels, and bots linked together around a shared topic or audience.
  • Added the class Community which represents a community.
  • Added the class CommunityChatAdded and the field community_chat_added to the class Message.
  • Added the class CommunityChatRemoved and the field community_chat_removed to the class Message.
  • Added the field community to the class ChatFullInfo.

General

  • [ ]
  • Added updates about changes to a user payment subscription, represented by the class BotSubscriptionUpdated and the field subscription in the class Update.
  • Hardened the security of Mini Apps by disallowing the usage of Mini App methods from origins different from the original Mini App domain. The protection will be automatically enabled for all Mini Apps on July 20, 2026. You can opt-out from the protection through the @BotFather Mini App. If you do so, you acknowledge that it is the responsibility of the bot to ensure that the Mini App has no links to untrusted sites.

@coder2020official

Copy link
Copy Markdown
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

@coder2020official

Copy link
Copy Markdown
Collaborator Author

Double check tho might've missed something in between

@Badiboy

Badiboy commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

God, one more API update... )

@Badiboy Badiboy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor requests.

Comment thread telebot/types.py Outdated
Comment thread telebot/types.py
Comment thread telebot/types.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 types models 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 Update schema.

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 includes message_id even when it is None. When replying to an ephemeral message (only ephemeral_message_id set), this will serialize {"message_id": null, ...} which is likely rejected by the Bot API and makes the new ephemeral reply feature unusable via reply_parameters. Also, self.message_id is now optional but is still typed as int.
    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.

Comment thread telebot/types.py
Comment thread tests/test_handler_backends.py
Comment thread tests/test_handler_backends.py
@coder2020official

Copy link
Copy Markdown
Collaborator Author

@Badiboy should be done

@Badiboy Badiboy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Da best!

@Badiboy
Badiboy merged commit 2cf8d0b into eternnoir:master Jul 18, 2026
6 checks passed
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.

3 participants