Skip to content

Commit d7f6ff3

Browse files
committed
[version] new rc version 3.0.0-rc.1
1 parent 7eb6f62 commit d7f6ff3

6 files changed

Lines changed: 69 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,33 @@
33

44
> NOTE: pywa follows the [semver](https://semver.org/) versioning standard.
55
6+
#### 3.0.0-rc.1 (2025-07-31)
7+
8+
- [templates] refactored and improved templates support
9+
- [calls] added full support for calls
10+
- [user_preferences] added full support for user preferences
11+
- [server] continued handling if listener is not using the update
12+
- [system] moved `system` messages to `PhoneNumberChange` and `IdentityChange` updates
13+
- [client] forced keyword-only for context args in `send_message`, `send_image`, and other `send_...` methods
14+
- [types] returned `SuccessResult` instead of `bool` to allow future extension with other attributes
15+
- [client] `upload_media` returns `Media` object
16+
- [client] added `get_business_phone_number_settings` and `update_business_phone_number_settings` to get and update calling settings
17+
- [client] added `update_display_name` method to update the WhatsApp display name
18+
- [security] fixed XSS vulnerability
19+
- [api] suggest to provide custom `httpx.Client` on `httpx.RequestError`
20+
- [handlers] added `on_completion` decorator to flow request callback wrapper
21+
- [errors] show more descriptive error messages
22+
- [base_update] added `waba_id` for all user updates
23+
- [message] added `referral` field
24+
- [types] support `is_on_biz_app` in `BusinessPhoneNumber`
25+
- [client] added `delete_media` method
26+
- [listeners] check if `server` exists before starting to listen
27+
- [utils] handled enum values case-sensitively
28+
- [utils] returned `FlowRequestDecryptedMedia` instead of `(media_id, filename, data)` tuple
29+
- [utils] new `APIObject` to get fields from datacls
30+
- [deprecations] removed attrs and types marked as deprecated
31+
32+
633
### 2.11.0 (2025-06-17) **Latest**
734

835
- [flows] adding support for `ImageCarousel`

MIGRATION.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,50 @@
22
----------------
33

44
- [Migration](#migration)
5+
- [Migration from 2.x to 3.x](#migration-from-2x-to-3x)
6+
- [New features](#new-features)
7+
- [Breaking changes](#breaking-changes)
8+
- [Migration steps](#migration-steps)
59
- [Migration from 1.x to 2.x](#migration-from-1x-to-2x)
610
- [New features](#new-features)
711
- [Breaking changes](#breaking-changes)
812
- [Migration steps](#migration-steps)
913

14+
## Migration from 2.x to 3.x
15+
16+
17+
### New features
18+
19+
- [templates] Refactored and improved templates support. The templates are now flexible, reusable, extensible, easier to use and more powerful.
20+
- [calls] Added full support for calls. You can now make and receive calls, manage calls, handle call events, configure call settings, and more.
21+
- [user_preferences] Added full support for user preferences. You can now listen to user marketing preferences - if the user has opted in or out of marketing messages, and act accordingly.
22+
- [server] Continued handling if listener is not using the update. If a listener does not use the update (not filtered or not cancelled), the server will continue to handle the update and pass it to the handlers.
23+
- [system] Moved `system` messages to `PhoneNumberChange` and `IdentityChange` updates. The `system` messages are now handled as separate updates, allowing you to focus on real user messages and events.
24+
- [client] Forced keyword-only for context args in `send_message`, `send_image`, and other `send_...` methods. This change improves readability and consistency of the API.
25+
- [types] Returned `SuccessResult` instead of `bool` to allow future extension with other attributes. The `SuccessResult` object acts as boolean, but can also contain additional information about the success of the operation.
26+
- [client] `upload_media` returns `Media` object. The `Media` object contains the media ID so you can use it later to send the media or perform other operations.
27+
- [client] Added `update_display_name` method to update the WhatsApp display name. This method allows you to change the display name of your WhatsApp account.
28+
- [handlers] Added `on_completion` decorator to flow request callback wrapper. This decorator allows you to register a callback that will be called when the flow request is completed.
29+
- [errors] Show more descriptive error messages. The error messages now provide more context and information about the error, making it easier to debug and fix issues.
30+
- [base_update] Added `waba_id` for all user updates. The `waba_id` is the WhatsApp Business Account ID that received the update, allowing you to identify the account that the update belongs to.
31+
- [message] Added `referral` field. When a customer clicks an ad that redirects to WhatsApp and starts a chat, the `referral` field contains information about the ad that was clicked.
32+
- [client] Added `delete_media` method. This method allows you to delete media files from WhatsApp servers.
33+
34+
35+
### Breaking changes
36+
37+
- [templates] The templates system has been completely redesigned. The old templates are no longer supported, and you need to update your code to use the new templates system (create and send)
38+
- [server] The server now continues to handle updates even if the listener does not use the update. This means that if a listener does not filter or cancel the update, the server will pass it to the handlers (unless you call `update.stop_handling()` inside the listener filters/cancelers).
39+
- [client] The `upload_media` method now returns a `Media` object instead of a string (media ID). The `Media` object contains the media ID and allows you to perform actions on the media, such as downloading or deleting it. If you using the media ID directly to send media - you don't need to change anything, just use the `Media` object instead of the string. if you stored the media ID in a database or somewhere else, you will need to update your code to use the `Media.id` attribute instead of the string media ID.
40+
- [client] The `send_message`, `send_image`, and other `send_...` methods now require keyword-only arguments for context. This change improves readability and consistency of the API. This context arguments are `reply_to_message_id`, `sender` etc. Most of users don't need to change anything, but if you are using positional arguments for these context args (they are located at the end of the method signature, so the chance for breaking is low), you will need to update your code to use keyword arguments.
41+
- [types] The `SuccessResult` object is now returned instead of a boolean value. This change allows for future extension of the `SuccessResult` object with additional attributes, such as error messages or additional information about the success of the operation. If you are using the return value of methods like `mark_as_read`, `indicate_typing`, etc., if you just checking if the operation was successful, you can continue to use it as a boolean. but if you storing the result in a database or forcing the result to be a boolean, you will need to update your code to use the `SuccessResult.success` attribute instead of the boolean value.
42+
- [system] The `system` messages are now handled as separate updates, and the `PhoneNumberChange` and `IdentityChange` updates are used instead. This change allows you to focus on real user messages and events, and handle system messages separately. If you were accessing the `system` attribute of the `Message` object, you will need to update your code to start listening to the `PhoneNumberChange` and `IdentityChange` updates instead.
43+
- [utils] The `FlowRequestDecryptedMedia` object is now returned instead of a tuple `(media_id, filename, data)`. This change allows you to access the media ID, filename, and data in a more structured way. If you were using the tuple to access the media ID, filename, and data, you will need to update your code to use the `FlowRequestDecryptedMedia` object instead.
44+
45+
### Migration steps
46+
47+
IN PROGRESS
48+
1049
## Migration from 1.x to 2.x
1150

1251

pywa/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
from pywa.client import WhatsApp
1010
from pywa.utils import Version
1111

12-
__version__ = "2.11.0"
12+
__version__ = "3.0.0-rc.1"
1313
__author__ = "David Lev"
1414
__license__ = "MIT"

pywa/types/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Message(BaseUserUpdate):
6060
location: The location of the message.
6161
contacts: The contacts of the message.
6262
order: The order of the message.
63-
referral: The referral information of the message (if any).
63+
referral: The referral information of the message (When a customer clicks an ad that redirects to WhatsApp).
6464
error: The error of the message.
6565
shared_data: Shared data between handlers.
6666
"""

pywa/utils.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,6 @@ def inner(func: Callable):
482482
return inner
483483

484484

485-
def listener_identifier(sender: str | int, recipient: str | int) -> tuple[str, str]:
486-
"""Create a unique identifier for a listener."""
487-
return str(sender), str(recipient)
488-
489-
490485
def is_async_callable(obj: Any) -> bool:
491486
"""Check if an object is an async callable."""
492487
while isinstance(obj, functools.partial):

pywa_async/types/message.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class Message(BaseUserUpdateAsync, _Message):
5757
location: The location of the message.
5858
contacts: The contacts of the message.
5959
order: The order of the message.
60-
referral: The referral information of the message (if any).
60+
referral: The referral information of the message (When a customer clicks an ad that redirects to WhatsApp).
6161
error: The error of the message.
6262
shared_data: Shared data between handlers.
6363
"""

0 commit comments

Comments
 (0)