From 8127d99bc1ef9ca09ab0675047c1b44afc4e8514 Mon Sep 17 00:00:00 2001 From: link515 Date: Tue, 24 Dec 2019 17:56:11 +0800 Subject: [PATCH] fix: put text into message for send private messages --- src/FacebookBatch.js | 4 +++- src/__tests__/FacebookBatch.spec.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/FacebookBatch.js b/src/FacebookBatch.js index a7ca3c1..57992b6 100644 --- a/src/FacebookBatch.js +++ b/src/FacebookBatch.js @@ -10,7 +10,9 @@ function sendPrivateReply(objectId: string, text: string, options?: Object) { body: { messaging_type: 'UPDATE', recipient: { comment_id: objectId }, - text, + message: { + text, + }, ...options, }, }; diff --git a/src/__tests__/FacebookBatch.spec.js b/src/__tests__/FacebookBatch.spec.js index f6ff24f..6bff3b8 100644 --- a/src/__tests__/FacebookBatch.spec.js +++ b/src/__tests__/FacebookBatch.spec.js @@ -11,7 +11,7 @@ describe('sendPrivateReply', () => { body: { messaging_type: 'UPDATE', recipient: { comment_id: COMMENT_ID }, - text: 'ok', + message: { text: 'ok' }, }, }); }); @@ -27,7 +27,7 @@ describe('sendPrivateReply', () => { body: { messaging_type: 'UPDATE', recipient: { comment_id: COMMENT_ID }, - text: 'ok', + message: { text: 'ok' }, access_token: CUSTOM_ACCESS_TOKEN, }, });