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