Skip to content

239626/Baileys

 
 

Repository files navigation

-----------------------------------------------------

Baileys Up To Date

Note: repo ini aktif, karena repo utama sudah dihapus. maka baileys ini sebisa mungkin saya update

GRUP DISKUSI KLIK DISINI

how to use?

change package.json to "@adiwajshing/baileys": "npm:baileys" or "@adiwajshing/baileys": "github:amiruldev20/baileys"

connection options

Note: setting tambahan connection option seperti dibawah ini terlebih dahulu

const connectionOptions = {
printQRInTerminal: true, // memunculkan qr di terminal
syncFullHistory: false, // menerima riwayat lengkap
markOnlineOnConnect: false, // membuat wa bot of, true jika ingin selalu menyala
connectTimeoutMs: 60_000, // atur jangka waktu timeout
defaultQueryTimeoutMs: 0, // atur jangka waktu query (0: tidak ada batas)
keepAliveIntervalMs: 10000, // interval ws
generateHighQualityLinkPreview: true, // menambah kualitas thumbnail preview
// patch dibawah untuk tambahan jika hydrate/list tidak bekerja
patchMessageBeforeSending: (message) => {
    const requiresPatch = !!(
        message.buttonsMessage 
        || message.templateMessage
        || message.listMessage
    );
    if (requiresPatch) {
        message = {
            viewOnceMessage: {
                message: {
                    messageContextInfo: {
                        deviceListMetadataVersion: 2,
                        deviceListMetadata: {},
                    },
                    ...message,
                },
            },
        };
    }

    return message;
},
getMessage: async (key) => {
         if (store) {
            const msg = await store.loadMessage(key.remoteJid, key.id)
            return msg.message || undefined
         }
         return {
            conversation: "hello, i'm Amirul Dev"
         }
      },
// get message diatas untuk mengatasi pesan gagal dikirim, "menunggu pesan", dapat dicoba lagi
}

Amirul Dev Nadia Dev
Adiwajshing Amirul Dev Nadia Dev
Creator Library Developer Most Active Contributor

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 92.1%
  • TypeScript 7.9%