gilbras / sulla

πŸ₯ƒ Javascript whatsapp library for chatbots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm version Maintainability Greenkeeper badge

sulla

Sulla is a javascript library which provides a high-level API control to Whatsapp so it can be configured to automatize resposes or any data that goes trough Whatsapp effortlessly.

It is built using puppeteer and based on this python wrapper

Installation

> npm i sulla

Usage

// import { create, Whatsapp } from 'sulla';
const sulla = require('sulla');

sulla.create().then(client => start(client));

function start(client) {
  client.onMessage(message => {
    if (message.body === 'Hi') {
      client.sendText(message.from, 'πŸ‘‹ Hello from sulla!');
    }
  });
}
After executing create() function, sulla will create an instance of whatsapp web. If you are not logged in, it will print a QR code in the terminal. Scan it with your phone and you are ready to go!
sulla will remember the session so there is no need to authenticate everytime.

Functions list

Function Description Implemented
Receive message βœ…
Send text βœ…
Get contacts βœ…
Get chats βœ…
Get groups βœ…
Get group members βœ…
Send contact βœ…
Get contact detail βœ…
Send media (image, audio, doc)
Send stickers
Decrypt media (image, audio, doc)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

πŸ₯ƒ Javascript whatsapp library for chatbots

License:MIT License


Languages

Language:JavaScript 77.1%Language:TypeScript 22.9%