Deploy: 2026-06-24 14:41:57
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
"start": "node server.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"whatsapp-web.js": "^1.23.0",
|
||||
"whatsapp-web.js": "^1.26.0",
|
||||
"puppeteer": "^21.0.0",
|
||||
"qrcode": "^1.5.3",
|
||||
"axios": "^1.7.2",
|
||||
|
||||
@@ -74,15 +74,10 @@ async function startSession(session_key, webhook_url) {
|
||||
|
||||
client.on('qr', async (qr) => {
|
||||
console.log(`[QR] Generated for ${session_key}`);
|
||||
const QRCode = require('qrcode');
|
||||
QRCode.toDataURL(qr, async (err, url) => {
|
||||
if (!err) {
|
||||
await sendWebhook(webhook_url, {
|
||||
session_key,
|
||||
state: 'waiting_qr',
|
||||
qr_code: url
|
||||
});
|
||||
}
|
||||
qr_code: qr
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -120,6 +120,12 @@ app.post('/api/messages/send', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// Auto-start default session
|
||||
setTimeout(() => {
|
||||
console.log('🔄 Auto-starting default session: flash_call_otp');
|
||||
startSession('flash_call_otp', 'https://otp.intaleqapp.com/api/whatsapp-webhook.php').catch(console.error);
|
||||
}, 2000);
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`🚀 Flash Call OTP WhatsApp Gateway running on port ${PORT}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user