Spaces:
Paused
Paused
Update index.js
Browse files
index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
const express = require('express');
|
| 2 |
const fs = require('fs');
|
| 3 |
const path = require('path');
|
| 4 |
-
const
|
| 5 |
const makeWASocket = require('@whiskeysockets/baileys').default;
|
| 6 |
const Boom = require('@hapi/boom');
|
| 7 |
|
|
@@ -127,7 +127,7 @@ async function connectToWhatsApp(apiKey, ip) {
|
|
| 127 |
console.log('Opened connection');
|
| 128 |
} else if (qr) {
|
| 129 |
// Send QR code to client
|
| 130 |
-
const qrImage =
|
| 131 |
fs.writeFileSync(path.join(sessionDir, `${apiKey}_qr.svg`), qrImage);
|
| 132 |
}
|
| 133 |
});
|
|
|
|
| 1 |
const express = require('express');
|
| 2 |
const fs = require('fs');
|
| 3 |
const path = require('path');
|
| 4 |
+
const qri = require('qr-image');
|
| 5 |
const makeWASocket = require('@whiskeysockets/baileys').default;
|
| 6 |
const Boom = require('@hapi/boom');
|
| 7 |
|
|
|
|
| 127 |
console.log('Opened connection');
|
| 128 |
} else if (qr) {
|
| 129 |
// Send QR code to client
|
| 130 |
+
const qrImage = qri.imageSync(qr, { type: 'svg' });
|
| 131 |
fs.writeFileSync(path.join(sessionDir, `${apiKey}_qr.svg`), qrImage);
|
| 132 |
}
|
| 133 |
});
|