[PR #23] [ADD FEATURE]: Pairing code #53

Open
opened 2026-02-27 10:25:42 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mimamch/wa-multi-session/pull/23
Author: @FERDIZ-afk
Created: 9/27/2023
Status: 🔄 Open

Base: masterHead: pairing-code


📝 Commits (3)

📊 Changes

8 files changed (+466 additions, -192 deletions)

View changed files

📝 package-lock.json (+366 -175)
📝 package.json (+3 -2)
📝 src/Defaults/index.ts (+1 -0)
📝 src/Messaging/index.ts (+1 -1)
📝 src/Socket/index.ts (+88 -9)
📝 src/Types/index.ts (+5 -3)
📝 src/Utils/message-status.ts (+1 -1)
📝 src/Utils/save-media.ts (+1 -1)

📄 Description

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: ""
  });

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mimamch/wa-multi-session/pull/23 **Author:** [@FERDIZ-afk](https://github.com/FERDIZ-afk) **Created:** 9/27/2023 **Status:** 🔄 Open **Base:** `master` ← **Head:** `pairing-code` --- ### 📝 Commits (3) - [`4ed27e8`](https://github.com/mimamch/wa-multi-session/commit/4ed27e809382dd33fe84c1272e610b9e10652ac4) add module typescript - [`b082de5`](https://github.com/mimamch/wa-multi-session/commit/b082de5be0e99026c142d395c99c8d59271b768e) add conect via pairing-code - [`38cd906`](https://github.com/mimamch/wa-multi-session/commit/38cd90604b7c07a97f827c1a64b2a065942c9dc0) add conect via pairing-code ### 📊 Changes **8 files changed** (+466 additions, -192 deletions) <details> <summary>View changed files</summary> 📝 `package-lock.json` (+366 -175) 📝 `package.json` (+3 -2) 📝 `src/Defaults/index.ts` (+1 -0) 📝 `src/Messaging/index.ts` (+1 -1) 📝 `src/Socket/index.ts` (+88 -9) 📝 `src/Types/index.ts` (+5 -3) 📝 `src/Utils/message-status.ts` (+1 -1) 📝 `src/Utils/save-media.ts` (+1 -1) </details> ### 📄 Description 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: "" }); ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wa-multi-session-mimamch#53
No description provided.