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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aldy11/rekber-bot

v3.1.0

Published

Modified Baileys with LID conversion, Rekber (Escrow), Menu System, Modern Buttons & Interactive Messages — ESM first, synced with WhiskeySocket Baileys v7

Readme

@baileys-mod/rekber

Modified Baileys dengan LID ↔ JID conversion dan Rekber (Escrow) bot support. ESM-first.

Kompatibilitas

| Baileys Version | Status | |----------------|--------| | @whiskeysockets/baileys v6.x | ✅ Didukung (fallback mode) | | @whiskeysockets/baileys v7.x (rc) | ✅ Didukung (native LID mapping) |

Catatan v7: Baileys v7 menggunakan LID sebagai identifier utama. Modul ini otomatis mendeteksi v7 dan menggunakan native LIDMappingStore untuk resolusi yang lebih akurat.

Fitur

  • 🔄 LID Converter - Konversi LID ke JID dan sebaliknya dari berbagai sumber (cache, native mapping, socket, store, manual)
  • 💰 Rekber Manager - Sistem transaksi escrow lengkap dengan state machine
  • 🔌 Enhanced Socket - Wrapper baileys dengan auto LID conversion
  • 📋 Menu Manager - Sistem menu dinamis untuk bot WhatsApp
  • 📦 Dual Module - Support ESM dan CommonJS
  • 🔍 Auto-detect - Otomatis deteksi Baileys v6/v7 dan gunakan fitur terbaik

Install

npm install @baileys-mod/rekber @whiskeysockets/baileys

Quick Start

import makeWASocket, { useMultiFileAuthState } from '@whiskeysockets/baileys';
import { enhanceSocket } from '@baileys-mod/rekber';

const { state, saveCreds } = await useMultiFileAuthState('./auth');
const sock = makeWASocket({ auth: state });

const { lid, rekber, isV7 } = enhanceSocket(sock, {
  lidConverter: { cachePath: './data/lid-cache.json' },
  rekber: { storagePath: './data/rekber.json', defaultFeePercent: 3 },
  autoExtractLids: true,
});

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

console.log('Baileys v7:', isV7);
// v7: native LID mapping otomatis aktif
// v6: fallback ke cache + store contacts

// === LID Conversion ===
lid.addMapping('123@lid', '[email protected]');
console.log(lid.autoConvert('123@lid')); // [email protected]

// v7: resolve via native LIDMappingStore
const result = await lid.resolveLidViaSocket('123@lid');
console.log(result.source); // 'native' (v7) atau 'store'/'socket' (v6)

// === Rekber Transaction ===
sock.ev.on('messages.upsert', async ({ messages }) => {
  for (const msg of messages) {
    const text = msg.message?.conversation || '';
    // v7: remoteJid bisa berupa LID, gunakan autoConvert
    const from = lid.autoConvert(msg.key.remoteJid || '');
    const sender = lid.autoConvert(msg.key.participant || msg.key.remoteJid || '');

    if (text.startsWith('!rekber ')) {
      const [, sellerNum, ...itemParts] = text.split(' ');
      const tx = rekber.createTransaction({
        buyerJid: sender,
        sellerJid: `${sellerNum}@s.whatsapp.net`,
        adminJid: lid.autoConvert(sock.user?.id || ''),
        groupJid: from,
        items: [{ name: itemParts.join(' '), quantity: 1, price: 100000 }],
      });
      await sock.sendMessage(from, { text: rekber.formatTransaction(tx) });
    }
  }
});

API

LidConverter

| Method | Deskripsi | |--------|-----------| | lidToJid(lid) | Konversi LID ke JID | | jidToLid(jid) | Konversi JID ke LID | | autoConvert(jid, target) | Auto-detect dan konversi | | addMapping(lid, jid) | Tambah mapping manual | | batchConvert(jids, target) | Konversi batch | | resolveLidViaSocket(lid) | Resolve LID → JID via socket (native v7 + fallback) | | resolveJidToLidViaSocket(jid) | Baru: Resolve JID → LID via native v7 mapping | | extractParticipantLids(meta) | Extract dari group metadata | | bindSocket(socket) | Bind ke baileys socket (auto-detect v7) | | bindNativeLidMapping(mapping) | Bind native LIDMappingStore manual | | hasNativeMapping | Cek apakah native mapping tersedia (v7) |

RekberManager

| Method | Deskripsi | |--------|-----------| | createTransaction(params) | Buat transaksi baru | | confirmTransaction(id, sellerJid) | Seller konfirmasi | | confirmPayment(id, adminJid) | Admin konfirmasi bayar | | markProcessing(id, sellerJid) | Tandai sedang dikirim | | confirmDelivery(id, buyerJid) | Buyer konfirmasi terima | | completeTransaction(id, adminJid) | Selesaikan & cairkan | | cancelTransaction(id, byJid) | Batalkan transaksi | | disputeTransaction(id, byJid, reason) | Ajukan sengketa | | refundTransaction(id, adminJid) | Refund ke buyer | | formatTransaction(tx) | Format ke text chat | | getStats(adminJid?) | Statistik rekber |

EnhancedSocket

| Property | Deskripsi | |----------|-----------| | lid | Instance LidConverter | | rekber | Instance RekberManager | | sock | Socket baileys asli | | isV7 | true jika Baileys v7 terdeteksi | | destroy() | Cleanup semua resources |

Baileys v7 Perubahan Penting

Jika upgrade dari v6 ke v7, perhatikan hal berikut:

  1. LID sebagai identifier utamamsg.key.remoteJid bisa berupa LID (xxx@lid), gunakan lid.autoConvert()
  2. Field baru di message keyremoteJidAlt, participantAlt mengandung format alternatif (PN jika remoteJid adalah LID, atau sebaliknya)
  3. Event lid-mapping.update — Baileys v7 emit mapping { pn, lid } secara otomatis, modul ini auto-capture
  4. onWhatsApp() tidak return LID — Gunakan resolveLidViaSocket() atau resolveJidToLidViaSocket() yang memanfaatkan native mapping
  5. Contact format baru — Field phoneNumber dan username ditambahkan

License

MIT