Commit graph

24 commits

Author SHA1 Message Date
Harshil
1724212458
Improve Backwards Compatibility of TelegramObjects Pickle Behavior (#3382)
Co-authored-by: Hinrich Mahler <22366557+Bibo-Joshi@users.noreply.github.com>
2022-11-24 12:11:37 +01:00
Poolitzer
636654cb71
Split File.download Into File.download_to_drive And File.download_to_memory (#3223) 2022-11-02 08:28:41 +01:00
Bibo-Joshi
6ded9cc25c
Drop InputFile.is_image (#3053) 2022-05-29 14:35:26 +02:00
Bibo-Joshi
42eaa67fd5 Switch to asyncio (#2731)
Co-authored-by: tsnoam <tsnoam@gmail.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
2022-05-06 18:19:15 +02:00
Bibo-Joshi
0cb8d50aea Accept File Paths for Updater/DispatcherBuilder.private_key (#2724) 2022-05-06 18:19:12 +02:00
Harshil
a35ecf4065
API 5.7 (#2881) 2022-02-02 21:05:46 +01:00
Bibo-Joshi
ae9ce60b55
API 5.0 (#2181)
Co-authored-by: poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
2020-11-29 16:20:46 +01:00
Bibo-Joshi
1cd3a0a156
Handle Non-Binary File Input (#2202)
* Don't fail if stream is not bytes

* move logger

* Refactor InputFile.is_image

* Use f-strings

* some clean up
2020-11-24 20:31:34 +01:00
Bibo-Joshi
d63e710784
API 4.7 (#1858)
* Pure API changes

* Address review

* set Bot.commands on successfull call of set_my_commands

* Get started on tests

* More tests!

* More Coverage!

* Reset changes in utils.request

* Filters.dice, Filters.dice.text

* more coverage

* Address review

* Address review

* Test stop_poll with reply_markup

* Test stop_poll also without reply_markup

* Rephrase note on 'dice'

* Fix grammar in note on Filters.dice

* update api version readme

* address review
2020-04-10 19:22:45 +02:00
Noam Meltzer
4328eaefb2
Fix test_photo.py (#1479)
Telegram had changed their server behaviour again
2019-08-24 01:10:30 +03:00
Jasmin Bom
4c66ba3a8d
Allow filenames without dots in them when sending files (#1228)
* Fix issue 1227 by allowing filenames without dots in them

* Touch new test data file

* Satisfy flake8
2018-09-30 12:07:17 +02:00
Jasmin Bom
e247fa7c2c
Fix uploading files with unicode filenames (#1214)
* Patch urllib3RequestField to make it *not* support RFC2231

* Add new required test data file

* Fix on py2

* Remove weird legacy code from inputfile

Not needed anymore, and also makes it not work... so that was not great
2018-09-10 21:08:05 +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
Jacob Bom
5d7c6ad541 Switch to pytest + required fixes to code (#788)
Required fixes:
 - CallbackQuery is now comparable.
 - Message.effective_attachment, Message.photo,
   Message.new_chat_members, Message.new_chat_photo &
   Game.text_entitties semantic fixes - when they are not defined,
   return an empty list.
 - Docstring fix to Update class.
2017-08-12 00:58:41 +03:00
Eldin
28836b7735 stickerfile added 2017-06-22 17:45:06 +02:00
Eldin
85e52f1930 delete test file 2017-06-21 19:02:36 +02:00
Eldin
976ad1b987 new shorter audiofile 2017-06-21 19:01:20 +02:00
Eldin
1f9f3ae8a1 shorter mp3 file 2017-06-21 18:55:59 +02:00
Eldin
0afb38f45c Fix video_note tests
Added a video_note to send.
2017-06-09 12:27:10 +03:00
azogue
84b59c8cb2 unittest sending non standard jpg photo with bytesio stream 2017-05-29 09:38:02 +02:00
Jacob Bom
d1ddfaddf0 Add tests for Game, Animation and sendGame.
Still need setGameScore (I'm thinking we can set it to the ever increasing
envvar 'TRAVIS_BUILD_NUMBER') and getGameHighScores.
The tests currently don't work... Since I don't really understand how
PhotoSize works... Please halp :P
2016-10-07 23:57:10 +02:00
Leandro Toledo
a539a0c3a5 Add data object for sendPhoto tests 2016-01-11 22:11:29 -02:00
Leandro Toledo
48bf6bfab0 Adding telegram.gif for testing purposes 2016-01-11 20:20:57 -02:00
Leandro Toledo
0f924508f7 Fix tests and minor changes 2015-08-28 13:02:02 -03:00