-
Notifications
You must be signed in to change notification settings - Fork 6k
Update CC.__init__ & add example on custom webhooks
#3059
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
harshil21
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
harshil21
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last bit of nitpicks
harshil21
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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