npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wabot

v1.4.9

Published

Whatsapp Bot Module for automate response and interact whit users

Downloads

115

Readme

WABOT!

WABOT

Wabot is a nodejs module which allows you to connect with whatsapp web by using Puppeteer.

It is not an official whatsapp module so I am not responsible for any ban. Although I have tried a lot and have not been banned, I cannot guarantee that this is the case for everyone or that in the future restrictions will apply to prevent its use.

Installation

npm i wabot

NOTE: Node 10.15.0+ is required

Documentation

You can find all documentation here Documentation

Supported features

| Feature | Status | | ------------- | ------------- | | Send messages | ✅ | | Receive messages | ✅ | | Send media (images/audio/documents) | ✅ | | Send media (video) | ✅ | | Send stickers | ✅ | | Send stickers without background | ✅ | | Receive media (images/audio/video/documents) | ✅ | | Send contact cards | ✅ | | Send location | ✅ | | Receive location | ✅ | | Message replies | ✅ | | Join groups by invite | ✅ | | Get invite for group | ✅ | | Modify group info (subject, description) | ✅ | | Add group participants | ✅ | | Kick group participants | ✅ | | Promote/demote group participants | ✅ | | Mention users | ✅ | | Mute/unmute chats | ✅ | | Get contact info | ✅ | | Get profile pictures | ✅ | | Set user status message | ✅ | | Send Text to Image | ✅ | | Ban user by spam | ✅ | | Permission control | ✅ | | Custom commands | ✅ | | Valid responses | ✅ | | Add plugins | ✅ |

Plugins

The creation of new plugins is allowed to automate some tasks and achieve incorporation as a new method of the wabot class.

To create a new plugin it is required to export an object with the following properties:

  • Id: Plugin identifier (name)
  • setup: Initial configuration function with configuration parameters (optional function)
  • plugin: Function that contains the actions to be performed by the plugin, this function will have access to all the methods of the wabot function by using "this"

Once the plugin is created, the "plugins" parameter must be configured at the time of instantiating WABOT through intentsConfig, then the possible modules to be used by the plugin must be installed separately through the console by "npm install module_name".

Below is a list of the plugins that come by default incorporated with the module:

| Plugin| Description | | ------------- | ------------- | | AI-Image | Plugin that allows you to create a image from an text | | Anime | Plugin to transform your selfie into an anime portrait using minivision photo2cartoon | | Cartoon | Plugin to transform your selfie into an cartoon portrait using | | Coronavirus | Plugin to obtain information on the coronavirus by countries, cases, deaths, etc | | Music | Plugin to get a song in mp3 format directly from soundcloud | | Lifehacks | Plugin that allows you to get a video from lifehacks | | Meme | Plugin that allows you to send various memes from subreddits in Spanish and English | | Movie | Plugin that allows you to obtain movies to watch online in different qualities | | News | Plugin to get news from the different rss sources that are configured | | Translate | Plugin that allows you to translate a text to the language that is requested | | Wiki | Plugin that allows the search of different things in wikipedia | | Youtube | Plugin that allows you to search for videos directly from YouTube | | Zombie | Plugin that allows you to transform your selfie into a zombie |

Example usage

You can find more examples in the following link

const WABOT = require('wabot');

const wabot = new WABOT();

// Default when no assignment is found for the message
wabot.on('message', (res) => {
    if (res.data.type === 'document' || res.data.type === 'video'){
        wabot.sendMessage({
            "idChat": res.data.from,
            "message": `Thanks for your file.`
        });

        wabot.downloadFile(res.data.id)
        .then((file) => {
            console.log('file downloaded...', file);
        })
        .catch((err) => {
            console.log('error downloading file', err);
        })
    } else {
        wabot.sendMessage({
            "idChat": res.data.from,
            "message": `You say: ${res.data.body}`
        });
    }
});

wabot.on('ready', (session) => {
	console.log('READY', session);
    //console.log('Clossing Session');
    //wabot.closeSession();
});

wabot.start(); 

Default Options

Wabot accepts different startup options, then the default options. puppeteerConfig:

{
	"WAUrl": "https://web.whatsapp.com",
	"viewBrowser": false,
	"opendevtools": false,
	"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.92 Safari/537.36",
	"width": 1000,
	"heigth": 800,
	"dowloadChromeVersion": false,
	"chromeVersion": 818858,
	"localChromePath": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
	"getInitScreenshot": false,
    "pathScreenshot": "./screenshot.png",
	"args": [
		"--log-level=3",
		"--no-default-browser-check",
		"--disable-site-isolation-trials",
		"--no-experiments",
		"--ignore-gpu-blacklist",
		"--ignore-certificate-errors",
		"--ignore-certificate-errors-spki-list",
		"--disable-extensions",
		"--disable-default-apps",
		"--enable-features=NetworkService",
		"--disable-setuid-sandbox",
		"--no-sandbox",
		"--disable-infobars",
		"--window-position=0,0",
		"--ignore-certifcate-errors",
		"--ignore-certifcate-errors-spki-list",
		"--disable-threaded-animation",
		"--disable-threaded-scrolling",
		"--disable-histogram-customizer",
		"--disable-composited-antialiasing",
		"--disable-dev-shm-usage",
		"--disable-notifications"
	]
}

intentsConfig:

{
	"showContent": false,
	"debug": false,
	"removeBgApis": [],
	"plugins": {
        "folder": "../plugins",
        "plugins": [],
        "setup": {}
    },
	"executions": {
		"reponseUsers": true,
		"simulateTyping": true,
		"timeSimulate": 3000,
		"contorlExecutions": false,
		"maxExecutions": 30,
		"timeInterval": 10,
		"timePending": 3,
		"sendSeen": true,
		"sendSeenFull": false,
		"intervalSendSeen": 10
	},
	"bann": {
		"active": false,
		"timeInterval": 10,
		"maxBann": 3,
		"timeBann": 10,
		"timeInactive": 5,
		"whiteList": []
	},
	"messages":{
		"userBanned": "⛔😡 *We report that you have been temporarily banned for misusing our services * \n _Please try again after {{TIMEBANN}} minutes_ 🤬",
		"groupBanned": "⛔😡 *We report that this group has been temporarily banned for misuse of our services by '{{USER_NAME}}' (+ {{USER_NUMBER}}) * \n _Please try again after {{TIMEBANN}} minutes_ 🤬",
		"privileges": "⛔ *Unfortunately you do not have privileges, contact the system administrator* ⛔"
	},
	"blocked": [],
	"whiteList": [],
	"commands": []
}

Disclaimer

This module is not official WhatsApp so you must be careful with the number of interactions per minute to avoid possible bans, this module has the option of queuing responses to avoid such a situation but does not ensure that actions cannot occur on the part of the company.

This project is inspired by Wbot I just dedicate myself to adding new options to it.