Closed lddd closed 5 years ago
Hello?
Hi Roman
Incoming messages work as mentioned in description. You need Database connection for that. sql file is already present in root of project with name whatsapp_rnd_db.sql. Import it in DB and set the credentials in dev.cfg file. According to current functionality when you send msgs on emulator following steps occur
Basically the idea behind new message listener was to look for contacts which sent subscribe and add them to DB and send them updates or else unsubscribe them and stop sending further updates.
Note: you can modify this functionality according to your requirement.
So the process goes like.
[roman@CentOS-75-64-minimal whatsapp_automation]# python new_message_listener_producer.py dev Waiting For Messages
you will see the above mentioned functionality working and message printed accordingly.
@lddd Let me know how it goes.
Thanks. Mayank
Hi,
Thank you. I will check my database settings, there might be something wrong.
So this is basically for listening and reacting to specific commands only right?
What about listening for all incoming messages?
I would like to save all incoming messages for each phone number to the database?
Hi Roman
You are Welcome!
Yeah you can say it has been customised to listen and react for specific commands.
I have put a simple condition to read the last new incoming message and compare if it matches subscribe or unsubscribe and then perform action accordingly.
Complete logic for new messages parsing is written in file https://github.com/mnkgrover08/whatsapp_automation/blob/master/workers/whatsapp_new_message_listener_worker.py
You can tweak the logic according to your requirements. loop is running for new messages where I am only taking out last index message, so you can run another loop and write all messages in DB or anything you want.
yes for sure you can store all incoming messages for each phone in DB. Just go through file whatsapp_new_message_listener_worker.py for a better understanding.
Thanks Mayank
On Tue, Nov 27, 2018 at 4:03 PM Roman M. notifications@github.com wrote:
Hi,
Thank you. I will check my database settings, there might be something wrong.
So this is basically for listening and reacting to specific commands only right?
What about listening for all incoming messages?
I would like to save all incoming messages for each phone number to the database?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mnkgrover08/whatsapp_automation/issues/15#issuecomment-442009385, or mute the thread https://github.com/notifications/unsubscribe-auth/AGH0KpTEsfHLlgVZTh3SAflDdGDbm-Gzks5uzRT4gaJpZM4YxV2s .
I checked all settings again and updated whatsapp_new_message_listener_worker.py
However its still not working. Tested "subscribe" "unsubscribe"
working fine at my end. This needs debugging Roman, will not be able to help remotely via email.
However take pull of repo for latest code and check once if your rabbit mq exchange and queue is working properly for new message listner because in screenshot it seems that request is not even coming to your worker. otherwise it would have printed some msgs.
Thanks Mayank
On Tue 27 Nov, 2018, 8:22 PM Roman M. <notifications@github.com wrote:
I checked all settings again and updated whatsapp_new_message_listener_worker.py
However its still not working. Tested "subscribe" "unsubscribe"
See: https://i.postimg.cc/fydHMQYF/screen.jpg
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/mnkgrover08/whatsapp_automation/issues/15#issuecomment-442086041, or mute the thread https://github.com/notifications/unsubscribe-auth/AGH0Ko-UTjeEU9SWplvAgWoYYfXVAPSBks5uzVGggaJpZM4YxV2s .
I don´t know why the request is not coming in to this worker.
Single Message and Broadcast Worker is working as expected. Just incoming messages, nothing happens.
I will send you details to the docker test environment on Skype, so you can have a look if you would like.
thanks in advance, Roman
@lddd did you find a solution? I got the same issue.
@mnkgrover08 I also had to write the db connection params into the .py file, because the config file couldn't be found cause its not imported. I'm wondering about this...should'nt it be imported?
Hey,
Adding contacts, sending single message and broadcast works like in your example.
But how to work with incoming messages? I tested sending some messages to that number/device and they arrive but won´t get recognized.
All i get is: