Raw Update

Contents

Raw Update#

class pywa.types.base_update.RawUpdate#

The raw update dict from WhatsApp.

  • This class is a subclass of dict and is immutable (you can’t change its content).

Example

>>> from pywa import WhatsApp
>>> from pywa.types import RawUpdate
>>> wa = WhatsApp(...)
>>> @wa.on_raw_update
... def callback(_: WhatsApp, update: RawUpdate):
...     print(update["entry"])  # the raw dict
...     print(update.id, update.field, update.value)  # shortcut properties
...     print(update.raw)  # the raw bytes of the update
Variables:
  • raw (bytes) – The raw bytes of the update.

  • hmac_header (str | None) – The value of the X-Hub-Signature-256 header (if present).

  • shared_data (dict) – A dict that can be used to share data between handlers for the same update.