fix whatsapp api
This commit is contained in:
@@ -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.`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user