bcalik / Whatsapp-Desktop

Unofficial whatsapp web desktop client for OSX, Linux and Windows. Build with Electron.
249 stars 50 forks source link

Can we use this to build whatsapp chat bot #55

Closed garg-ashu closed 7 years ago

garg-ashu commented 7 years ago

@bcalik I was just curious that can we build simple chat bot around this framework. Any idea...

Enrico204 commented 7 years ago

Pre: this is not a framework, this is only a "webview" to web.whatsapp.com. Just like a browser without toolbars, etc.

It might be very difficult to build some automations. To be honest, some months ago I looked into some JS files and I made some reverse engineering in order to decode/encode packets from/to server. It was promising (some things works), but I have no time for that kind of development right now. Maybe I'll publish some source code on GitHub - I need to check if there are some personal data (eg. phone number). Before that, my first approach was using DOM and jQuery to simulate click actions from "Developer Tool Console" (on real browser), but it didn't work (it was very unreliable).

PS: I assume that you know that build chatbots violate WhatsApp terms

garg-ashu commented 7 years ago

@Enrico204 Can we atleast get new incoming messages from this webview into some sort of file or string object etc. If you can share some JS files that will be really helpful. I know whtsapp doesn't allow you to build chatbots i am just doing it for learning purpose, no business involved.

Enrico204 commented 7 years ago

Hi @garg-ashu , I'll try to explain some points:

My reminder about chatbots is because of banning that WhatsApp is doing on people that are using another library which is done by reverse engineering the WhatsApp android app. That library seems to work, however. Until WhatsApp bans you.

garg-ashu commented 7 years ago

After that, I tried to reverse engineer the whatsapp web protocol by reimplementing JS files from Whatsapp in Python. I have that code, I'll share it as soon as I have time :-)

Hey, Can you please share any code when you get time.

Enrico204 commented 7 years ago

Sorry I was busy. Here you can find the source code: https://github.com/Enrico204/whatsapp-decoding