๐ Changelog#
NOTE: pywa follows the semver versioning standard.
2.6.0 (2025-01-11) Latest#
[base_update] adding
shared_datato help sharing context between handlers & filters[flows] adding
FlowStr- A helper class to create strings containing vars and math expressions without escaping and quoting them
2.5.2 (2025-01-07)#
[handlers] sub-handlers ignoring flow requests with errors when
call_on_errorset to False[handlers] fix
WhatsApp.on_flow_requeston class level to mark theFlowRequestHandlerinstance[callback] callback data generic can be
str
2.5.1 (2025-01-02)#
[project] hot fix to include missing files in the package
2.5.0 (2025-01-02)#
[handlers] adding
on_init,on_data_exchangeandon_backdecorators for flow request callback wrapper[flows]
FlowRequest.responddefaults to request flow token[flows] adding
FlowRequest.token_no_longer_validshortcut[flows] deprecate
FlowRequest.is_health_checkandFlowRequestActionType.PING
2.4.0 (2024-12-14)#
[sent_message] adding
SentTemplatewithSentTemplateStatus[flows] adding
patternforTextInput[flows] adding support for
NavigationList[flows] defaulting actionโs payload to empty dict
[flows] deprecating
ActionNextandActionNextType
2.3.0 (2024-11-30)#
[client] allowing to specify the callback url scope
[client] expose methods to override callback url in waba and phone scopes
[flows] typing
DataSourceto acceptRefs
2.2.0 (2024-11-29)#
[flows] adding
ScreenDataUpdateto use inUpdateDataAction[flows] using math operators between math objs
[flows] renaming
ActionNexttoNextandActionNextTypetoNextType
2.1.0 (2024-11-24)#
[flows] adding
CalendarPickercomponent[flows] allow string concatenation with refs
[flows] adding support for math expressions
[flows] allowing to use condition in
visible[flows] new action: open url
[flows] new action: update data
[flows]
init_valueavailable outside form[flows] allow to use
screen/refas shortcut for.ref_in(screen)[flows] separating
Actionand addingon_unselect_action
2.0.5 (2024-11-10)#
[client] fix
send_templatereturn typeSentMessage
2.0.4 (2024-11-08)#
[client] fix
reply_to_message
2.0.3 (2024-11-02)#
[client] override
_flow_req_cls[handlers] descriptive repr for
Handler
2.0.2 (2024-10-30)#
[server] rely on update hash instead of update id to avid duplicate updates
2.0.1 (2024-10-30)#
[server] fix skip update in process (async)
2.0.0 (2024-10-30)#
BREAKING CHANGES!! READ THE MIGRATION GUIDE
[listeners]: Listeners are a new way to handle incoming user updates (messages, callbacks, etc.). They are more flexible, faster, and easier to use than handlers.
[sent_message]: The
SentMessageobject returned bysend_message,send_image, etc., contains the message ID and allows to act on the sent message with methods likereply_x,wait_for_xetc.[filters]: Filters are now objects that can be combined using logical operators. They are more powerful and flexible than the previous filter system.
[handlers] allow to register callbacks without WhatsApp instance
[flows] allow pythonic conditionals in
Ifcomponent[flows]: A new method
FlowCompletion.get_media(types.Image, key="img")allows you to construct a media object and perform actions like.download()on it.[flows]: Decrypt media directly from FlowRequest using
.decrypt_media(key, index).[flows] rename
.data_keyand.from_refto.ref[client]: The client can run without a token but wonโt allow API operations (only webhook listening).
[callback] allow to override callback data id
[utils] bump graph-api version to
21.0
1.26.0 (2024-09-22)#
[flows] adding support of
RichText[flows] adding support of
markdowninTextBodyandTextCaption[flows] adding
sensitiveattr to Screen, allowing to hide specific fields from the response summary[client] adding
reply_to_messagearg tosend_location,request_location,send_sticker, andsend_audio[message] adding
reply_location_request
1.25.0 (2024-08-15)#
[handlers] adding priority
[client] adding QR methods (create update get and delete)
[client] adding
get_flow_metricsmethod[flows] adding to
DataSourcesupport for images/colors[flows] support
datetimeobjs inDatePicker[flows] support
Screenwhen using.data_key_of(...)and.form_ref_of(...)[flows] update flow json with indent and without ensuring ascii
[flows] adding
health_statustoFlowDetails
1.24.0 (2024-07-26)#
[server] validating
X-Hub-Signature-256header[requirements] removing
requests[server] default callback url registration delay to 3 sec
1.23.0 (2024-07-14)#
[client] allowing to manage multiple numbers from the same client (Partner solutions)
[flows] adding
.respond()shortcut forFlowRequest[flows] allowing body in
FlowResponseErrorsubclasses
1.22.0 (2024-06-16)#
[handlers] introducing
FlowRequestCallbackWrapperto help split flow endpoint logic to multiple handlers[client] adding
add_flow_request_handlermethod to registerFlowRequestHandlers[flows] pop
flow_tokenfromFlowCompletion.response[docs] update examples
1.21.0 (2024-06-14)#
[flows] added new components
PhotoPicker,DocumentPicker,IfandSwitch[flows] added
.data_key_ofand.form_ref_ofto refer from other screens[flows] added
descriptiontoCheckboxGroupand toRadioButtonsGroup[utils] adding
flow_request_media_decryptorfunction to decrypt medias from flow requests[client] allow updating flow application id with
update_flow_metadata[server] remove event loop
[docs] update examples
[version] bump
FLOW_JSONversion to4.0
1.20.2 (2024-06-02)#
[server] improve continue/stop handling
1.20.1 (2024-06-02)#
[api] fix downloading media content-type
1.20.0 (2024-06-02)#
[client] adding official support for async (limited support for now)
1.19.0-rc.3 (2024-05-23)#
[api] fix uploads
[server] expose
webhook_challenge_handler,webhook_update_handlerandflow_request_handler
1.19.0-rc.2 (2024-05-17)#
[client] adding
skip_duplicate_updateswhen callbacks take too long to return (~25s), defaults to True[client,handlers] allow to override
continue_handling[message] fix async constructors
[api] remove
requests_toolbeltfrom deps[handlers] fix dynamic field name when
factory_before_filters
1.19.0-rc.1 (2024-05-08)#
[async] adding beta support for async!
1.18.1 (2024-05-05)#
[client] fix document filename
1.18.0 (2024-05-02)#
[client] allow to modify token and remove handlers/callbacks
[tests] test client methods
1.17.0 (2024-04-30)#
[client,message_status] Added param
trackerto all send-message-methods in order to track the message status, allowing to passCallbackDatasubclasses totrackerparam[client,api] adding
update_conversational_automationandget_business_phone_numberto add and getcommands,ice_breakersand enableChatOpenedevents[filters] adding
send_to_mefilters shortcut andreplays_tofilters. mark as deprecated all match-specific-type filters and create genericmatches,regexfilters for all text containing updates[flows] adding
updated_attoFlowDetails[message] fix
from_userin system messages[errors] adding optionals
error_subcodeandtypeto all errors[logging] improve loggers performance
[utils] bump graph api version to 19.0 and expose
Versionin the package level[docs] switch readme to markdown
1.16.2 (2024-02-15)#
[client] fix sending single contact
[filters] prioritize
/over!infilters.command(...)andfilters.is_command
1.16.0 (2024-01-22)#
[chat_opened] adding a new type:
ChatOpened[server] improve handlers and logs
[types] warning on missing enum constant
[flows] handle cases where there is no
flow_tokeninFlowCompletion(When the flow completion sent from iOS)[tests] adding more tests
1.15.0 (2024-01-14)#
[client] Added
register_phone_numbermethod[client] mark the
bodyarg in send image/video/doc as deprecated. usecaptioninstead[utils] bump
FLOW_JSONversion to 3.1[flows] allow
DataSourceinFlowResponsedata[flows]
Image.src can be dynamic[flows] default
ActionNextto SCREEN[flows] adding
.successfor screen and adding in-docs examples
1.14.0 (2024-01-01)#
[flows] define
Forminit_valuesfrom childreninit_value[flows] adding a new
ScreenDatatype to be used in screen.data[flows] adding
.form_refand.form_ref_of(form_name)to form components[docs] adding s real-world example for a complex flow
1.13.0 (2023-12-22)#
[flows] adding full support for WhatsApp Flows!
[client] adding
request_locationmethod toWhatsAppclient[base_update] adding
.rawattr to hold the original update[utils] adding
Versionto provide the latest versions to the api & flows, and to perform min checks
1.13.0-rc.6 (2023-12-20)#
[utils] adding
Versionto provide the latest versions to the api & flows, and to perform min checks
1.13.0-rc.5 (2023-12-18)#
[flows] add supported types for Layout and Form
.childrenand fix FlowPreview.expires_at[webhook] validate
cryptographyis installed when using the default flows decryptor/encryptor
1.13.0-rc.4 (2023-12-16)#
[client] expose
set_business_public_key[flows] adding
DataKeyandFormRefto use when building aFlowJSON[template] adding support to create and send template with
FlowButton[errors] remove
FlowInvalidError(Too broad error code)
1.13.0-rc.3 (2023-12-15)#
[errors] adding flows specific errors
[flows] allow to
@on_flow_requestcallbacks to return or raiseFlowResponseErrorsubclasses
1.13.0-rc.2 (2023-12-14)#
[base_update] adding
.rawattr to hold the original update[requirements] set
cryptographyas extra dependency
1.13.0-rc.1 (2023-12-14)#
[flows] Adding beta support for WhatsApp Flows!
1.12.1 (2023-11-29)#
[filters] adding new filter called
sent_toto filter updates even ifWhatsApp(..., filter_updates=False)[webhook] renaming route callbacks names to allow multiple
WhatsAppinstances to use the same server[message_type] default missing to
UNKNOWN[bugs] fix bug on interactive message without data
1.12.0 (2023-11-20)#
[reply_to_msg] adding
ReferredProductto message context[filters] adding filter for messages that has
referred_productin their context[types] unfrozen editable types
[base_update] hash updates by their update ID
[client] adding
dl_sessionparam of typerequests.Sessionto.upload_mediawhen uploading locally from URL[errors] adding more
templateandflowexceptions; fix typo inTooManyMessages
1.11.1 (2023-11-07)#
[reaction] hot-fix for reaction when โunreactingโ to a message
[filters] adding
.extensions(...)filter for all media filters
1.11.0 (2023-11-01)#
[callback] adding support for
Optional[x]annotation inCallbackDatasubclasses[media] allowing to pass
pathlib.Pathas a media file path[system] make all fields nullable in system update
1.10.0 (2023-10-29)#
[template] adding support for
OtpType.ZERO_TAPin new authentication template[callback] adding support for optional fields in
CallbackData[tests] update
CallbackDatatests
1.9.0 (2023-10-25)#
[handlers] add
StopHandlingto raise if you want to stop handling the update[errors] include
requests.Responsewith all api errors[client] mark
keyboardargument in.send_messageas deprecated. usebuttonsinstead
1.8.0 (2023-10-20)#
[webhook] allow to register callback url by @david-lev in #18
1.7.3 (2023-10-18)#
[callback] Treat the Templateโs
QuickReplyButtonDataas an incomingCallbackButton(Reported by @bcombes in #17)[handlers] adding
@functools.wrapsto all on_x decorators to preserve callbacks metadata
1.7.2 (2023-10-12)#
[reply] reply to
CallbackButton.id instead of to.reply_to_messageby @yehuda-lev in #16[callback] change default
CallbackDataseparators to unused characters (ยถfor clb sep,~for data sep andยงfor True boolean
1.7.1 (2023-10-12)#
[callback] hot-fix for last booleans fields on
CallbackData(WhatsApp Cloud API consider โ1: โ and โ1:โ as duplicate datas)
1.7.0 (2023-10-12)#
[types] new
ButtonUrltype[client] allowing to provide
mime_typewhen sending media as bytes, open file or file path without extensions
1.6.0 (2023-10-11)#
[handlers] apply callback data factory before filters by setting
factory_before_filtersto True when registering the handler
1.5.4 (2023-10-08)#
[template] fix media key
1.5.3 (2023-10-03)#
[webhook] faster field-to-handler matching
[message-status] make
.pricing_modeloptional
1.5.2 (2023-10-03)#
[callback] better typing for
callback_dataandfactory
1.5.1 (2023-10-02)#
[build] Fix package imports
1.5.0 (2023-10-02)#
[callback] allowing to override separators in
CallbackDatasubclasses[tests] starting to adding tests
[message] reaction messages are also replays (.is_reply)
[api] bump api version to 18.0
[template] new update type -
TemplateStatus; remove deprecated headers[build] move to
pyproject.toml[docs] tips and improvements
1.4.1 (2023-09-12)#
[reaction] Fix ReactionFilter and TextFilter by @yehuda-lev in #12
1.4.0 (2023-09-10)#
[callback] allowing to provide
factoryto construct callback data (ButtonandSelection) into custom object.[callback] adding type-safe
CallbackDatainterface in order to send and receive typed callback data.[webhook] add protocols for supported web frameworks.
1.3.0 (2023-09-06)#
[template] adding support for
CopyCodeButtonand addLanguageenum for better typing[filters] adding
from_countriesfilter[typing] fix typos by @nallon in #10
1.2.0 (2023-08-21)#
[template] adding support for
MPMButtonandCatalogButton.[template] rename and mark as deprecated template headers.
1.1.0 (2023-08-20)#
[template] adding support for sending and creating template messages
[errors] adding more errors
1.0.0 (2023-08-16)#
FIRST STABLE RELEASE - VERSION 1.0.0