MCPcopy
hub / github.com/vynect/venom

github.com/vynect/venom @v5.3.0 sqlite

repository ↗ · DeepWiki ↗ · release v5.3.0 ↗
572 symbols 1,029 edges 270 files 139 documented · 24%
README

🕷Venom Bot🕸

npm version node Downloads Average time to resolve an issue Percentage of issues still open

Build Status Lint Status release-it

Venom is a high-performance system developed with JavaScript to create a bot for WhatsApp, support for creating any interaction, such as customer service, media sending, sentence recognition based on artificial intelligence and all types of design architecture for WhatsApp.

Get started fast and easy! Official API!

Full Documentation

It's a high-performance alternative API to whatsapp, you can send, text messages, files, images, videos and more.

Remember, the API was developed on a platform called RESTful Web services, providing interoperability between computer systems on the Internet.

It uses a set of well-defined operations that apply to all information resources: HTTP itself defines a small set of operations, the most important being POST, GET, PUT and DELETE.

Use it in your favorite language like PHP, Python, C# and others. as long as your language is supported with the HTTP protocol, you will save time and money. you don't need to know how Venom works, we have the complete API documentation, in a professional way!

Get our official API Venom ! Contact us!

Venom group support on Telegram

Venom group support on Discord

Meet the Superchats

SuperChats

SuperChats is a premium library with unique features that control Whatsapp functions with socket. With Superchats you can build service bots, multiservice chats or any system that uses Whatsapp

Superchats is a premium version of Venom, with exclusive features and support for companies and developers worldwide

https://github.com/orkestral/superchats

Buy a license Superchats

The value of the license is $50 monthly dollars, to acquire contact in whatsapp by clicking on the image below !!

🕷🕷 Functions Venom🕷🕷

🚻 Automatic QR Refresh
📁 Send text, image, video, audio and docs
👥 Get contacts, chats, groups, group members, Block List
📞 Send contacts
Send Buttons
Send stickers
Send stickers GIF
Multiple Sessions
⏩ Forward Messages
📥 Receive message
👤 insert user section
📍 Send location!!
🕸🕸 and much more

Documentation at https://orkestral.github.io/venom/index.html

Installation

> npm i --save venom-bot

or for Nightly releases:

> npm i --save https://github.com/orkestral/venom/releases/download/nightly/venom-bot-nightly.tgz

Installing the current repository "you can download the beta version from the current repository!"

> npm i github:orkestral/venom

Getting started

// Supports ES6
// import { create, Whatsapp } from 'venom-bot';
const venom = require('venom-bot');

venom
  .create({
    session: 'session-name' //name of session
  })
  .then((client) => start(client))
  .catch((erro) => {
    console.log(erro);
  });

function start(client) {
  client.onMessage((message) => {
    if (message.body === 'Hi' && message.isGroupMsg === false) {
      client
        .sendText(message.from, 'Welcome Venom 🕷')
        .then((result) => {
          console.log('Result: ', result); //return object success
        })
        .catch((erro) => {
          console.error('Error when sending: ', erro); //return object error
        });
    }
  });
}
After executing create() function, venom 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!
Venom will remember the session so there is no need to authenticate everytime.
Multiples sessions can be created at the same time by pasing a session name to create() function:
// Init sales whatsapp bot
venom.create('sales').then((salesClient) => {...});

// Init support whatsapp bot
venom.create('support').then((supportClient) => {...});

Optional create parameters

Venom create() method third parameter can have the following optional parameters:

If you are using the Linux server do not forget to pass the args --user-agent Original parameters in browserArgs

const venom = require('venom-bot');

venom
  .create(
    //session
    'sessionName', //Pass the name of the client you want to start the bot
    //catchQR
    (base64Qrimg, asciiQR, attempts, urlCode) => {
      console.log('Number of attempts to read the qrcode: ', attempts);
      console.log('Terminal qrcode: ', asciiQR);
      console.log('base64 image string qrcode: ', base64Qrimg);
      console.log('urlCode (data-ref): ', urlCode);
    },
    // statusFind
    (statusSession, session) => {
      console.log('Status Session: ', statusSession); //return isLogged || notLogged || browserClose || qrReadSuccess || qrReadFail || autocloseCalled || desconnectedMobile || deleteToken || chatsAvailable || deviceNotConnected || serverWssNotConnected || noOpenBrowser || initBrowser || openBrowser || connectBrowserWs || initWhatsapp || erroPageWhatsapp || successPageWhatsapp || waitForLogin || waitChat || successChat
      //Create session wss return "serverClose" case server for close
      console.log('Session name: ', session);
    },
    // options
    {
      browserPathExecutable: '', // browser executable path
      folderNameToken: 'tokens', //folder name when saving tokens
      mkdirFolderToken: '', //folder directory tokens, just inside the venom folder, example:  { mkdirFolderToken: '/node_modules', } //will save the tokens folder in the node_modules directory
      headless: 'new', // you should no longer use boolean false or true, now use false, true or 'new' learn more https://developer.chrome.com/articles/new-headless/
      devtools: false, // Open devtools by default
      debug: false, // Opens a debug session
      logQR: true, // Logs QR automatically in terminal
      browserWS: '', // If u want to use browserWSEndpoint
      browserArgs: [''], // Original parameters  ---Parameters to be added into the chrome browser instance
      addBrowserArgs: [''], // Add broserArgs without overwriting the project's original
      puppeteerOptions: {}, // Will be passed to puppeteer.launch
      disableSpins: true, // Will disable Spinnies animation, useful for containers (docker) for a better log
      disableWelcome: true, // Will disable the welcoming message which appears in the beginning
      updatesLog: true, // Logs info updates automatically in terminal
      autoClose: 60000, // Automatically closes the venom-bot only when scanning the QR code (default 60 seconds, if you want to turn it off, assign 0 or false)
      createPathFileToken: false, // creates a folder when inserting an object in the client's browser, to work it is necessary to pass the parameters in the function create browserSessionToken
      addProxy: [''], // Add proxy server exemple : [e1.p.webshare.io:01, e1.p.webshare.io:01]
      userProxy: '', // Proxy login username
      userPass: '' // Proxy password
    },

    // BrowserInstance
    (browser, waPage) => {
      console.log('Browser PID:', browser.process().pid);
      waPage.screenshot({ path: 'screenshot.png' });
    }
  )
  .then((client) => {
    start(client);
  })
  .catch((erro) => {
    console.log(erro);
  });

Callback Status Session

Gets the return if the session is isLogged or notLogged or browserClose or qrReadSuccess or qrReadFail or autocloseCalled or desconnectedMobile or deleteToken or chatsAvailable or deviceNotConnected or serverWssNotConnected or noOpenBrowser or initBrowser or openBrowser or connectBrowserWs or initWhatsapp or erroPageWhatsapp or successPageWhatsapp or waitForLogin or waitChat or successChat or Create session wss return "serverClose" case server for close

Status Condition
isLogged When the user is already logged in to the browser
notLogged When the user is not connected to the browser, it is necessary to scan the QR code through the cell phone in the option WhatsApp Web
browserClose If the browser is closed this parameter is returned
qrReadSuccess If the user is not logged in, the QR code is passed on the terminal a callback is returned. After the correct reading by cell phone this parameter is returned
qrReadFail If the browser stops when the QR code scan is in progress, this parameter is returned
autocloseCalled The browser was closed using the autoClose command
desconnectedMobile Client has desconnected in to mobile
serverClose Client has desconnected in to wss
deleteToken If you pass true within the function
chatsAvailable When Venom is connected to the chat list
deviceNotConnected Chat not available because the phone is disconnected (Trying to connect to the phone)
serverWssNotConnected The address wss was not found!

Extension points exported contracts — how you extend this code

WAPI (Interface)
(no doc) [1 implementers]
src/types/WAPI.d.ts
Window (Interface)
(no doc)
src/controllers/initializer.ts
Window (Interface)
(no doc)
src/lib/wapi/globals.d.ts
Ack (Interface)
(no doc)
src/api/model/ack.ts
options (Interface)
(no doc)
src/config/options.ts
Window (Interface)
(no doc)
src/types/WAPI.d.ts
CreateOptions (Interface)
(no doc)
src/controllers/initializer.ts
ContactStatus (Interface)
(no doc)
src/api/model/contact-status.ts

Core symbols most depended-on inside this repo

on
called by 38
src/api/layers/callback-on.layes.ts
checkValuesSender
called by 21
src/api/helpers/layers-interface.ts
getNewMessageId
called by 21
src/api/layers/retriever.layer.ts
getChat
called by 21
src/api/layers/retriever.layer.ts
spin
called by 16
src/api/layers/host.layer.ts
base64MimeType
called by 12
src/api/helpers/base64-mimetype.ts
x
called by 11
src/lib/wapi/jssha/index.js
t
called by 10
src/lib/wapi/jssha/index.js

Shape

Function 292
Method 182
Interface 53
Class 30
Enum 15

Languages

TypeScript100%

Modules by API surface

src/api/layers/sender.layer.ts40 symbols
src/lib/wapi/jssha/index.js39 symbols
src/api/layers/retriever.layer.ts30 symbols
src/api/layers/listener.layer.ts23 symbols
src/api/layers/host.layer.ts22 symbols
src/api/layers/group.layer.ts21 symbols
src/controllers/browser.ts17 symbols
src/api/layers/controls.layer.ts14 symbols
src/api/whatsapp.ts13 symbols
src/api/layers/profile.layer.ts10 symbols
src/controllers/auth.ts9 symbols
src/api/layers/ui.layer.ts7 symbols

Dependencies from manifests, versioned

@commitlint/cli19.2.2 · 1×
@commitlint/config-angular19.2.2 · 1×
@types/atob2.1.4 · 1×
@types/is-root2.1.2 · 1×
@types/mime-types2.1.0 · 1×
@types/node20.10.8 · 1×
@types/puppeteer5.4.7 · 1×
@types/qrcode1.5.1 · 1×
@types/qrcode-terminal0.12.2 · 1×
@types/sharp0.30.5 · 1×
@types/unzipper0.10.9 · 1×
@types/ws8.5.3 · 1×

For agents

$ claude mcp add venom \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact