Skip to content

Commit

Permalink
fix: get waid from messages instead of contacts (#2223)
Browse files Browse the repository at this point in the history
  • Loading branch information
jia1 committed Sep 19, 2023
1 parent d7374b6 commit 943315d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions backend/src/govsg/services/govsg-callback.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ const parseUserMessageWebhook = async (
body: UserMessageWebhook,
clientId: WhatsAppApiClient
): Promise<void> => {
const { wa_id: whatsappId } = body.contacts[0]
const { id: messageId, type } = body.messages[0]
const { id: messageId, from: whatsappId, type } = body.messages[0]
if (type !== WhatsappWebhookMessageType.text) {
// not text message, log and ignore
logger.info({
Expand Down

0 comments on commit 943315d

Please sign in to comment.