Skip to content

Releases: david-lev/pywa

1.15.0

14 Jan 00:43
Compare
Choose a tag to compare

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. use caption instead
  • [utils] bump FLOW_JSON version to 3.1
  • [flows] allow DataSource in FlowResponse 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

01 Jan 11:07
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • [flows] define Form init_values from children init_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

22 Dec 12:47
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • [flows] Adding full support for WhatsApp Flows!
  • [client] adding request_location method to WhatsApp 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

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