Skip to content

1.12.0

Compare
Choose a tag to compare
@david-lev david-lev released this 19 Nov 22:30
· 546 commits to master since this release

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 type requests.Session to .upload_media when uploading locally from URL
  • [errors] adding more template and flow exceptions; fix typo in TooManyMessages
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