diff --git a/README.md b/README.md index 633b578..3c69b3e 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Missing Nodes ? : To avoid long names, Node names are updated. If some node are ![](./.github/admin_login.gif) 1. Deploy whatsapp admin node (along with whatsappLink node). -2. whatsappLink node will initilize, connect with whatsapp and generate a QR code below the Admin Node and in terminal also. +2. whatsappLink node will initilize, connect with whatsapp and generate a QR code below the Admin Node (in terminal also). 3. Scan the QR code with your Whatsapp Mobile App (Go to settings > Linked device > Scan & Connect). 4. Done - Whatsapp Connected. diff --git a/group-out.html b/group-out.html index 1ca7315..dc460c0 100644 --- a/group-out.html +++ b/group-out.html @@ -27,7 +27,7 @@
- +
diff --git a/whatsappLink.js b/whatsappLink.js index e8de747..7781358 100644 --- a/whatsappLink.js +++ b/whatsappLink.js @@ -1,14 +1,20 @@ module.exports = function(RED) { const { Client, LocalAuth } = require('whatsapp-web.js'); const QRCode = require('qrcode'); + const OS = require('os'); + const Path = require('path'); - function RemoteClientNode(n) { + let userDir = OS.homedir(); + let whatsappLinkDir = Path.join(userDir, '.node-red', 'Whatsapp-Link'); + function RemoteClientNode(n) { RED.nodes.createNode(this,n); let WAnode = this; let whatsappConnectionStatus; const client = new Client({ - authStrategy : new LocalAuth(), + authStrategy : new LocalAuth({ + dataPath : whatsappLinkDir + }), puppeteer : {headless : true } });