fix whatsapp api

This commit is contained in:
ItsMalma
2025-12-01 20:26:35 +07:00
parent 113434f8de
commit 365a438eae

View File

@@ -31,7 +31,6 @@ export class WhatsAppController extends Controller {
async webhook(req: Request, res: Response) {
const body = req.body as WhatsAppWebhookPayload;
console.log(JSON.stringify(body, null, 2));
const messageText = body.entry[0].changes[0].value.messages[0].text.body;
const sessionCode = messageText
@@ -62,15 +61,13 @@ export class WhatsAppController extends Controller {
salutation = "malam";
}
console.log(this.whatsAppService);
await this.whatsAppService.sendMessage(
body.entry[0].changes[0].value.messages[0].from,
`Selamat ${salutation},
Anda akan terhubung dengan mitra kami untuk konsultasi.
Saudara ${"Adam Akmal Madani"}
Nomor: ${"085218606125"}
Saudara ${partner.name}
Nomor: ${partner.whatsapp}
Terima kasih.`,
);