Skip to content

Commit

Permalink
[version] new version! 2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
david-lev committed Jan 2, 2025
1 parent 38da4dc commit 84df2d5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@

> NOTE: pywa follows the [semver](https://semver.org/) versioning standard.
### 2.5.0 (2025-01-02) **Latest**

### 2.4.0 (2024-12-14) **Latest**
- [handlers] adding `on_init`, `on_data_exchange` and `on_back` decorators for flow request callback wrapper
- [flows] `FlowRequest.respond` defaults to request flow token
- [flows] adding `FlowRequest.token_no_longer_valid` shortcut
- [flows] deprecate `FlowRequest.is_health_check` and `FlowRequestActionType.PING`


### 2.4.0 (2024-12-14)

- [sent_message] adding `SentTemplate` with `SentTemplateStatus`
- [flows] adding `pattern` for `TextInput`
Expand Down
2 changes: 1 addition & 1 deletion pywa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
from pywa.client import WhatsApp
from pywa.utils import Version

__version__ = "2.4.0"
__version__ = "2.5.0"
__author__ = "David Lev"
__license__ = "MIT"
12 changes: 6 additions & 6 deletions pywa/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def on(
Args:
action: The action type to listen to.
screen: The screen ID to listen to (if screen is not provided, the handler will be called for all screens for this action!).
screen: The screen to listen to (if screen is not provided, the handler will be called for all screens for this action!).
filters: A filter function to apply to the incoming request.
Returns:
Expand All @@ -625,7 +625,7 @@ def on_init(
"""
Decorator to add a handler for the :class:`FlowRequestActionType.INIT` action.
- This request arrives when the flow **sent** with action type of :class:`FlowRequestActionType.DATA_EXCHANGE`.
- This request arrives when the :class:`~pywa.types.callback.FlowButton` sent with action_type of :class:`FlowRequestActionType.DATA_EXCHANGE`.
Example:
Expand Down Expand Up @@ -691,11 +691,11 @@ def on_data_exchange(
... ...
>>> @feedback_flow_handler.on_data_exchange(screen="SURVEY", filters=filters.new(lambda _, r: r.data["rating"] == "5"))
>>> def on_data_exchange(_: WhatsApp, req: FlowRequest) -> FlowResponse:
>>> def on_survey_with_rating_5(_: WhatsApp, req: FlowRequest) -> FlowResponse:
... return req.respond(...)
Args:
screen: The screen ID to listen to (if screen is not provided, the handler will be called for all screens for this action!).
screen: The screen to listen to (if screen is not provided, the handler will be called for all screens for this action!).
filters: A filter function to apply to the incoming request.
call_on_error: Whether to call the handler when the request has an error (The return value of the callback will be ignored).
Expand Down Expand Up @@ -731,7 +731,7 @@ def on_back(
"""
Decorator to add a handler for the :class:`FlowRequestActionType.BACK` action.
- This request arrives when the user clicks the back button in the WhatsApp client and the flows screen's ``refresh_on_back`` is set to ``True``.
- This request arrives when the user clicks the back button in the WhatsApp client and the flows screen ``refresh_on_back`` is set to ``True``.
- This callback must return a :class:`~pywa.types.flows.FlowResponse` object, a :class:`dict` or to raise :class:`~pywa.types.flows.FlowResponseError` subclass.
Example:
Expand All @@ -747,7 +747,7 @@ def on_back(
... return req.respond(...)
Args:
screen: The screen ID to listen to (if screen is not provided, the handler will be called for all screens for this action!).
screen: The screen to listen to (if screen is not provided, the handler will be called for all screens for this action!).
filters: A filter function to apply to the incoming request.
Returns:
Expand Down

0 comments on commit 84df2d5

Please sign in to comment.