Skip to content

Releases: david-lev/pywa

1.4.1

12 Sep 12:03
6f8e456
Compare
Choose a tag to compare

What's Changed

Full Changelog: 1.4.0...1.4.1

1.4.0

10 Sep 10:15
Compare
Choose a tag to compare

What's Changed

  • callback: allowing to provide factory to construct callback data (Button and Selection) into custom object.
  • callback: adding type-safe CallbackData interface in order to send and receive typed callback data.
  • webhook: add protocols for supported web frameworks.
from pywa import WhatsApp
from pywa.types import Button, CallbackData
from dataclasses import dataclass

@dataclass(frozen=True)
class UserData(CallbackData):
    id: int
    is_admin: bool

wa = WhatsApp(...)

wa.send_message(
    to='972123456789',
    text='Hello there!',
    keyboard=(Button(
        title='Add admin',
        callback_data=UserData(id=123, is_admin=True),
    ),)
)


@wa.on_callback_button(factory=UserData)
def on_callback_button(client: WhatsApp, btn: CallbackButton[UserData]):
    if btn.data.is_admin:
        btn.react('😎')
        btn.reply_text(f'{btn.data.id} is now an admin')

Full Changelog: 1.3.0...1.4.0

1.3.0

06 Sep 09:45
Compare
Choose a tag to compare

What's Changed

  • template: adding support for CopyCodeButton and add Language enum for better typing
  • filters: adding from_countries filter
  • fix: typos by @nallon in #10
  • Add: improved typing by @nallon in #9

New Contributors

  • @nallon made their first contribution in #10

Full Changelog: 1.2.0...1.3.0

1.2.0

21 Aug 22:15
Compare
Choose a tag to compare

What's Changed

  • adding reply_template shortcut and fix bugs by @yehuda-lev in #8
  • adding support for MPMButton and CatalogButton.
  • rename and mark as deprecated template headers.

Full Changelog: 1.1.0...1.2.0

1.1.0

20 Aug 17:59
Compare
Choose a tag to compare

πŸŽ‰ NEW VERSION!

  • Adding support for sending and creating template messages
  • Adding more errors

Full Changelog: 1.0.0...1.1.0

1.0.0

16 Aug 21:52
Compare
Choose a tag to compare

πŸŽ‰ FIRST STABLE RELEASE - VERSION 1.0.0