Releases: david-lev/pywa
1.7.3
What's Changed
Update with pip:
pip3 install -U pywa
- callback: Treat the Template's
QuickReplyButtonData
as an incomingCallbackButton
(Reported by @bcombes in #17) - handlers: adding
@functools.wraps
to all on_x decorators to preserve callbacks metadata
Full Changelog: 1.7.2...1.7.3
1.7.2
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
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
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
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
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
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
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
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
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