Closed MartinSahlen closed 6 years ago
@crisboarna Did you see this?
@MartinSahlen : I created a PR https://github.com/crisboarna/fb-messenger-bot-api/pull/64 for this, waiting for approval from @crisboarna.
Hey, will look at this issue in a couple of hours when I get back, glad to see involvement! :D
Thank you @mohyt for the PR ! It was merged 💃 . If you run into any other issues / suggestions, do not hesitate to post a issue/request/pr :)
:tada: This issue has been resolved in version 4.0.1 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
{"message":"(#100) The parameter recipient is required","type":"OAuthException","code":100,"fbtrace_id":"XXX"} is received when trying to use
sendTextMessage
. The reason is this:File:
https://github.com/crisboarna/fb-messenger-bot-api/blob/master/src/client/FacebookMessagingAPIClient.ts
On line 234,
options.json = { recipient: { id } };
sets the recipient. However, on line220 or 226,
options.json
is overwritten with the payload (message or sender_action). The payload needs to be added to the json object and not overwrite it. I have tested locally and it works by doing something likeoptions.json.message = payload
oroptions.json.sender_action = payload
.