Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vreden/meta

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vreden/meta

WhatsApp Web Official Meta Facebook Developer Blueprint For Desktop

  • 1.0.1
  • unpublished
  • npm
  • Socket score

Version published
Weekly downloads
583
decreased by-5.36%
Maintainers
0
Weekly downloads
 
Created
Source

Baileys WhatsApp Web

NPM Version Downloads Build Status

Librari Node.js untuk terhubung ke WhatsApp Web. Baileys menyediakan API yg powerful dan mudah dipahami untuk berinteraksi dengan WhatsApp. Lo bisa kirim pesan teks, gambar, video, audio, dokumen, bikin grup, dsb.

Fitur Keren 😎

Multi-Device: Bisa pake banyak device sekaligus. Gausu ribet logout sana-sini. Kirim Berbagai Jenis Pesan: Teks, gambar, video, audio, dokumen, stiker, location, kontak, sampe voice note jg bisa! Manajemen Grup: Bikin grup, invite/remove member, ganti deskripsi dan subjek grup. Fitur Interaktif: Bikin tombol, list, dan respon interaktif lainnya. Mendukung Stiker & Emoji: Biar chat makin seru dan ekspresif! Event Handling: Tangkep berbagai event WhatsApp, kek pesan masuk, status online, dsb. Otomatis reconnect: Kalo koneksi putus, otomatis nyambung lagi.

Instalasi ⚙️

npm install baileys
// atau
yarn add baileys

Cara Pake 👨‍💻

Contoh simpel buat kirim pesan teks:

const { default: makeWASocket, DisconnectReason, useMultiFileAuthState } = require('@adiwajshing/baileys')

async function connectToWhatsApp () {
    const { state, saveCreds } = await useMultiFileAuthState('baileys_auth_info') // nama folder untuk nyimpen kredensial

    const sock = makeWASocket({
        auth: state,
        printQRInTerminal: true // tampilin QR code di terminal
    })

    sock.ev.on('connection.update', (update) => {
        const { connection, lastDisconnect } = update
        if(connection === 'close') {
            const shouldReconnect = (lastDisconnect.error)?.output?.statusCode !== DisconnectReason.loggedOut
            console.log('Koneksi ditutup:', lastDisconnect.error, ', reconnecting:', shouldReconnect)
            // reconnect kalo perlu
            if(shouldReconnect) {
                connectToWhatsApp()
            }
        } else if(connection === 'open') {
            console.log('Terhubung!')
        }
    })

    sock.ev.on('creds.update', saveCreds)

    sock.ev.on('messages.upsert', async m => {
        console.log(JSON.stringify(m, undefined, 2))

        try {
            const message = m.messages[0]
            if (!message.key.fromMe && message.key.remoteJid !== 'status@broadcast') {
                console.log('pesan masuk:', message.message.conversation)
               await sock.sendMessage(message.key.remoteJid, { text: 'Halo! 👋' }, { quoted: message }) // balas pesan
            }
        } catch (err) {
            console.log(err)
        }


    })
}

connectToWhatsApp()

Dokumentasi Lengkap 📚

Dokumentasi Baileys

Kontribusi 🤝

Pull request sangat diterima! Kalo nemu bug atau mau nambahin fitur, langsung aja bikin PR. Gw bakal review secepatnya. WhatsApp Website Channel

Lisensi 📜

MIT dibuat oleh bochel FF dengan chatGPT

Keywords

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc