cloned-doy / whatsfly

WhatsFly : Just try and go fly. WhatsApp web wrapper in Python. No selenium nor gecko web driver needed.
https://pypi.org/project/whatsfly
MIT License
22 stars 9 forks source link

Receive messages first implementation #6

Closed Otamay closed 6 months ago

Otamay commented 6 months ago

I extracted the event handler from https://github.com/tulir/whatsmeow/blob/main/mdtest/main.go to listen for the events and record them in a queue (using github.com/enriquebris/goconcurrentqueue ).

A queue monitor function was implemented and exposed so python can launch it via threading. By passing a callback function as an argument to the queue monitor from python, we can listen for the whatsapp events such as incoming/outgoing, reacts, deleted messages, etc.

Further implementation in golang library is needed to support multimedia and other event types and their properties.

cloned-doy commented 6 months ago

Thank you, Otamay! Sorry for late response, your code seems great!