Post content
We've just released v13.0. 🥳 It's a major release and brings some major changes. ⚠️ So before upgrading with pip install -U python-telegram-bot as usual, please carefully read the following notes! You can also find a detailed transition guide on this wiki page. We'd like to thank everyone, who has contributed to this release! Major Changes: v13 presents two massive improvements to our library: Static type hinting and a reworked JobQueue. The first one will be a huge advancement for anyone writing complex programs with an IDE that supports proper auto completion. This will hopefully save you a lot of debugging time. The latter will not directly affect you in most cases. However, we no longer implement the scheduling logic on our own, but use the third party library APSchelduler instead. This enables us to focus our development effort onto other parts of the library. Detailed information on the new JobQueue can be found here. - Refactor JobQueue (#1981) - Type Hinting (#1920) ⚠️ v13 also refactors how persistence of Bots is handled. Anyone using PicklePersistence (or a custom persistence class) should read this paragraph of the transition guide. - Refactor persistence of Bot instances (#1994) ⚠️ There have been some more reworks and deprecations listed below. Additionally, v13.0 drops Python 3.5, which reached its end of life at the beginning of September 2020. - Deprecate old-style callbacks, i.e. set use_context=True by default (#2050) - Refactor Handling of Message VS Update Filters (#2032) - Deprecate Message.default_quote (#1965) - Refactor handling of kwargs in Bot methods (#1924) - Refactor Dispatcher.run_async, deprecating the @run_async decorator (#2051) New Features: Besides the big changes, v13 brings some new functionality. Especially noteworthy are the automatic pagination for answer_inline_query, which takes care of the maximum number of InlineResults for you, and the addition of tzinfo to the Defaults setup, which integrates nicely into the new JobQueue. - Automatic Pagination for answer_inline_query (#2072) - Defaults.tzinfo (#2042) - Extend rich comparison of objects (#1724) - Add Filters.via_bot (#2009) - Add missing shortcuts (#2043) - Allow DispatcherHandlerStop in ConversationHandler (#2059) - Make Errors picklable (#2106 by Delgan) Minor changes, CI improvements, doc fixes or bug fixes: Last, but not least, there have been a bunch of smaller additions and improvements to the documentation. - Fix Webhook not working on Windows with Python 3.8+ (#2067) - Fix setting thumbs with send_media_group (#2093) - Make MessageHandler filter for Filters.update first (#2085) - Fix PicklePersistence.flush() with only bot_data (#2017) - Add test for clean argument of Updater.start_polling/webhook (#2002 by ikkemaniac) - Doc fixes, refinements and additions (#2005 by ikkemaniac, #2008, #2089, #2094, #2090) - CI fixes (#2018, #2061) - Refine pollbot.py example (#2047 by lrezende) - Refine Filters in examples (#2027) - Rename echobotcode> examples (#2025) - Use Lock-Bot to lock old threads (#2048, #2052, #2049, #2053)