* Add deepsource config
* Update Badges
* Update Badges some more
* Stupid change to trigger analysis of all files
* Try to get ignore right
* Update badges again
* Get started on fixing issues
* Fix some more issues
* Remove more plank lines
* Docs for de_json/list & to_dict/json
* Some improvements from deepcode.ai
* Some more improvements
* Some more improvements
* More docstrnigs & let's run DS on the tests just for fun
* Autofix issues in 10 files
Resolved issues in the following files via DeepSource Autofix:
1. tests/conftest.py
2. tests/test_bot.py
3. tests/test_commandhandler.py
4. tests/test_conversationhandler.py
5. tests/test_dispatcher.py
6. tests/test_filters.py
7. tests/test_inputmedia.py
8. tests/test_messagehandler.py
9. tests/test_official.py
10. tests/test_persistence.py
* Some more improvements for tests, but that shall be enough
* Some more docstrings for functions
* Some minor stuff, try to fix tests
* Update DS config
* Still more docs
* Doc fixes
* More fixes
* Fix: indent docstring
* Some fixes
* Revert "Stupid change to trigger analysis of all files"
This reverts commit dd46c260
* Review
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
* Change default handling, update signatures, get existing tests to pass.
* Try running tests on ubuntu 18.04
* Roll back
* Rework check_shortcut_call tests
* Further improve check_shortcut_call tests
* Start on defaults-checks for shortcuts, get it working for test_message
* Add check_shortcut_defaults to all other shortcut tests
* Some fine tuning
* Add defaults checking for bot methods
* Missing tests for TestCallbackQuery
* Test edit_message_media with defaults & some comments
* Fix cryptography requirement
* drop debug prints
* Remove debug prints
* Another try
* Try to fix coverage & logs
* Rearrange test order
* increase coverage
* Try to fix coverage reports
* address review
* Adapt tests like in #2386
* fix CI
* fix CI
* Render-fixes for BP
* docs: fix simple typo, submition -> submission (#2260)
There is a small typo in tests/test_bot.py.
Should read `submission` rather than `submition`.
* Type on rawapibot.py docstring
* typo
* Typo: Filters.document(s)
* Typo fix
* Doc fix for messageentity (#2311)
* Add New Shortcuts to Chat (#2291)
* Add shortcuts
* Add a note
* Add run_async Parameter to ConversationHandler (#2292)
* Add run_async parameter
* Update docstring
* Update test to explicitly specify parameter
* Fix test job queue
* Add version added tag to docs
* Update docstring
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
* Doc nitpicking
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: Hinrich Mahler <hinrich.mahler@freenet.de>
* Fix rendering in messageentity
Co-authored-by: Bibo-Joshi <hinrich.mahler@freenet.de>
Co-authored-by: zeshuaro <joshuaystang@gmail.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
* fix: type hints for TelegramError
changed :class:`telegram.TelegramError` to :class:`telegram.error.TelegramError`
* fix: the error can be more then just a Telegram error
* Doc fix for inlinekeyboardbutton.py
added missing colon which broke rendering
* fix: remove context argument and doc remark
look at us already being in post 12
* use rtd badge
* filters doc fixes
* fix some rendering
* Doc & Rendering fixes for helpers.py
Co-authored-by: Tim Gates <tim.gates@iress.com>
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Co-authored-by: zeshuaro <joshuaystang@gmail.com>
Co-authored-by: Poolitzer <25934244+Poolitzer@users.noreply.github.com>
Co-authored-by: Harshil <ilovebhagwan@gmail.com>
* Make pre-commit more strict
* Get pylint to read setup.cfg
* Make pylint & mypy happy aka ignore all the things
* use LogRecord.getMessage() in tests
* Make noam happy
* Update both pylint & mypy while we're at it
* Bring reqs-dev and makefile up to speed
* try making pre-commit happy
* fix jobqueue tests on the fly
* Update notes on editing messages
* Update thumb and InputMedia* doc strings
* Fix attribute docstring for Updater.user_sig_handler
* Improve rendering for CCs attributes
* fix doc str for InputMedia*.media attribute
* Minor fix
* Update AUTHORS.rst
* Update AUTHORS.rst
* Add bot_data to CallbackContext as global memory
* Minor fixes in docstrings
* Incorp. req. changes, Flake8 Fixes
* Persist before stop
* Fix CI errors
* Implement #1342 for bot_data
* Add check pickle_persistence_only_bot similar to #1462
* Fix test_persistence
* Try dispatching error before logging it
* Fix test
Co-authored-by: Eldinnie <Eldinnie@users.noreply.github.com>
* raise attribute errors when someone tries to assign values to chat/user_data (closes#1402)
* fix test
* something something not switching entirely and using a messy patch and no not anymore and argh
* 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]
* 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]
* Commandhandler reworked
* Make CommandHandler strict
Only register valid botcommands, else raise ValueError
* Add PrefixHandler
* declare encoding on test_commandhandler
* Fix some tests dependend on CommandHandler
* CR changes
* small docfix.
* Test all possibilities for PrefixHandler
See https://github.com/python-telegram-bot/python-telegram-bot/wiki/Transition-guide-to-Version-11.0 under Context based callbacks and Filters in handlers for a good guide on the changes in this commit.
* Change handlers so context is supported
* Attempt to make parameter "guessing" work on py < 3.5
* Document use_context in all handlers
* Add Context to docs
* Minor fixes to context handling
* Add tests for context stuff
* Allow the signature check to work on py<3.5 with methods
* Fix order of operations
* Address most issues raised in CR
* Make CommandHandler no longer support filter lists
* Fix indent
(pycharm can be an arse sometimes)
* Improve readability in conversationhandler
* Make context have Match instead of groups & groupdict
* Remove filter list support from messagehandler too
* Small fix to StringCommandHandler
* More small fixes to handlers
* Amend CHANGES
* Fix tests and fix bugs raised by tests
* Don't allow users to ignore errors without messing with the warning filters themselves
* Ignore our own deprecation warnings when testing
* Skipping deprecationwarning test on py2
* Forgot some changes
* Handler: Improved documentation and text of deprecation warnings
* HandlerContext: Keep only dispatcher and use properties; improved doc
* Complete fixing the documentation.
- Fixes per Eldinnie's comments.
- Fixes per warnings when running sphinx.
* Some small doc fixes (interlinks and optionals)
* Change add_error_handler to use HandlerContext too
* More context based changes
Context Based Handlers -> Context Based Callbacks
No longer use_context args on every single Handler
Instead set dispatcher/updater .use_context=True to use
Works with
- Handler callbacks
- Error handler callbacks
- Job callbacks
Change examples to context based callbacks so new users are not confused
Rename and move the context object from Handlers.HandlerContext to CallbackContext, since it doesn't only apply to handlers anymore.
Fix tests by adding a new fixture `cpd` which is a dispatcher with use_context=True
* Forgot about conversationhandler
* Forgot jobqueue
* Add tests for callbackcontext & for context based callback job
* Fix as per review :)