1.23.0
What's Changed
Update with pip:
pip3 install -U pywa
- [client] allowing to manage multiple numbers from the same client (Partner solutions)
- [flows] adding
.respond()
shortcut forFlowRequest
- [flows] allowing body in
FlowResponseError
subclasses
from pywa import WhatsApp, types, filters
wa = WhatsApp(token="xyzxyz", ...) # `phone_id` is now optional
wa.send_message(
sender=..., # now you can specify sender
to=...,
text="Hello from PyWa!"
)
@wa.on_message(filters.text.command("start"))
def on_start(_: WhatsApp, msg: types.Message):
if msg.recipient == ...: # or check the recipient
...
elif msg.recipient == ...:
...
msg.reply(...) # .reply() is automatically replaying to the sender
from pywa import WhatsApp, types
wa = WhatsApp(...)
@wa.on_flow_request("/my-flow")
def my_flow_handler(_: WhatsApp, req: types.FlowRequest) -> types.FlowResponse:
return req.respond( # instead of instantiating FlowResponse with req.version
screen="SIGN_UP",
data={}
)
Full Changelog: 1.22.0...1.23.0