Commit graph

1833 commits

Author SHA1 Message Date
Noam Meltzer
38d6f4d9f2
Inputfile encode filenames (#1086)
* Unitest to recreate issue #1083

* InputFile: Encode unicode filenames

Fixes #1083
2018-04-25 23:13:00 +03:00
Noam Meltzer
1ec12343f0
Add urllib3 fix for socks5h support (#1085)
FIxes #1077
Changes semantics of socks proxy behaviour.
Until now - socks5:// was actually socs5h:// and we didn't really have socks5://
2018-04-25 21:23:48 +03:00
Paul Larsen
b5196f00b2 Add a caption_entity filter for filtering caption entities (#1068)
* Add a caption_entity filter for filtering caption entities

* remove unneeded list comprehensions
2018-04-20 13:24:40 +02:00
Noam Meltzer
39c679e519
Update all appveyor links in README 2018-04-19 16:56:12 +03:00
Noam Meltzer
7a6d2be101
README fixes (#1078)
* Link for the group on the README top

* Fix widget to appveyor build
2018-04-19 16:52:38 +03:00
Dillon Flamand
ef74c525b2 Simplify sentence in examples/README.md (#1061) 2018-04-19 15:20:16 +03:00
Pieter Schutz
6d453b7fa2 Bump to v10.0.2 2018-04-17 09:07:19 +02:00
Rahiel Kasim
716f52684f pypi.python.org -> pypi.org (#1059) 2018-04-17 07:45:05 +03:00
Joel Williams
42497367c1 Correct documentation of Dispatcher.add_handler (#1071) 2018-04-17 07:42:09 +03:00
Jannes Höke
b77b329dd6 Handle utf8 decoding errors (#1076) 2018-04-17 07:40:02 +03:00
Wagner Macedo
5efd5e2586 CommandHandler faster check (#1074)
Fixes #1073
2018-04-17 07:37:29 +03:00
Daniel Reed
cbfb7df643 Explicitly make Bot.full_name return a unicode object, rather than implicitly a unicode object in Python 3 and a str object on Python 2. (#1063) 2018-04-16 10:37:41 +02:00
Or Bin
712baf0c07 Added video note filter (#1067) 2018-04-14 21:53:54 +02:00
Eldinnie
59659eaf5e
Update README.rst 2018-04-09 21:30:37 +02:00
Emilio Molinari
3ccf40e8cc Make chat_id a positional argument inside shortcut methods of Chat and User classes #1048 (#1050)
* Make chat_id a positional argument #1048

* Fixed tests
2018-03-17 00:10:11 +01:00
Jannik
38e3b91a87 Filters for Category and file types (#1046)
* Added extra Filters for File Type and Category

Added extra Filters for File Type and Category, based on the provided Mime-Type

* Added tests for the new Filters

Added Tests for the Category and File Types Filters.

* Fixed Tests

Fixed the Tests from the last commit

* Little Fix

* Revert of unwanted changes

* Update filters.py

* Changed the strings

* Changed file_type to mime_type

* Fixed Tests
2018-03-16 23:41:48 +01:00
Eldinnie
e182046376 Fix in telegram.Message (#1042)
* Fix in telegram.Message

The `_parse_(html|markdown)` methods now properly return `None` on an empty `Message.text` or an empty `Message.caption`

* As per CR
2018-03-16 21:42:39 +01:00
Joscha Götzer
1530ed20e5 New filter: regex (#1028) 2018-03-15 06:59:27 +02:00
Eldinnie
2b221da9b9
extra whitespace needed on header 2018-03-05 13:57:21 +01:00
Pieter Schutz
d9f77d6ee1 Bump to v10.0.1 2018-03-05 12:46:19 +01:00
Eldinnie
698a91427a
Fix conversationhandler timeout (#1032)
* Fix conversationhandler

As found by @nmlorg and described in #1031

closes #1031

* adding another test and definitely finish conversationhandler

It seems another problem was when the job executed the timeout, it wasn;t removed from `self.conversation_timeouts` which made it still fail because job would be present in the handler dict, although it was already disabled.
This should fix it properly.
2018-03-05 12:18:40 +01:00
Jannes Höke
5956aae235 Add missing docs utils (#912)
* add documentation for telegram.utils.promise and .request

* improve documentation for telegram.utils.promise and .request

* add missing 's' to new_chat_member(s) in all docstrings

* fix docs for `set_chat_photo`

[CI skip]
2018-03-05 12:17:56 +01:00
Noam Meltzer
0811f566a2 Bump version to v10.0.0
[ci skip]
2018-03-03 01:23:08 +02:00
Noam Meltzer
69acd2b3bd Fix documentation build to include CHANGES.rst
Use forward slashes instead of the Windows backward slashes.
2018-03-03 01:23:08 +02:00
Noam Meltzer
a6bf456645
Updater improvements (#1018)
- Refactor bootstrap phase to be resilient for network errors
 - Retry bootstrap phase indefinitely (by default) on network errors
 - Improved logs
 - Improved unitests for polling updater

fixes #605
2018-03-02 23:11:16 +02:00
Evgen
811369d1a0 Added conversation timeout in ConversationHandler (#895) 2018-03-01 11:34:47 +02:00
Paul Larsen
b67ea7a691 CommandHandler - ignore strings in entities and "/" followed by whitespace (#1020) 2018-03-01 10:11:16 +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
Eldinnie
b275031a16 Add Message caption html/markdown methods (#1013)
Closes #1010
2018-02-22 17:38:54 +02:00
Eldinnie
a9a503b9c3 Increase timeouts on creation of fixtures in tests (#1015) 2018-02-22 15:13:57 +02:00
Noam Meltzer
3762792cca
Remove deprecated code (#1012)
* JobQueue: Remove deprecated prevent_autostart & put()

* Bot, Updater: Remove deprecated network_delay

* Remove deprecated Message.new_chat_member

closes #795
2018-02-22 14:17:06 +02:00
Eldinnie
36a93e0636
remove codeclimate (#1014)
* remove codeclimate

* Remove codecov PR comments
2018-02-19 21:30:28 +01:00
Noam Meltzer
baec1bb554 flake8 revamp
- Use pre-commit v1.2.0 flake8
 - Make sure we're running flake8 on examples and tests
 - Fix what had to be fixed
2018-02-19 12:41:38 +02:00
Noam Meltzer
746ae0caf3
Get jobs by name (#1011) 2018-02-19 10:36:40 +02:00
Eldinnie
0bed087542 remove unnecessary to_dict() (#834)
We have some objects that have exactly the same to_dict() method, only specifying that `from_user` should be `from` in the `data`-dict. I refractored this logic to `TelegramObject` and removed those to_dicts() from the code.
2018-02-19 10:31:38 +02:00
Unknown
efea0361c5 Fix attribute order error 2018-02-18 18:12:08 +01:00
Noam Meltzer
91ae35e26c
updater.py: Better handling of timeouts during getUpdates (#1007)
TimedOut exception is an expected an normal event. To reduce noise and
make things more "fluent" we now:
 - Make sure that we don't sleep after the timeout but rather retry
immediately.
 - Log debug instead of error level.

Fixes #802
2018-02-18 17:50:38 +02:00
Jacob Bom
ebcc40ae92 More instance methods (#963)
* Bot.get_file now allows passing a file in addition to file_id

* Add .get_file() to Audio, Document, PhotoSize, Sticker, Video, VideoNote and Voice

* Add .send_*() methods to User and Chat
2018-02-18 17:49:52 +02:00
Noam Meltzer
dcb510e62c travis.yml: Removed pypy3.5
Travis keeps failing on weird INTERNAL ERROR messages and it just fails
the build. I don't see any other choice but to disable pypy3.5 tests.
2018-02-18 17:41:45 +02:00
Jannik
c152d6583e Support v3.6 API (#1006)
* Added support for new field `telegram.Message.connected_message`

* Added support for new field `telegram.Message.connected_message`

* Added support for parse_mode in captions

* Added parse_mode parameter for captions in InlineQueryResult*

* Added supports_streaming parameter in telegram.Bot.send_video and telegram.InputMediaVideo
Fixed Docstrings for parse_mode in captions

* pypy3.5 unitests are now running with a new version due internal errors on travis.

closes #1005
2018-02-18 17:11:04 +02:00
Joscha Götzer
9338dc4697 Added utils.helpers.effective_message_type (#826) 2018-02-15 11:21:19 +02:00
Daniel Reed
063704c0b9 Explicitly check update.effective_chat in ConversationHandler.check_update (#959)
Fixes #927
2018-02-12 16:09:51 +02:00
Oleg
62e76f1fba bot.py: Add shortcut method reply_media_group (#994)
fixes #936
2018-02-12 15:51:18 +02:00
Joscha Götzer
f0dfdfb203 bot.py: Add shortcut methods reply_{markdown,html} (#827) 2018-02-12 15:39:46 +02:00
Willem
c19e464324 README.md: Fixed link to paymentbot example (#983)
[ci skip]
2018-02-12 15:32:35 +02:00
Eldinnie
d5c9212f2e Add two arguments to send_invoice (#986)
Telegram silently added `send_phone_number_to_provider` and `send_email_to_provider` to the send_invoice method.
2018-02-10 17:54:09 +02:00
Noam Meltzer
8690ba256e
webhookhandler: Fix exception thrown during error handling (#985)
BaseServer.handle_error() default behaviour is to print to stdout or
stderr (depends on the python version). In case that the file descriptor
is closed an additional exception will be raised, causing the webhook
thread to quit.

Fixes #970
2018-01-25 10:42:48 +02:00
Noam Meltzer
d6b47da593 Update code of conduct (#980)
* Update code of conduct

* fix typo [ci skip]

* remove ending periods [ci skip]
2018-01-20 18:17:06 +01:00
Noam Meltzer
ddf3a1fcad
jobqueue: Thread safety fixes (#977)
- Fix JobQueue.jobs to obtain a lock on the internal queue object prior
   to iterating over it.

 - Rename JobQueue.queue to JobQueue._queue. This shouldn't be
   accessible by the user directly, but rather only with sanitized
   thread safe methods.

 - JobQueue.interval_seconds - access self.interval only once to avoid
   race conditions.

Fixes #968
2018-01-20 15:27:01 +02:00
Eldinnie
820f4e1d59 Fix user profile photo unitests (#967)
Telegram changed something again.
2018-01-09 17:56:43 +02:00