Commit graph

1894 commits

Author SHA1 Message Date
Jasmin Bom
26ce9bb343
Documentation fixes (#1348)
* Clarify InlineKeyboardButton callback-data docstring

Fixes #1267

* Improve documentation slightly

- Prettier changelog
- Link to examples on frontpage
- Link to wiki on frontpage
- Put telegram.ext in own sidebar thingy

* Improve ext.Filters documentation

Superseeds #1089

- Remove `:obj:Filter` as it's pretty obvious that it's a filter since it's in this module. It also made the html output about 1/3 times longer to scroll through.
- Add an __all__ to reorder so Filter is at the top instead of BaseFilter
- Add a proper docstring for document that documents the attributes (this is the #1089 part)
- Also fix a couple of grammar errors.

* Fix indentation in telegram.rst

* Add `git describe --long --tags` to the `python -m telegram` output

* Use admonition for examples to make them *pop* better

* Remove automodule telegram

Sphinx was whining a lot and it doesn't actually seem to be needed in any way?

* Fix Filters.document docstring per CR

Co-Authored-By: jsmnbom <jsmnbom@gmail.com>

* Fix spelling error in docs index

Co-Authored-By: jsmnbom <jsmnbom@gmail.com>

* Setting needs_sphinx to 1.7.9

so we don't have more issues with incongruent versions

* Fixed last warnings

* Make pre-commit happy
2019-02-18 20:04:52 +01:00
Jasmin Bom
39d686b1a1 Tiny spelling fix in CHANGES.rst [ci skip] 2019-02-14 12:31:00 +01:00
Kirill Vasin
60f2044bbd Entry returns None ends conversation (#1270)
* Fix unresolvable promises

* added async test and description

* added test_none_on_first_message for conv_handler

* Small change in ConversationHandler docstring

* Fix test to work with new commandhandler
2019-02-14 12:29:58 +01:00
Jasmin Bom
dda7ca18cd Update CHANGES.rst
Also include #1270 even though not merged yet, but it should be very soon :)
2019-02-14 12:03:20 +01:00
Jasmin Bom
07c51d236b Fix spelling error in example notice 2019-02-14 11:53:09 +01:00
Jasmin Bom
9f1eccf569 Merge branch 'master' into V12 2019-02-14 11:52:31 +01:00
Eldinnie
cd7c642f49
Add WAITING state and behavior (#1344)
* Add WAITING state and behavior

* Remove `run_async_timeout` and `timed_out_behavior` arguments
* replace with `WAITING` constant and behavior from states
* never wait for promise to resolve (will hang up entire update queue
* see #1250 for discussion

* Fixing pytest version to 4.2.0

Pytest 4.2.1 has a weird bug on top level collect in 4.2.1 Fixing version to 4.2.0
2019-02-14 11:00:21 +01:00
Bibo-Joshi
f7abb21323 Adjust persistence on exit behaviour (#1312)
* Adjust persistence of exit behaviour

* Fix binary operators in on_flush

* Fix docstring

* Add test
2019-02-13 23:30:29 +01:00
Eldinnie
7e2dbdd4b3 Fix #1297 (#1342)
* Fix #1297

This makes a deepcopy of the user_data and chat_data dict as suggested by @Bibo-Joshi

* Fix dictpersistence aswel.
2019-02-13 23:28:48 +01:00
Jasmin Bom
b64698e4b6
Use warnings.warn for conversationhandler warnings. (#1343)
* FIXED: ConversationHandler errors were logged to root logger

* Use warnings.warn instead of self.logger.warning.
2019-02-13 23:28:23 +01:00
Ambro
d0936f76ad Only one warning for multiple CallbackqueryHandler's on ConversationHandler (#1319) 2019-02-13 22:08:49 +01:00
Jasmin Bom
da342af7ed Small flake8 fixes 2019-02-13 16:04:48 +01:00
Jasmin Bom
446c54cf8d Bump to version 12.0.0b1 2019-02-13 13:41:04 +01:00
Jasmin Bom
f5bfe2f29c Update example comments and docstrings to note the V12 beta 2019-02-13 13:38:07 +01:00
Eldinnie
b02b68880f Make dispatcher use one context per update (#1283)
* Make dispatcher use one context per update

It gives user the option to `overload` context with their own properties in a lower group handler if they like

* Improve callbackcontext & run_async docstring

- Add note about how you can add custom attributes to context.
- Add warnings about how run_async and custom attributes should not be used together.

* Small documentation improvements. [ci skip]
2019-02-13 12:18:37 +01:00
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