Releases: david-lev/pywa
Releases Β· david-lev/pywa
1.19.0-rc.2
What's Changed
Update with pip:
pip3 install -U pywa==1.19.0-rc.2
- [client] adding
skip_duplicate_updates
when callbacks take too long to return (~25s), defaults to True - [client,handlers] allow to override
continue_handling
- [message] fix async constructors
- [api] remove
requests_toolbelt
from deps - [handlers] fix dynamic field name when
factory_before_filters
Full Changelog: 1.19.0-rc.1...1.19.0-rc.2
1.19.0-rc.1
What's Changed
Update with pip:
pip3 install -U pywa==1.19.0-rc.1
- [async] adding beta support for async!
from pywa_async import WhatsApp, types # Import from `pywa_async` instead of `pywa`
wa = WhatsApp(...)
@wa.on_message(filters.media)
async def echo_media(_: WhatsApp, message: types.Message):
await message.copy(to=message.sender)
Full Changelog: 1.18.1...1.19.0-rc.1
1.18.1
What's Changed
Update with pip:
pip3 install -U pywa
- [client] fix document filename
Full Changelog: 1.18.0...1.18.1
1.18.0
What's Changed
Update with pip:
pip3 install -U pywa
- [client] allow to modify token and remove handlers/callbacks
- [tests] test client methods
Full Changelog: 1.17.0...1.18.0
1.17.0
What's Changed
Update with pip:
pip3 install -U pywa
- [client,message_status] Added param
tracker
to all send-message-methods in order to track the message status, allowing to passCallbackData
subclasses totracker
param - [client,api] adding
update_conversational_automation
andget_business_phone_number
to add and getcommands
,ice_breakers
and enableChatOpened
events - [filters] adding
send_to_me
filters shortcut andreplays_to
filters. mark as deprecated all match-specific-type filters and create genericmatches
,regex
filters for all text containing updates - [flows] adding
updated_at
toFlowDetails
- [message] fix
from_user
in system messages - [errors] adding optionals
error_subcode
andtype
to all errors - [logging] improve loggers performance
- [utils] bump graph api version to 19.0 and expose
Version
in the package level - [docs] switch readme to markdown
from pywa import WhatsApp, types, filters
wa = WhatsApp(...)
wa.send_message(
to="972123456789",
text="Hello from pywa!",
tracker="my_tracker",
)
@wa.on_message_status(filters.matches("my_tracker"))
def on_status(_: WhatsApp, status: types.MessageStatus):
print(status.tracker)
from pywa import WhatsApp
from pywa.types import Command
wa = WhatsApp(...)
wa.update_conversational_automation(
enable_chat_opened=True,
ice_breakers=[
"Generate me an image of a cute cat",
"Create a beautiful image of a sunset",
],
commands=[
Command(name="imagine", description="Create images using a text prompt"),
Command(name="contact", description="Contact us",),
]
)
Full Changelog: 1.16.2...1.17.0
1.16.2
What's Changed
Update with pip:
pip3 install -U pywa
- [client] fix sending single contact
- [filters] prioritize
/
over!
infilters.command(...)
andfilters.is_command
Full Changelog: 1.16.0...1.16.2
1.16.0
What's Changed
Update with pip:
pip3 install -U pywa
- [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_token
inFlowCompletion
(When the flow completion sent from iOS) - [tests] adding more tests
from pywa import WhatsApp
from pywa.types import ChatOpened
from flask import Flask
flask_app = Flask(__name__)
wa = WhatsApp(..., server=flask_app, verify_token=...)
@wa.on_chat_opened()
def handle_chat_opened(_: WhatsApp, chat_opened: ChatOpened):
chat_opened.reply(f"Hello, {chat_opened.from_user.name}. Welcome to our bot!")
Full Changelog: 1.15.0...1.16.0
1.15.0
What's Changed
Update with pip:
pip3 install -U pywa
- [client] added
register_phone_number
by @yehuda-lev in #34 - [client] mark the
body
arg in send image/video/doc as deprecated. usecaption
instead - [utils] bump
FLOW_JSON
version to 3.1 - [flows] allow
DataSource
inFlowResponse
data - [flows]
Image
.src can be dynamic - [flows] default
ActionNext
to SCREEN - [flows] adding
.success
for screen and adding in-docs examples
Full Changelog: 1.14.0...1.15.0
1.14.0
What's Changed
Update with pip:
pip3 install -U pywa
- [flows] define
Form
init_values
from childreninit_value
- [flows] adding a new
ScreenData
type to be used in screen.data
- [flows] adding
.form_ref
and.form_ref_of(form_name)
to form components - [docs] adding s real-world example for a complex flow
flow = FlowJSON(
screens=[
Screen(
id="WELCOME",
title="Welcome",
terminal=True,
data=[
welcome_header := ScreenData(key="welcome_header", example="Welcome to the demo!"),
initial_name := ScreenData(key="initial_name", example="David"),
],
layout=Layout(
children=[
TextHeading(text=welcome_header.data_key),
Form(
name="form",
children=[
name := TextInput(
name="name",
label="Name",
required=True,
init_value=initial_name.data_key,
),
email := TextInput(
name="email",
label="Email",
input_type=InputType.EMAIL,
required=True,
)
]
),
Footer(
label="Done",
on_click_action=Action(
name=FlowActionType.COMPLETE,
payload={
"name": name.form_ref,
"email": email.form_ref,
}
)
)
]
)
)
]
)
Full Changelog: 1.13.0...1.14.0
1.13.0
What's Changed
Update with pip:
pip3 install -U pywa
- [flows] Adding full support for WhatsApp Flows!
- [client] adding
request_location
method toWhatsApp
client by @yehuda-lev in #29 - [base_update] adding
.raw
attr to hold the original update - [utils] adding
Version
to provide the latest versions to the api & flows, and to perform min checks
Full Changelog: 1.12.1...1.13.0