Skip to content

Releases: david-lev/pywa

1.7.2

12 Oct 23:45
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • reply to CallbackButton.id instead of to .reply_to_message by @yehuda-lev in #16
  • change default CallbackData separators to unused characters ( for clb sep, ~ for data sep and § for True boolean

Full Changelog: 1.7.1...1.7.2

1.7.1

12 Oct 22:42
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

callback: hot-fix for last booleans fields on CallbackData (WhatsApp Cloud API consider "1: " and "1:" as duplicate datas)

Full Changelog: 1.7.0...1.7.1

1.7.0

12 Oct 18:43
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

types: new ButtonUrl type
client: allowing to provide mime_type when sending media as bytes, open file or file path without extensions

from pywa import WhatsApp
from pywa.types import ButtonUrl

wa = WhatsApp(...)

wa.send_message(
    text='Hi',
    to='972123456789',
    keyboard=ButtonUrl(title='Google Search', url='https://google.com')
)

Full Changelog: 1.6.0...1.7.0

1.6.0

11 Oct 11:58
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • handlers: apply callback data factory before filters by setting factory_before_filters to True when registering the handler
import dataclasses
from pywa import WhatsApp
from pywa.types import CallbackData, CallbackButton

@dataclasses.dataclass(frozen=True, slots=True)
class User(CallbackData):
    id: int
    admin: bool

wa = WhatsApp(...)

@wa.on_callback_button(
    lambda _, b: b.data.admin, lambda _, b: b.data.id == 1, # filters get access to user data
    factory=User, # factory to convert the callback data to the user object
    factory_before_filters=True # factory will run before the filters
)
def on_callback_button(_: WhatsApp, clb: CallbackButton[User]):
    print(f"User with id {clb.data.id} is admin")

Full Changelog: 1.5.4...1.6.0

1.5.4

08 Oct 20:36
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • template: fix media key

Full Changelog: 1.5.3...1.5.4

1.5.3

03 Oct 19:31
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • webhook: faster field-to-handler matching
  • message_status: make .pricing_model optional

Full Changelog: 1.5.2...1.5.3

1.5.2

03 Oct 17:22
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

callback: better typing for callback_data and factory

Full Changelog: 1.5.1...1.5.2

1.5.1

02 Oct 14:01
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

build: Fix package imports

Full Changelog: 1.5.0...1.5.1

1.5.0

02 Oct 12:59
Compare
Choose a tag to compare

What's Changed

Update with pip: pip3 install -U pywa

  • callback: allowing to override separators in CallbackData childs
  • tests: starting to adding tests
  • message: reaction messages are also replays (.is_reply)
  • api: bump api version to 18.0
  • template: new update type - TemplateStatus; remove deprecated headers
  • build: move to pyproject.toml
  • docs: tips and improvements

Full Changelog: 1.4.1...1.5.0

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