Commit graph

1879 commits

Author SHA1 Message Date
Eldinnie
2c5eade4f0 Update Filters, CommandHandler and MessageHandler (#1221)
* update_filter attribute on filters

Makes it possible to have filters work on an update instead of message, while keeping behavior for current filters

* add update_type filter

* Messagehandler rework

- remove allow_edited (deprecated for a while)
- set deprecated defaults to None
- Raise deprecation warning when they're used
- add sensible defaults for filters.
- rework tests

* Commandhandler rework

* Remove deprecation test from new handler

* Some tweaks per CR

- rename update_types -> updates
- added some clarification to docstrings

* run webhook set test only on 3.6 on appveyor

* update_filter attribute on filters

Makes it possible to have filters work on an update instead of message, while keeping behavior for current filters

* add update_type filter

* Messagehandler rework

- remove allow_edited (deprecated for a while)
- set deprecated defaults to None
- Raise deprecation warning when they're used
- add sensible defaults for filters.
- rework tests

* Commandhandler rework

* Remove deprecation test from new handler

* Some tweaks per CR

- rename update_types -> updates
- added some clarification to docstrings

* run webhook set test only on 3.6 on appveyor

* Changes per CR

* Update travis to build v12

* small doc update

* try to make ci build version branches

* doc for BaseFilter

* Modify regexfilter and mergedfilter

Now returns a list of match objects for every regexfilter

* Change callbackcontext (+ docs)

* integrate in CommandHandler and PrefixHandler

* integrate in MessageHandler

* cbqhandler, iqhandler and srhandler

* make regexhandler a shell over MessageHandler

And raise deprecationWarning on creation

* clean up code and add some comments

* Rework based on internal group feedback

- use data_filter instead of regex_filter on BaseFilter
- have these filters return a dict that is then updated onto CallbackContext instead of using a list is before
- Add a .match property on CallbackContext that returns .matches[0] or None

* Fix and add test for callbackcontext.match

* Lots of documentation fixes and improvements [ci skip]
2019-02-13 12:07:25 +01:00
Jasmin Bom
950ec35970
Remove message decorator to fix default timeouts. (#1156)
* Remove message decorator to fix default timeouts.

* Make message wrapper method private.

* Make tests pass

* Fix callbackquery shortcuts

Closes #1180

* Fix callbackquery shortcut tests

* Fix merge

* Address CR

* Add missing default timeout=20 for some bot file uploads

* Fix wrong return value in convhandler

Probably stems from a combination of bad merge plus quickly merged hacktoberfest PR.
2019-02-13 11:37:13 +01:00
Jasmin Bom
d33e1d9913 Small flake8 fix 2019-02-09 18:45:34 +01:00
Jasmin Bom
2e203e41e4 Merge branch 'master' into V12 2019-02-09 18:45:00 +01:00
Jasmin Bom
e54a3188ce Revert "Fix bug: unable to save jobs with timezone aware dates (#1308)"
This reverts commit 23fe991b

See https://github.com/python-telegram-bot/python-telegram-bot/pull/1308 for more details.

NOTE: Keeping Ambro17 in AUTHORS.rst as I'm pretty sure they've contributed more since then :)
2019-02-09 18:44:04 +01:00
Jasmin Bom
710f43a23a travis: Use xenial dist for pypy
Cryptography started complaning about old openssl - hopefully xenial has a newer version
2019-02-09 18:26:17 +01:00
Jasmin Bom
27b757df32 Reorder some stickset tests to hopefully make them pass 2019-02-09 18:21:12 +01:00
Jasmin Bom
66e43c5932 Fix a bunch of flake8 W504 errors 2019-02-08 20:55:40 +01:00
Jasmin Bom
7fcbfc19f5 Mark location sending test as xfail as it seems to fail randomly 2019-02-08 20:22:44 +01:00
Jasmin Bom
a60c07f549 Update test animation size
Telegram must've again chagned internal stuff
2019-02-08 20:21:24 +01:00
Jasmin Bom
1b52e6148e Merge branch 'master' into V12 2019-02-08 12:49:28 +01:00
Ambro
487bce18dd Improve regex filter docstring and avoid compiling compiled regex (#1314)
* Improve regex docstring and add test case

* Add Ambro17 as contributor

* rename regex filter

* Fix sphinx documentation for Filters.regex

* Add spacing to render Note with blue background
2019-02-08 11:12:49 +01:00
Gregory Petukhov
5c45e469d5 Fix #1335: Message.MESSAGE_TYPES does not contain "left_chat_member" (#1336) 2019-02-08 11:02:54 +01:00
Jasmin Bom
25e5449e97 Fix TestDispatcher::test_error_handler using pytest >= 4.0 2019-01-30 20:56:15 +01:00
Jasmin Bom
a8bade4d73 Fix a bunch of tests
Looks like it's once again time for: Telegram changed some weird internal stuff and how thumbnails take up either 4 times as much space or half as much space. Oh and they also seemingly randomized the width and height of said thumbnails....
2019-01-30 20:40:53 +01:00
Jasmin Bom
e08afe7fb2 Fix flake8 errors that only show in CI?? 2019-01-30 20:20:35 +01:00
Jasmin Bom
9817310788 Reflow docstrings in replykeyboardmarkup to satisfy flake8 2019-01-30 19:50:33 +01:00
Jasmin Bom
ed33c4a7a9 Merge remote-tracking branch 'origin/master' 2019-01-30 19:45:37 +01:00
Jasmin Bom
1ee53e9e17 Updating the pylint that pre-commit uses
Fixes #1321
2019-01-30 19:42:57 +01:00
Gregory Petukhov
3e8d71582d Fix #1328: custom timeout argument does not work (#1330)
* Fix #1328: custom timeout argument does not work

* Remove unused import
2019-01-30 19:38:15 +01:00
Tanuj
c03160c07f Add convenience classmethods for InlineKeyboardMarkup (fixes #1186) (#1260)
* Add convenience classmethods for InlineKeyboardMarkup (#1186)

* Switch to row and column methods

* Also add convenience classmethods for ReplyKeyboardMarkup

* Add some simple tests
2019-01-04 21:04:45 +01:00
Ambro
23fe991b85 Fix bug: unable to save jobs with timezone aware dates (#1308)
* Fix bug on jobs with timezone aware dates

* Add Ambro17 as colaborator
2019-01-04 20:29:07 +01:00
Bibo-Joshi
7eeb670a59 Fix check for effective chat/user in persistence (#1303) 2018-12-05 00:12:43 +01:00
Bibo-Joshi
f23298a13b Fix typos in telegram/bot.py (#1305) 2018-12-04 15:06:48 +01:00
Konstantin Zemlyak
92f407bfb3 Update setup.py (#1306) 2018-12-04 15:06:22 +01:00
Steve Sandke
0cf0cccbc5 Fix description for JobQueue's run_daily and run_repeating methods. (#1299) 2018-11-22 13:03:58 +01:00
Jasmin Bom
378784f55e
Fix persistence with non telegram.Update updates (#1271)
* Allow persistence with no telegram.Update updates

For use with TypeHandler

* Add test
2018-11-09 11:44:20 +01:00
Pieter Schutz
384173115f Merge branch 'master' into V12 2018-11-01 11:45:51 +01:00
Pieter Schutz
ea5b301b59 fix pre-commit hooks 2018-11-01 11:08:09 +01:00
Pieter Schutz
9b66681ee4 fix pre-commit hooks 2018-11-01 11:08:09 +01:00
Pieter Schutz
92e7427689 Merge remote-tracking branch 'origin/master' 2018-11-01 10:53:46 +01:00
Pieter Schutz
f82ceee777 Merge remote-tracking branch 'origin/master' 2018-11-01 10:53:46 +01:00
Pieter Schutz
d2e2fe9ccc fix last flake8 errors 2018-11-01 10:52:36 +01:00
Pieter Schutz
76a72e9742 fix last flake8 errors 2018-11-01 10:52:36 +01:00
Noam Meltzer
cf69a234d4 fix accidental commit to submodule config 2018-11-01 11:25:52 +02:00
Noam Meltzer
eaf6dc2b88 fix accidental commit to submodule config 2018-11-01 11:25:52 +02:00
Noam Meltzer
9596343efd pep8 fixes 2018-11-01 11:18:07 +02:00
Noam Meltzer
30cc0f8cf9 pep8 fixes 2018-11-01 11:18:07 +02:00
Pieter Schutz
f252436cd4 Merge remote-tracking branch 'origin/master' into V12 2018-11-01 09:32:55 +01:00
Jasmin Bom
c9630ee8c5
Add Conflict error (HTTP error code 409) (#1154)
* Add conflicting bot id to conflict error message.

* Add test and comment to conflict error

* Don't extract bot id in Conflict exception per PR comments
2018-10-29 22:08:52 +01:00
Eldinnie
9d99660ba9 Change MAX_CAPTION_LENGTH to 1024 (#1262)
* update MAX_CAPTION_LENGTH

Telegram silently changed the max length for captions to 1024 chars.

* Update test_constants.py

* change docstrings to reflect new length

* remove message

* clear message and proper match
2018-10-16 19:51:57 +02:00
Jasmin Bom
eca0ccf6b3 Update tests to support new test bots 2018-10-14 12:15:27 +02:00
Pavel Shakhov
9ece7fdb1c Mistake in MessageQueue.__call__'s docstring (#1249) 2018-10-08 15:36:59 +02:00
Evan Haberecht
4861d1a20d Removed unneccessary else and replaced with comment (#1247)
* Resolved issue #1163: Removed unneccessary else and replaced with comment

* Added myself to AUTHORS.rst
2018-10-08 08:18:33 +02:00
simonvorobjev
dbf364e168 Allowed to use Handlers on conversation timeout (#1217)
* handler for ConversationHandler.END (timeout one) #1136

* review fixes

* review fixes

* review fixes

* review fixes

* docs and tests

* fixing stuff

* Fix problem

* fix conftest

* now it should work

* Add ConversationTimeoutContext

As discussed in the developers group. Use a class as the jobs context over using a dict.

* less verbosity
2018-10-04 08:58:40 +02:00
dbxnr
d6d0dec6e0 remove extra else clause (#1239)
Fix #1236
2018-10-02 11:29:30 +02:00
Eldinnie
0bbca65a95
add sleep to bailout error test (#1241)
Hopefully it won;t hit the race condition so often on appveyor
2018-10-02 09:00:38 +02:00
Holden Oullette
1d715f0d36 Removed empty quotes (#1237) 2018-10-01 23:29:46 +02:00
Eldinnie
f6f8667d6c
add codacy badge to readme (#1232) 2018-10-01 22:16:48 +02:00
Pieter Schutz
8731365911 Merge branch 'master' into V12 2018-10-01 21:12:21 +02:00