Python-telegram-bot

Latest version: v21.7

Safety actively analyzes 682416 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 10 of 23

12.0.0

================
*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`)

12.0.0b1

-------------------------

- Fix setting bot on ShippingQuery (:pr:`1355`)
- Fix _trigger_timeout() missing 1 required positional argument: 'job' (:pr:`1367`)
- Add missing message.text check in PrefixHandler check_update (:pr:`1375`)
- Make updates persist even on DispatcherHandlerStop (:pr:`1463`)
- Dispatcher force updating persistence object's chat data attribute(:pr:`1462`)

Internal improvements
---------------------

- Finally fix our CI builds mostly (too many commits and PRs to list)
- Use multiple bots for CI to improve testing times significantly.
- Allow pypy to fail in CI.
- Remove the last CamelCase CheckUpdate methods from the handlers we missed earlier.
- test_official is now executed in a different job

11.1.0

==============
*Released 2018-09-01*

Fixes and updates for Telegram Passport: (:pr:`1198`)

- Fix passport decryption failing at random times
- Added support for middle names.
- Added support for translations for documents
- Add errors for translations for documents
- Added support for requesting names in the language of the user's country of residence
- Replaced the payload parameter with the new parameter nonce
- Add hash to EncryptedPassportElement

11.0.0

==============
*Released 2018-08-29*

10.1.0

==============
*Released 2018-05-02*

Fixes changing previous behaviour:

- Add urllib3 fix for socks5h support (:pr:`1085`)
- Fix send_sticker() timeout=20 (:pr:`1088`)

Fixes:

- Add a caption_entity filter for filtering caption entities (:pr:`1068`)
- Inputfile encode filenames (:pr:`1086`)
- InputFile: Fix proper naming of file when reading from subprocess.PIPE (:pr:`1079`)
- Remove pytest-catchlog from requirements (:pr:`1099`)
- Documentation fixes (:pr:`1061`, :pr:`1078`, :pr:`1081`, :pr:`1096`)

10.0.2

==============
*Released 2018-04-17*

Important fix:

- Handle utf8 decoding errors (:pr:`1076`)

New features:

- Added Filter.regex (:pr:`1028`)
- Filters for Category and file types (:pr:`1046`)
- Added video note filter (:pr:`1067`)

Fixes:

- Fix in telegram.Message (:pr:`1042`)
- Make chat_id a positional argument inside shortcut methods of Chat and User classes (:pr:`1050`)
- Make Bot.full_name return a unicode object. (:pr:`1063`)
- CommandHandler faster check (:pr:`1074`)
- Correct documentation of Dispatcher.add_handler (:pr:`1071`)
- Various small fixes to documentation.

Page 10 of 23

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.