Skip to content

Releases: david-lev/pywa

1.13.0-rc.5

18 Dec 11:43
Compare
Choose a tag to compare
1.13.0-rc.5 Pre-release
Pre-release

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 fix FlowPreview.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

16 Dec 20:39
Compare
Choose a tag to compare
1.13.0-rc.4 Pre-release
Pre-release

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 and FormRef to use when building a FlowJSON
  • [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

14 Dec 22:54
Compare
Choose a tag to compare
1.13.0-rc.3 Pre-release
Pre-release

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 raise FlowResponseError 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

14 Dec 18:09
Compare
Choose a tag to compare
1.13.0-rc.2 Pre-release
Pre-release

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

14 Dec 14:12
Compare
Choose a tag to compare
1.13.0-rc.1 Pre-release
Pre-release

What's Changed

Update with pip: pip3 install -U pywa==1.13.0rc1

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

28 Nov 23:01
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • [filters] adding new filter called sent_to to filter updates even if WhatsApp(..., 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

19 Nov 22:30
Compare
Choose a tag to compare

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

1.11.1

06 Nov 23:27
Compare
Choose a tag to compare

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

01 Nov 11:16
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • [callback] adding support for Optional[x] annotation in CallbackData 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

29 Oct 16:49
Compare
Choose a tag to compare

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