Releases: david-lev/pywa
1.13.0-rc.5
What's Changed
Update with pip:
pip3 install -U "pywa[cryptography]==1.13.0-rc.5"
- [flows] add supported types for Layout and Form
.children
and fixFlowPreview.expires_at
- [webhook] validate
cryptography
is installed when using the default flows decryptor/encryptor
READ MORE AT THE DOCS: https://pywa.readthedocs.io/en/latest/content/flows/overview.html
Full Changelog: 1.13.0-rc.4...1.13.0-rc.5
1.13.0-rc.4
What's Changed
Update with pip:
pip3 install -U "pywa[cryptography]==1.13.0-rc.4"
- [client] expose
set_business_public_key
- [flows] adding
DataKey
andFormRef
to use when building aFlowJSON
- [template] adding support to create and send template with
FlowButton
- [errors] remove
FlowInvalidError
(Too broad error code)
READ MORE AT THE DOCS: https://pywa.readthedocs.io/en/latest/content/flows/overview.html
Full Changelog: 1.13.0-rc.3...1.13.0-rc.4
1.13.0-rc.3
What's Changed
Update with pip:
pip3 install -U "pywa[cryptography]==1.13.0-rc.3"
- [errors] adding flows specific errors
- [flows] allow to
@on_flow_request
callbacks to return or raiseFlowResponseError
subclasses
READ MORE AT THE DOCS: https://pywa.readthedocs.io/en/latest/content/flows/overview.html
Full Changelog: 1.13.0-rc.2...1.13.0-rc.3
1.13.0-rc.2
What's Changed
Update with pip:
pip3 install -U "pywa[cryptography]==1.13.0rc2"
- [base_update] adding
.raw
attr to hold the original update - [requirements] set
cryptography
as extra dependency
READ MORE AT THE DOCS: https://pywa.readthedocs.io/en/latest/content/flows/overview.html
Full Changelog: 1.13.0-rc.1...1.13.0-rc.2
1.13.0-rc.1
What's Changed
Update with pip:
pip3 install -U pywa==1.13.0rc1
- [flows] Adding Beta support for WhatsApp Flows!
READ MORE AT THE DOCS: https://pywa.readthedocs.io/en/latest/content/flows/overview.html
Full Changelog: 1.12.1...1.13.0-rc.1
1.12.1
What's Changed
Update with pip:
pip3 install -U pywa
- [filters] adding new filter called
sent_to
to filter updates even ifWhatsApp(..., filter_updates=False)
- [webhook] renaming route callbacks names to allow multiple
WhatsApp
instances to use the same server - [message_type] default missing to
UNKNOWN
- [bugs] fix bug on interactive message without data
Full Changelog: 1.12.0...1.12.1
1.12.0
What's Changed
Update with pip:
pip3 install -U pywa
- [reply_to_msg] adding
ReferredProduct
to message context - [filters] adding filter for messages that has
referred_product
in their context - [types] unfrozen editable types
- [base_update] hash updates by their update ID
- [client] adding
dl_session
param of typerequests.Session
to.upload_media
when uploading locally from URL - [errors] adding more
template
andflow
exceptions; fix typo inTooManyMessages
from pywa import WhatsApp, filters
wa = WhatsApp(...)
@wa.on_message(filters.has_referred_product, filters.text)
def print_product_question(_: WhatsApp, msg: Message):
sku = msg.reply_to_message.referred_product.sku
print(f"The user {msg.from_user.name} asked about {sku}: {msg.text}")
Full Changelog: 1.11.1...1.12.0
1.11.1
What's Changed
Update with pip:
pip3 install -U pywa
- [reaction] hot-fix for reaction when "unreacting" to a message
- [filters] adding
.extensions(...)
filter for all media filters
from pywa import WhatsApp, filters
wa = WhatsApp(...)
@wa.on_message(filters.document.extensions('.pdf', '.docx'))
def download_document(client: WhatsApp, msg: Message):
msg.download_media('/home/david/Downloads/')
Full Changelog: 1.11.0...1.11.1
1.11.0
What's Changed
Update with pip:
pip3 install -U pywa
- [callback] adding support for
Optional[x]
annotation inCallbackData
subclasses - [media] allowing to pass
pathlib.Path
as a media file path - [system] make all fields nullable in system update
from pywa import WhatsApp
from pathlib import Path
wa = WhatsApp(...)
wa.send_document(
to=972123456789,
document=Path('/home/david/Documents') / 'Resume.pdf',
filename='Resume.pdf',
caption='My Resume',
)
Full Changelog: 1.10.0...1.11.0
1.10.0
What's Changed
Update with pip:
pip3 install -U pywa
- [template] adding support for
OtpType.ZERO_TAP
in new authentication template - [callback] adding support for nullable and optional fields in
CallbackData
- [tests] update
CallbackData
tests
import dataclasses
from pywa.types import CallbackData
@dataclasses.dataclass
class User(CallbackData):
id: str
name: str | None # nullable field
is_admin: bool = False # optional field
Full Changelog: 1.9.0...1.10.0