Update CC.__init__ & add example on custom webhooks#3059
Merged
Bibo-Joshi merged 7 commits intomasterfrom Jun 3, 2022
Merged
Conversation
harshil21
requested changes
May 29, 2022
Member
harshil21
left a comment
There was a problem hiding this comment.
Finally reviewed- I failed to get the webhook working on my local machine, so couldn't test the Telegram updates part. The other endpoints work fine though.
harshil21
reviewed
May 30, 2022
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
This was referenced Jun 3, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This example does three things:
chat/user_idtoCallbackContext.__init__, which allows users to associate custom updates with users/chatsApplication. This also showcases a health endpoint and how to handle custom updates. Thus closes Add health endpoint - 405 Method not allowed #1438 and closes Make it easier to handle webhooks manually, by providing a convience setup method for dispatcher #1258.I chose
starlette+uvicornfor the example b/c i recently worked with those for a private project, so I recalled the mechanics. Pool suggested to usetornadobecause PTB requires that anyway. However, we are already considereding to switching to a different library (#2966) and in the end the example is basically independent of which webserver framework is used. If both harshil and pool strongly disagree with using starlette + uvicorn in the example, I'm open to rewriting.Checklist for PRs
.. versionadded:: version,.. versionchanged:: versionor.. deprecated:: versionto the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)Created new or adapted existing unit tests- no needAUTHORS.rst(optional)__all__s