Skip to content

Conversation

@FERDIZ-afk
Copy link

To run the code using the pairing code is as follows

const whatsapp = require("wa-multi-session");

// create session with ID : mysessionid
async function bot() {

  var sessionId = "mysessionid"
  const session = await whatsapp.startSession(sessionId, options = {
    pairingNumber: "6287xxxxxxxxxxx"
  }
  );

  whatsapp.onPairingCodeUpdated(({ sessionId, PairCode }) => {
    console.log(`Your Pairing Code : `+PairCode);
  });
  whatsapp.onConnecting((sessionId) => {
    console.log("session connected :" + sessionId);
  });
  whatsapp.onMessageReceived((msg) => {
    console.log(`New Message Received On Session: ${msg.sessionId} >>>`, msg);
  });

}
bot()

If you want to use a QR code then leave the option blank

const session = await whatsapp.startSession(sessionId, options = {
    pairingNumber: ""
  });

@FERDIZ-afk FERDIZ-afk changed the title Pairing code [ADD FEATURE]: Pairing code Sep 27, 2023
@mimamch
Copy link
Owner

mimamch commented Sep 28, 2023

Thank you for contributing. I will check your PR soon.

@FERDIZ-afk
Copy link
Author

Thank you for contributing. I will check your PR soon.

Jadi gimana bang?

@mimamch
Copy link
Owner

mimamch commented Oct 6, 2023

Hi @FERDIZ-afk, sepertinya dalam pengiriman dan penulisan parameter options kurang optimal ya! mungkin bisa disederhanakan lagi.

@mimamch mimamch added the new feature Adding new feature label Oct 6, 2023
@FERDIZ-afk
Copy link
Author

Hi @FERDIZ-afk, sepertinya dalam pengiriman dan penulisan parameter options kurang optimal ya! mungkin bisa disederhanakan lagi.

Hi @FERDIZ-afk, sepertinya dalam pengiriman dan penulisan parameter options kurang optimal ya! mungkin bisa disederhanakan lagi.

Apa harus saya ubah jadi begini. Untuk parameter options nya?

options = {
qrcode: true,
pairingNumber: "6287xxxxxxxxxxx"
}

@mimamch
Copy link
Owner

mimamch commented Oct 31, 2023

Error kenapa ya? kadang bisa, kadang error seperti itu

Screenshot 2023-10-31 at 20 19 45

@FERDIZ-afk
Copy link
Author

Error kenapa ya? kadang bisa, kadang error seperti itu

Screenshot 2023-10-31 at 20 19 45

Oh itu saya juga kurang tau gan soalnya sekarang pairing code sedang bermasalah dari library pusat juga begitu.

@FERDIZ-afk
Copy link
Author

Untuk sementara pairing code nya jangan di otak Atik bos itu yang sudah lu update di repolu

Jadi sekarang make qr dulu aja bos

const session = await whatsapp.startSession(sessionId);

Seperti biasa gini aja dulu gan

@mimamch
Copy link
Owner

mimamch commented Nov 6, 2023

Untuk sementara pairing code nya jangan di otak Atik bos itu yang sudah lu update di repolu

Jadi sekarang make qr dulu aja bos

const session = await whatsapp.startSession(sessionId);

Seperti biasa gini aja dulu gan

betul, sepertinya masih belum stabil untuk pairing code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature Adding new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants