This commit is contained in:
@@ -28,7 +28,7 @@ async function waitForGateway() {
|
|||||||
log('info', '🟢 nucleo-whatsapp ready');
|
log('info', '🟢 nucleo-whatsapp ready');
|
||||||
return;
|
return;
|
||||||
} catch {
|
} catch {
|
||||||
log('warn', `Gateway not responding (attempt ${i}/${config.MAX_ATTEMPTS})…`);
|
log('warn', `Gateway not responding`,' connecting to: ', openWaUrl, ` (attempt ${i}/${config.MAX_ATTEMPTS})…`);
|
||||||
await new Promise(r => setTimeout(r, config.RETRY_MS));
|
await new Promise(r => setTimeout(r, config.RETRY_MS));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,7 +111,7 @@ async function registerWebhook() {
|
|||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
app.post('/webhook', async (req: express.Request, res: express.Response) => {
|
app.post('/webhook', async (req: express.Request, res: express.Response) => {
|
||||||
log('info', 'webhook received');
|
log('info', 'webhook received', req.body);
|
||||||
|
|
||||||
const { message, text, from } = req.body as { message?: WhatsAppMessage; text?: string; from?: string };
|
const { message, text, from } = req.body as { message?: WhatsAppMessage; text?: string; from?: string };
|
||||||
const incoming = message || text;
|
const incoming = message || text;
|
||||||
|
|||||||
Reference in New Issue
Block a user