We've just released v20.0a1.
Thank you to everyone who contributed to this release.
If you want to upgrade from v20.0a0 to v20.0a1, please carefully read the notes below before upgrading with pip install -U --pre python-telegram-bot.
Before upgrading from v13.x to v20.0a1, please carefully read the
v20.0a0 release notes.
This update brings a few breaking changes compared to v20.0a0, but none of them are as disruptive as the changes introduced in v20.0a0. Let us highlight a few of them:
• CallbackContext.DEFAULT_TYPE was moved to ContextTypes.DEFAULT_TYPE.
• Support for ujson was dropped. If you want to use a 3rd party JSON library, you can do so by using a custom implementation of BaseRequest.
• The day argument of JobQueue.run_daily was changed to align with cron, i.e. 0 is now Sunday and 6 is Saturday
• The context argument of JobQueue.run_* was renamed to data and similarly for Job.context - in hopes of avoiding confusion in the future.
This release also brings some new features, including Application.post_init to effortlessly execute asyncio code on startup and version info in the style of sys.version_info.
For the full list of changes and improvements, please see below.
Major Changes:
• Drop Support for ujson and instead BaseRequest.parse_json_payload (
#3037,
#3072)
• Drop InputFile.is_image (
#3053)
• Drop Explicit Type conversions in __init__ s (
#3056)
• Handle List-Valued Attributes More Consistently (
#3057)
• Split {Command, Prefix}Handler And Make Attributes Immutable (
#3045)
• Align Behavior Of JobQueue.run_daily With cron (
#3046 by
jcnecio)
• Make PTB Specific Keyword-Only Arguments for PTB Specific in Bot methods (
#3035 by
tal66)
• Adjust Equality Comparisons to Fit Bot API 6.0 (
#3033)
• Add Tuple Based Version Info (
#3030)- Improve Type Annotations for CallbackContext and Move Default Type Alias to ContextTypes.DEFAULT_TYPE (
#3017,
#3023)
• Rename Job.context to Job.data (
#3028 by
aditya-yadav-27)
• Rename Handler to BaseHandler (
#3019)
New Features:
• Add Application.post_init (
#3078)
• Add Arguments chat/user_id to CallbackContext And Example On Custom Webhook Setups (
#3059)
• Add Convenience Property Message.id (
#3077 by
dglitxh)
• Add Example for WebApp (
#3052)
• Rename telegram.bot_api_version to telegram.__bot_api_version__ (
#3030)
Bug Fixes:
• Fix Non-Blocking Entry Point in ConversationHandler (
#3068)
• Escape Backslashes in escape_markdown (
#3055)
Dependencies:
• Update httpx requirement from ~=0.22.0 to ~=0.23.0 (
#3069)
• Update cachetools requirement from ~=5.0.0 to ~=5.2.0 (
#3058,
#3080)
Minor Changes, Documentation Improvements and CI:
• Move Examples To Documentation (
#3089)
• Documentation Improvements and Update Dependencies (
#3010,
#3007 by
KnorpelSenf,
#3012,
#3067 by
Aditya-Rajgor,
#3081,
#3082)
• Improve Some Unit Tests (
#3026)
• Update Code Quality dependencies (
#3070,
#3032,
#2998,
#2999)
• Don't Set Signal Handlers On Windows By Default (
#3065)
• Split {Command, Prefix}Handler And Make Attributes Immutable (
#3045)
• Apply isort and Update pre-commit.ci Configuration (
#3049)
• Adjust pre-commit Settings for isort (
#3043)
• Add Version Check to Examples (
#3036)
• Use Collection Instead of List and Tuple (
#3025)
• Remove Client-Side Parameter Validation (
#3024)
• Don't Pass Default Values of Optional Parameters to Telegram (
#2978)
• Stabilize Application.run_* on Python 3.7 (
#3009)
• Ignore Code Style Commits in git blame (#3003)
• Adjust Tests to Changed API Behavior (#3002)