Giter VIP home page Giter VIP logo

whatsapp-chatbot-2.0's Introduction

WhatsApp-Chatbot-2.0

This time it runs off electron so it's much cleaner to run

This is a WhatsApp API. Previously, it was difficult to setup and was very messy. That was due to the Content Security Policy kicking in.

This time, we go to the browser level, where such things don't apply to us.

We use Electron here.

Note that this library is callback based. So prepare for callback hell.

#Installing:

Run this:

git clone https://github.com/TeamFreeHugs/WhatsApp-Chatbot-2.0.git
cd WhatsApp-Chatbot-2.0
npm i -d
npm start

Since this is based off WhatsApp Web, you need to use your phone to connect. Read more here;

If you did not set NODE_ENV, you should find that the Chrome DevTools console pops up. Wait for the page to load, then play with the exposed WhatsAppAPI object.

Note: Unlike the previous version, you now no longer need to paste all your code into the console. Instead, you need to edit the file

/users/main.js

There, you can code NodeJS as normal, and when you enter a chat, run setupBot();, or whatever init function you have. See here for an example. This example will only print any messages it receives to the console. Hopefully this clears up any questions on how to run code now

whatsapp-chatbot-2.0's People

Contributors

eyeballcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

whatsapp-chatbot-2.0's Issues

Only works when chat window is active

I could make it work here, but only the active chats windows are getting responses from the bot. If I have two or more simultaneous chats only that one active/open will be answered by the bot, the other not active (with message notifications red mark) are not being answered?

Is this the expected behavior? How could I create a workaround to handle multiple simultaneous chats?

Whatsapp Window open but not any event trigger while message

as per your instruction, I have successfully started and WhatsApp web window is open but when some message and other event occurred I didn't find and any trigger of message receive, so I have to inject some script to the running scenario.

here is my console in which I didn't get any message from web.whatsapp.com and which is actually running.

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.