1.9.0
What's Changed
Update with pip:
pip3 install -U pywa
- [handlers] call
.stop_handling()
on every update if you want to stop handling the update (orraise pywa.types.StopHandling
) - [errors] include
requests.Response
with all api errors - [client] mark
keyboard
argument in.send_message
as deprecated. usebuttons
instead
from pywa import WhatsApp, filters as fil, types
wa = WhatsApp(...)
@wa.on_message(fil.text)
def print_msg_1(_: WhatsApp, msg: types.Message):
print(msg)
msg.stop_handling() # Stop handling the message
# or raise types.StopHandling
@wa.on_message(fil.text)
def print_msg_2(_: WhatsApp, msg: types.Message):
print("This handler will never be called")
Full Changelog: 1.8.0...1.9.0