Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD FEATURE]: Pairing code #23

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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