Merged
Merged
Conversation
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
BotAccessSettingsTelegramObject (plus docs + dummy objects + tests) and new methodsget_managed_bot_access_settings/set_managed_bot_access_settings. - Add
get_user_personal_chat_messages(andUser.get_personal_chat_messagesshortcut) plus thePersonalChatMessagesLimitconstant. - Update
send_message_draft/draft-reply shortcut signatures to maketextoptional 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. |