Giter VIP home page Giter VIP logo

wasender's Introduction

WASender

Simple engine for sending message to WhatsApp using nodejs module whatsapp-web.js

Installation

You need to install nodejs and all dependencies (this is sample for ubuntu 20.04):

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install libatk1.0-0 libatk-bridge2.0-0 libcups2 libxkbcommon-x11-0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libpango-1.0-0 libcairo2

Then run this command:

npm install

Running

Run this command from root of project:

node index.js

You can use any port number and session name inside file. Once you logged in you can restart application without need to scan again, except if you remove device from WhatsApp application.

Login WhatsApp

Before sending, we have to login first to WhatsApp Web by scanning QRCode in this page:

http://localhost:3001/qr

Sending Message

To send message, simply send POST request to this endpoint:

http://localhost:3001/send

with json payload to and message. You can simulate it using Postman. to field must begin with country code, i.e. 62864095xxxx.

Credits

Install as Service

Using PM2 we can run WASender as service. Install PM2 then run this command:

pm2 start index.js --cron-restart="0 * * * *"

Troubleshooting

Error: listen EADDRINUSE: address already in use :::3001

killall -9 node

wasender's People

Contributors

yllumi avatar

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.