@znan/wabot
v0.0.96
Published
Simple Functions WhatsApp Bot
Downloads
18,822
Readme
@ZNAN/WABOT
Created with sincerity and a simple, elegant, and easy-to-understand concept. This project is designed for those who want to learn how to create bots using the Baileys library.
Installation
$ npm install @znan/wabot$ yarn add @znan/wabotConnection
const { Connection } = ('@znan/wabot')
const Conn = new Connection({
plugins_dir: 'plugins',
session_dir: 'session',
online: true,
presence: true,
bypass_ephemeral: true,
pairing: {
state: true,
number: 6283175395970,
code: 'MOONXBOT'
},
}, {
browser: ['Ubuntu', 'Firefox', '20.0.00'],
version: [2, 3000, 1029030078],
shouldIgnoreJid: jid => {
return /(newsletter|bot)/.test(jid)
}
})Usage
Conn.on('connect', () => console.log)
Conn.on('error', (error) => console.log(error))
Conn.on('prepare', () => console.log)
Conn.on('messages.update', x => console.log(x))
Conn.on('messages.reaction', x => console.log(x))
Conn.on('messages.receipt', x => console.log(x))
Conn.on('messages.delete', x => console.log(x))
Conn.on('presence.update', x => console.log(x))
Conn.on('stories', x => console.log(x))
Conn.on('group-participants.update', x => console.log(x))
Conn.on('groups.update', x => console.log(x))
Conn.on('call', x => console.log(x))