python-telegram-bot
16.2K subscribers
91 links
The official channel for the python-telegram-bot library | https://python-telegram-bot.org
Download Telegram
We've just released v10.0.1!

TL;DR
Fixed an error on the new ConversationHandler timout argument.

- As always, upgrade using pip install python-telegram-bot -U

Fixes:

- Fix conversationhandler timeout (PR #1032)
- Add missing docs utils (PR #912)
We've just released v10.0.2!

As always, upgrade using pip install python-telegram-bot -U

Important fix:
- Handle utf8 decoding errors (#1076)

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

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

We wish to thank everyone who had contributed to this release. Happy upgrades everyone!
We've just released v10.1.0!

As always, upgrade using pip install -U python-telegram-bot

Fixes changing previous behaviour:

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

Fixes:

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

We wish to thank everyone who had contributed to this release. Happy upgrades everyone!
We've just released v11.0.0!

As always, upgrade using pip install -U python-telegram-bot

This update brings full support for Bot API 4.0!
We are working as hard as we can on Bot API 4.1, expect it soon!

Add full support for telegram passport (#1174):
- New types: PassportData, PassportFile, EncryptedPassportElement, EncryptedCredentials, PassportElementError, PassportElementErrorDataField, PassportElementErrorFrontSide, PassportElementErrorReverseSide, PassportElementErrorSelfie, PassportElementErrorFile and PassportElementErrorFiles.
- New bot method: set_passport_data_errors
- New filter: Filters.passport_data
- Field passport_data field on Message
- PassportData can be easily decrypted.
- PassportFiles are automatically decrypted if originating from decrypted PassportData.
- See new passportbot.py example for details on how to use, or go to our telegram passport wiki page for more info
NOTE: Passport decryption requires new dependency cryptography.

Change how Inputfile is handled internally (#1184):
- This allows support for specifying the thumbnails of photos and videos using the thumb= argument in the different send_ methods.
- Also allows Bot.send_media_group to actually finally send more than one media.
- Add thumb to Audio, Video and Videonote
- Add Bot.edit_message_media together with InputMediaAnimation, InputMediaAudio, and inputMediaDocument.

Other Bot API 4.0 changes:
- Add forusquare_type to Venue, InlineQueryResultVenue, InputVenueMessageContent, and Bot.send_venue. (#1170)
- Add vCard support by adding vcard field to Contact, InlineQueryResultContact, InputContactMessageContent, and Bot.send_contact. (#1166)
- Support new message entities: CASHTAG and PHONE_NUMBER. (#1179)
- Add Bot.send_animation, add width, height, and duration to Animation, and add Filters.animation. (#1172)

Non Bot API 4.0 changes:
- Minor integer comparison fix (#1147)
- Fix Filters.regex failing on non-text message (#1158)
- Fix ProcessLookupError if process finishes before we kill it (#1126)
- Add t.me links for User, Chat and Message if available and update User.mention_* (#1092)
- Fix mention_markdown/html on py2 (#1112)

We wish to thank everyone who had contributed to this release. Happy upgrades everyone!
We've just released v11.1.0!

As always, upgrade using pip install -U python-telegram-bot

This update contains fixes and updates for Telegram Passport: (#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

The wiki page for Telegram Passport has also been updated to reflect the changes :)

Happy upgrades everyone!
Hi, We're trying to get a picture of the number of users that use pypy in combination with python-telegram-bot. We're considering dropping support, but don't want to when we have a significant number of users that use PTB on pypy. So please vote below so w
anonymous poll

I don't use pypy with ptb – 518
πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘πŸ‘ 82%

I use pypy with PTB – 114
πŸ‘πŸ‘ 18%

πŸ‘₯ 632 people voted so far.
Message is cut off. Last sentence should be:
So please vote below so we can get a clear picture on usage.
It is finally time for a new release of python-telegram-bot, this time it's version 12.0.0b1!

For the first time ever we have decided to do a beta release, since it has been so long since last release that we would like to test the impact before a final release.

We do NOT recommend using this beta release in production.

Major 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

Since this is a beta release we have chosen to not list all changes here. See CHANGES.rst for a full list of the changes.

This release has numerous backwards incompatible changes. See the wiki page at https://git.io/fxJuV for a detailed guide on how to migrate from version 11 to version 12.

Since this is beta release it will not automatically be installed by pip. Instead you should do pip install python-telegram-bot==12.0.0b1 to explicitly request the new version.
Well... This felt like decades. But here we are with a new release: V12.0.0 !!!

Expect minor releases soon (mainly complete Bot API 4.4 support)

We're delighted to have 3 new developers in our team:
@BiboJoshi , @Poolitzer & @Nukesor
Some of them had already contributed to this release.

As usual, upgrade using: pip install -U python-telegram-bot

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
- Return UTC from from_timestamp()

See the wiki page at https://git.io/fxJuV for a detailed guide on how to migrate from version 11 to version 12.

See the CHANGES.rst file on our github page for more details.
As promised, we bring you API 4.4 support!

We've just released v12.1.0
Thanks for anyone who've contributed to this release.

As usual upgrade using pip install -U python-telegram-bot

Major changes:

* Bot API 4.4 support (#1464, #1510)
* Add get_file method to Animation & ChatPhoto. Add get_small_file & get_big_file methods to ChatPhoto (#1489)
* Tools for deep linking (#1049)

Minor changes and/or bug fixes:

* Documentation fixes (#1500, #1499)
* Improved examples (#1502)
We've just released v12.1.1

This is an hotfix release for #1517

As usual upgrade using pip install -U python-telegram-bot
Forwarded from Poolitzer X
Fellow programmers.

Happy #hacktoberfest. This event, hosted over here, is about giving back to open source projects. We encourage you all to check it out and make some contributions. We prepared some issues by ourself, they can be found here, but fear not to take on other issues in our repo.

If you have any questions, feel free to ask them away in our chats, we are there to help!
We've just released v12.2.0
Thanks for anyone who've contributed to this release.

As usual upgrade using pip install -U python-telegram-bot

New features:

- Nested ConversationHandlers (#1512).

Minor changes, CI improvments or bug fixes:

- Fix CI failures due to non-backward compat attrs depndency (#1540).
- travis.yaml: TEST_OFFICIAL removed from allowed_failures.
- Fix typos in examples (#1537).
- Fix Bot.to_dict to use proper first_name (#1525).
- Refactor test_commandhandler.py (#1408).
- Add Python 3.8 (RC version) to Travis testing matrix (#1543).
- test_bot.py: Add to_dict test (#1544).
- Flake config moved into setup.cfg (#1546).
Hi all,

As you might know python 2.7.x will reach its end of life on January 1st 2020. We will follow this by also stopping support for python 2.7. Commits made to the library after this date will no longer be tested for version 2.7 support and python 3.x specific features will be accepted in PRs.
Be advised that if you're still using python 2.7 and you want to keep using our library in the new year, it's time for you to move on.
We've just released v12.3.0
Thanks for anyone who've contributed to this release.

As usual upgrade using pip install -U python-telegram-bot

New features:
- Filters.caption allows only messages with caption (#1631).
- Filter for exact messages/captions with new capability of Filters.text and Filters.caption. Especially useful in combination with ReplyKeyboardMarkup. (#1631).

Major changes:
- Fix inconsistent handling of naive datetimes (#1506).

Minor changes, CI improvments or bug fixes:
- Documentation fixes (#1558, #1569, #1579, #1572, #1566, #1577, #1656).
- Add mutex protection on ConversationHandler (#1533).
- Add MAX_PHOTOSIZE_UPLOAD constant (#1560).
- Add args and kwargs to Message.forward() (#1574).
- Transfer to GitHub Actions CI (#1555, #1556, #1605, #1606, #1607, #1612, #1615, #1645).
- Fix deprecation warning with Py3.8 by vendored urllib3 (#1618).
- Simplify assignements for optional arguments (#1600)
- Allow private groups for Message.link (#1619).
- Fix wrong signature call for ConversationHandler.TIMEOUT handlers (#1653).
We've just released v12.4.0
Thanks for anyone who've contributed to this release.

As usual, upgrade using pip install -U python-telegram-bot

New features:

- Set default values for arguments appearing repeatedly. We also have a [wiki page for the new defaults](https://github.com/python-telegram-bot/python-telegram-bot/wiki/Adding-defaults-to-your-bot). (#1490)
- Store data in CallbackContext.bot_data to access it in every callback. Also persists. (#1325)
- Filters.poll allows only messages containing a poll (#1673)

Major changes:

- Filters.text now accepts messages that start with a slash, because CommandHandler checks for MessageEntity.BOT_COMMAND since v12. This might lead to your MessageHandlers receiving more updates than before (#1680).
- Filters.command new checks for MessageEntity.BOT_COMMAND instead of just a leading slash. Also by Filters.command(False) you can now filters for messages containing a command anywhere in the text (#1744).

Minor changes, CI improvements or bug fixes:

- Add disptacher argument to Updater to allow passing a customized Dispatcher (#1484)
- Add missing names for Filters (#1632)
- Documentation fixes (#1624, #1647, #1669, #1703, #1718, #1734, #1740, #1642, #1739, #1746)
- CI improvements (#1716, #1731, #1738, #1748, #1749, #1750, #1752)
- Fix spelling issue for encode_conversations_to_json (#1661)
- Remove double assignement of Dispatcher.job_queue (#1698)
- Expose dispatcher as property for CallbackContext (#1684)
- Fix None check in JobQueue._put() (#1707)
- Log datetimes correctly in JobQueue (#1714)
- Fix false Message.link creation for private groups (#1741)
- Add option --with-upstream-urllib3 to setup.py to allow using non-vendored version (#1725)
- Fix persistence for nested ConversationHandlers (#1679)
- Improve handling of non-decodable server responses (#1623)
- Fix download for files without file_path (#1591)
- test_webhook_invalid_posts is now considered flaky and retried on failure (#1758)
Quick release v12.4.1

#1744 was accidentally left out of v12.4.0 though mentioned in the release notes.
Now this PR is merged.

Upgrade using: pip install -U python-telegram-bot
Bug fixes release 12.4.2

Thanks for bringing these to our attention:

* Pass correct parse_mode to InlineResults if bot.defaults is None (#1763)
* Make sure PicklePersistence can read files that dont have bot_data (#1760)

Upgrade using: pip install -U python-telegram-bot
We've just released v12.5
Thanks for anyone who've contributed to this release.

As usual, upgrade using pip install -U python-telegram-bot

New Features:

- Bot.link gives the t.me link of the bot (#1770)

Major Changes:

- Bot API 4.5 and 4.6 support. (#1508, #1723)

Minor changes, CI improvements or bug fixes:

- Remove legacy CI files (#1783, #1791)
- Update pre-commit config file (#1787)
- Remove builtin names (#1792)
- CI improvements (#1808, #1848)
- Support Python 3.8 (#1614, #1824)
- Use stale bot for auto closing stale issues (#1820, #1829, #1840)
- Doc fixes (#1778, #1818)
- Fix typo in edit_message_media (#1779)
- In examples, answer CallbackQueries and use edit_message_text shortcut (#1721)
- Revert accidental change in vendored urllib3 (#1775)