Skip to content

Bot API 10.0: General#5238

Merged
harshil21 merged 7 commits into
api-10.0-centralfrom
api-10.0-general
May 26, 2026
Merged

Bot API 10.0: General#5238
harshil21 merged 7 commits into
api-10.0-centralfrom
api-10.0-general

Conversation

@harshil21
Copy link
Copy Markdown
Member

No description provided.

@harshil21 harshil21 requested review from aelkheir and Copilot May 20, 2026 08:17
@harshil21 harshil21 added the ⚙️ bot-api affected functionality: bot-api label May 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 adds general support for Telegram Bot API 10.0 features by introducing BotAccessSettings, new Bot/ExtBot/User APIs for managed-bot access settings and personal chat message retrieval, and aligning draft message APIs with the updated optional text parameter.

Changes:

  • Add BotAccessSettings TelegramObject (plus docs + dummy objects + tests) and new methods get_managed_bot_access_settings/set_managed_bot_access_settings.
  • Add get_user_personal_chat_messages (and User.get_personal_chat_messages shortcut) plus the PersonalChatMessagesLimit constant.
  • Update send_message_draft/draft-reply shortcut signatures to make text optional per Bot API 10.0.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_user.py Adds shortcut-method tests for new User convenience APIs.
tests/test_botaccesssettings.py New unit tests for BotAccessSettings serialization, slots, and equality.
tests/test_bot.py Adds offline/request tests for the new Bot API endpoints and an integration test for personal chat messages.
tests/auxil/dummy_objects.py Registers BotAccessSettings as a prepared dummy object for generic tests.
src/telegram/ext/_extbot.py ExtBot wrappers + camelCase aliases for the newly added Bot methods.
src/telegram/constants.py Adds PersonalChatMessagesLimit enum for get_user_personal_chat_messages(limit=...).
src/telegram/_user.py Adds User shortcut methods for the new Bot APIs; updates draft signature + docs.
src/telegram/_message.py Updates reply_text_draft signature/docs to make text optional.
src/telegram/_chat.py Updates send_message_draft shortcut signature/docs to make text optional.
src/telegram/_botaccesssettings.py Introduces the BotAccessSettings TelegramObject and JSON parsing.
src/telegram/_bot.py Adds new Bot API methods, draft signature/doc updates, and camelCase aliases.
src/telegram/init.py Exports BotAccessSettings at the package level.
docs/source/telegram.botaccesssettings.rst Adds autodoc page for telegram.BotAccessSettings.
docs/source/telegram.at-tree.rst Registers the new docs module in the available types tree.
docs/source/inclusions/bot_methods.rst Documents the new managed-bot access settings methods in the overview table.
changes/unreleased/5229.87PBN4GFkuAaDhhgFwCYkY.toml Updates the unreleased changelog fragment for Bot API 10.0.

Comment thread src/telegram/_bot.py Outdated
Comment thread docs/source/inclusions/bot_methods.rst
Copy link
Copy Markdown
Member

@aelkheir aelkheir left a comment

Choose a reason for hiding this comment

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

Some minor suggestions & nitpicks

Comment thread src/telegram/_bot.py Outdated
Comment thread src/telegram/_botaccesssettings.py Outdated
Comment thread tests/test_botaccesssettings.py
Comment thread src/telegram/_bot.py Outdated
@harshil21 harshil21 merged commit 2ac8737 into api-10.0-central May 26, 2026
26 of 27 checks passed
@harshil21 harshil21 deleted the api-10.0-general branch May 26, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⚙️ bot-api affected functionality: bot-api

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants