3.6.0
What's Changed
Update with pip:
pip3 install -U pywa
- [client] allow any media type in
update_business_profile(profile_picture=...)arg - [sent_message] adding new
SentReactiontype for replying and reacting to the original message - [media] allowing usage in context manager to delete media after use
- [templates] moving
TemplateStatusUpdatefields into objects - [message_status] fixing
MessageStatus.pricing.typeparsing by @Janson-L in #158 - [utils] bump
flow_data_apito4.0
from pywa import WhatsApp, filters, types
wa = WhatsApp(...)
# media will be automatically deleted from WhatsApp servers after exiting the context
with wa.upload_media("/path/to/sensitive_image.png") as media:
wa.send_image(to=..., image=media)
@wa.on_message(filters.command("start"))
def on_start(_: WhatsApp, m: types.Message):
doc = m.reply("Please send your ID as a document.").wait_for_reply(filters=filters.document).document
# document will be automatically deleted from WhatsApp servers after exiting the context
with doc:
# process the document stream securely
upload_to_secure_storage(file=doc.stream())from pywa import WhatsApp
wa = WhatsApp(...)
wa.update_business_profile(
# use any media source supported by pywa
profile_picture=pathlib.Path("/path/to/image.png")
)Full Changelog: 3.5.2...3.6.0