================
*Released 2019-08-29*
Well... This felt like decades. But here we are with a new release.
Expect minor releases soon (mainly complete Bot API 4.4 support)
**Major and/or breaking changes:**
- Context based callbacks
- Persistence
- PrefixHandler added (Handler overhaul)
- Deprecation of RegexHandler and edited_messages, channel_post, etc. arguments (Filter overhaul)
- Various ConversationHandler changes and fixes
- Bot API 4.1, 4.2, 4.3 support
- Python 3.4 is no longer supported
- Error Handler now handles all types of exceptions (:pr:`1485`)
- Return UTC from from_timestamp() (:pr:`1485`)
**See the wiki page at https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-12.0 for a detailed guide on how to migrate from version 11 to version 12.**
Context based callbacks (:pr:`1100`)
------------------------------------
- Use of ``pass_`` in handlers is deprecated.
- Instead use ``use_context=True`` on ``Updater`` or ``Dispatcher`` and change callback from (bot, update, others...) to (update, context).
- This also applies to error handlers ``Dispatcher.add_error_handler`` and JobQueue jobs (change (bot, job) to (context) here).
- For users with custom handlers subclassing Handler, this is mostly backwards compatible, but to use the new context based callbacks you need to implement the new collect_additional_context method.
- Passing bot to ``JobQueue.__init__`` is deprecated. Use JobQueue.set_dispatcher with a dispatcher instead.
- Dispatcher makes sure to use a single `CallbackContext` for a entire update. This means that if an update is handled by multiple handlers (by using the group argument), you can add custom arguments to the `CallbackContext` in a lower group handler and use it in higher group handler. NOTE: Never use with run_async, see docs for more info. (:pr:`1283`)
- If you have custom handlers they will need to be updated to support the changes in this release.
- Update all examples to use context based callbacks.
Persistence (:pr:`1017`)
------------------------
- Added PicklePersistence and DictPersistence for adding persistence to your bots.
- BasePersistence can be subclassed for all your persistence needs.
- Add a new example that shows a persistent ConversationHandler bot
Handler overhaul (:pr:`1114`)
-----------------------------
- CommandHandler now only triggers on actual commands as defined by telegram servers (everything that the clients mark as a tabable link).
- PrefixHandler can be used if you need to trigger on prefixes (like all messages starting with a "/" (old CommandHandler behaviour) or even custom prefixes like "" or "!").
Filter overhaul (:pr:`1221`)
----------------------------
- RegexHandler is deprecated and should be replaced with a MessageHandler with a regex filter.
- Use update filters to filter update types instead of arguments (message_updates, channel_post_updates and edited_updates) on the handlers.
- Completely remove allow_edited argument - it has been deprecated for a while.
- data_filters now exist which allows filters that return data into the callback function. This is how the regex filter is implemented.
- All this means that it no longer possible to use a list of filters in a handler. Use bitwise operators instead!
ConversationHandler
-------------------
- Remove ``run_async_timeout`` and ``timed_out_behavior`` arguments (:pr:`1344`)
- Replace with ``WAITING`` constant and behavior from states (:pr:`1344`)
- Only emit one warning for multiple CallbackQueryHandlers in a ConversationHandler (:pr:`1319`)
- Use warnings.warn for ConversationHandler warnings (:pr:`1343`)
- Fix unresolvable promises (:pr:`1270`)
Bug fixes & improvements
------------------------
- Handlers should be faster due to deduped logic.
- Avoid compiling compiled regex in regex filter. (:pr:`1314`)
- Add missing ``left_chat_member`` to Message.MESSAGE_TYPES (:pr:`1336`)
- Make custom timeouts actually work properly (:pr:`1330`)
- Add convenience classmethods (from_button, from_row and from_column) to InlineKeyboardMarkup
- Small typo fix in setup.py (:pr:`1306`)
- Add Conflict error (HTTP error code 409) (:pr:`1154`)
- Change MAX_CAPTION_LENGTH to 1024 (:pr:`1262`)
- Remove some unnecessary clauses (:pr:`1247`, :pr:`1239`)
- Allow filenames without dots in them when sending files (:pr:`1228`)
- Fix uploading files with unicode filenames (:pr:`1214`)
- Replace http.server with Tornado (:pr:`1191`)
- Allow SOCKSConnection to parse username and password from URL (:pr:`1211`)
- Fix for arguments in passport/data.py (:pr:`1213`)
- Improve message entity parsing by adding text_mention (:pr:`1206`)
- Documentation fixes (:pr:`1348`, :pr:`1397`, :pr:`1436`)
- Merged filters short-circuit (:pr:`1350`)
- Fix webhook listen with tornado (:pr:`1383`)
- Call task_done() on update queue after update processing finished (:pr:`1428`)
- Fix send_location() - latitude may be 0 (:pr:`1437`)
- Make MessageEntity objects comparable (:pr:`1465`)
- Add prefix to thread names (:pr:`1358`)