Commit graph

9 commits

Author SHA1 Message Date
Jasmin Bom
09bdb88822
Bot api 4.1 (#1198)
* Fix passport decryption failing at random times

Sometimes a decrypted secret was being treated as b64 and therefore got decoded even further. Fix by decoding b64 right before call to decrypt so we have better control of when not to do it

* Bot api 4.1

Telegram passport 1.1
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

NOTE: Scope stuff is NOT implemented, as we wanna STRONGLY encourage users to use the telegram provided SDKs anyway (and not generate telegram auth links in their bot, but rather on a server)

* Minor fixes

* Add hash to EncryptedPassportElement

For use with PassportElementErrorUnspecified apparently
2018-09-01 16:58:08 +02:00
Eldinnie
4689a80c2e Bot API 4.0 (#1168)
Telegram Passport (#1174):

- Add full support for telegram passport.
    - 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 is automagically decrypted when you specify your private key when creating Updater or Bot.
    - PassportFiles is also automagically decrypted as you download/retrieve them.
- 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`.

Inputfile rework (#1184):

- Change how Inputfile is handled internally
- 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)
    - Cashtag seems to be things like $USD and $GBP, but it seems telegram doesn't currently send them to bots.
    - Phone number also seems to have limited support for now
- Add Bot.send_animation, add width, height, and duration to Animation, and add Filters.animation. (#1172)


Co-authored-by: Jasmin Bom <jsmnbom@gmail.com>
Co-authored-by: code1mountain <32801117+code1mountain@users.noreply.github.com>
Co-authored-by: Eldinnie <pieter.schutz+github@gmail.com>
Co-authored-by: mathefreak1 <mathefreak@hi2.in>
2018-08-29 14:18:58 +02:00
Noam Meltzer
f6332d45a8
Improved File.download (#1019)
- File.download_as_bytearray - new method to get a d/led file as bytearray
   This is much more convenient and straight forward than using a file
   object.

 - File.download(): Now returns a meaningful return value

 - File.download*(): New and/or better unitests
2018-03-01 10:10:04 +02:00
Jacob Bom
2ca7ff82ef Update headers to 2018 (#962)
Also add two missing headers.
[ci skip]
2018-01-04 17:16:06 +02:00
Noam Meltzer
e018445513 Documentation update to PEP (#797) 2017-09-01 08:43:08 +02:00
Eldinnie
b3b94240a5 Docs update (#728)
Amazing new documentation.
2017-07-23 23:33:08 +03:00
Ihor Polyakov
08d298eb60 TelegramObject.de_json became classmethod (#737)
Fixes #734
2017-07-23 22:14:38 +03:00
Noam Meltzer
ebb2556176 Fix download of URLs with UTF-8 chars in path
refs #650
2017-06-24 11:10:43 +03:00
Jacob Bom
5c2893111a Move a lot of files 2017-06-18 12:35:00 +02:00
Renamed from telegram/file.py (Browse further)