python-telegram-bot/docs/source
Jacob Bom 247577b2e2
Context based callbacks (#1100)
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 :)
2018-05-21 15:00:47 +02:00
..
_static Docs fixes (#765) 2017-08-02 05:56:07 +03:00
conf.py Bump version to v10.1.0 2018-05-05 00:37:13 +03:00
index.rst Fix documentation build to include CHANGES.rst 2018-03-03 01:23:08 +02:00
ptb-logo-orange.ico Add orange favicon 2017-06-07 12:37:29 +02:00
ptb-logo-orange.png [ci skip] docs: add logo to html and pdf builds 2016-11-01 08:09:25 +01:00
ptb-logo_1024.png [ci skip] docs: add logo to html and pdf builds 2016-11-01 08:09:25 +01:00
telegram.animation.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.audio.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.bot.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.callbackgame.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.callbackquery.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.chat.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.chataction.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.chatmember.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.chatphoto.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.choseninlineresult.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.constants.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.contact.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.document.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.error.rst Adding docs 2015-08-11 16:17:38 -03:00
telegram.ext.callbackcontext.rst Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
telegram.ext.callbackqueryhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.choseninlineresulthandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.commandhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.conversationhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.delayqueue.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.dispatcher.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.filters.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.handler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.inlinequeryhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.job.rst Add Job Class to docs (#845) 2017-09-25 20:57:53 +02:00
telegram.ext.jobqueue.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.messagehandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.messagequeue.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.precheckoutqueryhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.regexhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.rst Context based callbacks (#1100) 2018-05-21 15:00:47 +02:00
telegram.ext.shippingqueryhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.stringcommandhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.stringregexhandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.typehandler.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.ext.updater.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.file.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.forcereply.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.game.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.gamehighscore.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinekeyboardbutton.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinekeyboardmarkup.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequery.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresult.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultarticle.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultaudio.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcachedaudio.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcacheddocument.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcachedgif.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcachedmpeg4gif.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcachedphoto.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcachedsticker.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcachedvideo.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcachedvoice.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultcontact.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultdocument.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultgame.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultgif.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultlocation.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultmpeg4gif.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultphoto.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultvenue.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultvideo.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inlinequeryresultvoice.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inputcontactmessagecontent.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inputfile.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inputlocationmessagecontent.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inputmedia.rst add support for 3.5 api (#920) 2017-12-08 22:38:59 +01:00
telegram.inputmediaphoto.rst add support for 3.5 api (#920) 2017-12-08 22:38:59 +01:00
telegram.inputmediavideo.rst add support for 3.5 api (#920) 2017-12-08 22:38:59 +01:00
telegram.inputmessagecontent.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inputtextmessagecontent.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.inputvenuemessagecontent.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.invoice.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.keyboardbutton.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.labeledprice.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.location.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.maskposition.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.message.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.messageentity.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.orderinfo.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.parsemode.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.photosize.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.precheckoutquery.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.replykeyboardmarkup.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.replykeyboardremove.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.replymarkup.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.rst Add missing docs utils (#912) 2018-03-05 12:17:56 +01:00
telegram.shippingaddress.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.shippingoption.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.shippingquery.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.sticker.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.stickerset.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.successfulpayment.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.telegramobject.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.update.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.user.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.userprofilephotos.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.utils.helpers.rst add utils.helpers to docs (#828) 2017-09-25 20:56:28 +02:00
telegram.utils.promise.rst Add missing docs utils (#912) 2018-03-05 12:17:56 +01:00
telegram.utils.request.rst Add missing docs utils (#912) 2018-03-05 12:17:56 +01:00
telegram.utils.rst Add missing docs utils (#912) 2018-03-05 12:17:56 +01:00
telegram.venue.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.video.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.videonote.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.voice.rst Docs update (#728) 2017-07-23 23:33:08 +03:00
telegram.webhookinfo.rst Docs update (#728) 2017-07-23 23:33:08 +03:00