Skip to content

Conversation

@Bibo-Joshi
Copy link
Member

This example does three things:

  1. Teach me that windows defender blocks you from accessing webservers on your machine if your current network is marked as "public" 🤦
  2. add parameters chat/user_id to CallbackContext.__init__, which allows users to associate custom updates with users/chats
  3. Add an example on how to set up a custom webhook thingy in combination with Application. 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 + uvicorn for the example b/c i recently worked with those for a private project, so I recalled the mechanics. Pool suggested to use tornado because 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

  • Added .. versionadded:: version, .. versionchanged:: version or .. deprecated:: version to the docstrings for user facing changes (for methods/class descriptions, arguments and attributes)
  • Created new or adapted existing unit tests - no need
  • Documented code changes according to the CSI standard
  • Added myself alphabetically to AUTHORS.rst (optional)
  • Added new classes & modules to the docs and all suitable __all__ s

@Bibo-Joshi Bibo-Joshi added enhancement ⚙️ examples affected functionality: examples labels May 21, 2022
@Bibo-Joshi Bibo-Joshi added this to the v20.0a1 milestone May 21, 2022
@Bibo-Joshi Bibo-Joshi requested review from Poolitzer and harshil21 May 21, 2022 12:39
Copy link
Member

@harshil21 harshil21 left a 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.

Bibo-Joshi and others added 2 commits May 30, 2022 18:34
Co-authored-by: Harshil <37377066+harshil21@users.noreply.github.com>
Copy link
Member

@harshil21 harshil21 left a 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

Copy link
Member

@harshil21 harshil21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Bibo-Joshi Bibo-Joshi merged commit 4227633 into master Jun 3, 2022
@Bibo-Joshi Bibo-Joshi deleted the cct-init branch June 3, 2022 14:55
@github-actions github-actions bot locked and limited conversation to collaborators Jun 10, 2022
@Bibo-Joshi Bibo-Joshi added 🔌 enhancement pr description: enhancement and removed enhancement labels Nov 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

🔌 enhancement pr description: enhancement ⚙️ examples affected functionality: examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add health endpoint - 405 Method not allowed Make it easier to handle webhooks manually, by providing a convience setup method for dispatcher

3 participants