Skip to content

1.9.0

Compare
Choose a tag to compare
@david-lev david-lev released this 25 Oct 18:31
· 574 commits to master since this release

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 (or raise pywa.types.StopHandling)
  • [errors] include requests.Response with all api errors
  • [client] mark keyboard argument in .send_message as deprecated. use buttons 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