claudiajs / claudia-bot-builder

Create chat bots for Facebook Messenger, Slack, Amazon Alexa, Skype, Telegram, Viber, Line, GroupMe, Kik and Twilio and deploy to AWS Lambda in minutes
https://claudiajs.com/claudia-bot-builder.html
MIT License
1.84k stars 253 forks source link

Setup Facebook Messenger API ver 4.0 #134

Open shnjtk opened 4 years ago

shnjtk commented 4 years ago

Fixed to be able to setup Facebook Messenger with API v4.0.

It shows following prompt at claudia create --configure-fb-bot command. We need two additional parameters, page ID and subscribed fields.

Facebook page access token: <YOUR_FB_PAGE_ACCESS_TOKEN>
Facebook App Secret: <YOUR_FB_APP_SECRET>
Facebook page ID: <YOUR_FB_PAGE_ID>
Subscribed fields (comma separated): messages, messaging_postbacks
shnjtk commented 4 years ago

PR#133 was very helpful, thanks @prathmj

simalexan commented 4 years ago

@shnjtk Thank you for your contribution! Much appreciated May I ask you to add / modify the corresponding test? If needed I can help out with some insight

shnjtk commented 4 years ago

@simalexan Sure, will do. I'll ask you if I need some help, thanks.

shnjtk commented 4 years ago

@simalexan I've added the test. Would you check?

I used process.stdin.emit and setTimeout for emulating user input. Please let me know If you know a better way.

Here is a test coverage by nyc.

Screenshot 2019-10-25 0 52 16

cstpalash commented 4 years ago

Isn't merged to master?