Releases: david-lev/pywa
Releases Β· david-lev/pywa
1.4.1
What's Changed
- Fix ReactionFilter and TextFilter by @yehuda-lev in #12
Full Changelog: 1.4.0...1.4.1
1.4.0
What's Changed
- callback: allowing to provide
factory
to construct callback data (Button
andSelection
) 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
What's Changed
- template: adding support for
CopyCodeButton
and addLanguage
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
What's Changed
- adding
reply_template
shortcut and fix bugs by @yehuda-lev in #8 - adding support for
MPMButton
andCatalogButton
. - rename and mark as deprecated template headers.
Full Changelog: 1.1.0...1.2.0
1.1.0
π NEW VERSION!
- Adding support for sending and creating template messages
- Adding more errors
Full Changelog: 1.0.0...1.1.0