RSFB - Really Simple Facebook Bot
For more information you can check out this blog post from ClaudiaJS.
Setup AWS Account
If you are new to AWS you have to create an account and configure it to work on your computer, otherwise you can skip this section.
- Register to AWS
- Go to IAM/Users and create an User
- Add Permissions To User
- AWSLambdaFullAccess (to create-update-delete Lambdas)
- IAMFullAccess (to configure ClaudiaJs Executor Roles)
- AmazonAPIGatewayAdministrator (to create HTTP Endpoints)
- Go to tab 'Security Credentials' and create an Access Key and save the keys somewere in your computer
- Install on your computer awscli
- On Mac:
brew install awscli
- On Mac:
awscli configureand add the Access keys required
Installation and first deploy
You don't need to install ClaudiaJS globally because it's a dependency of the project and is configured as a npm script.
- Clone the project
git clone https://github.com/AlessioCoser/fb-bot-claudia.git
- Install dependencies
- Deploy the function
npm run claudia -- create --region us-east-1 --api-module bot
Configure with Facebook Messenger App
- Go to Facebook Developer page
- Create new Facebook Messenger App
- Associate it to a Page (or create a new page)
- Copy its
npm run claudia -- update --configure-fb-bot
- You will be requested to enter
Facebook Page Access Token: the access Token from page associated to the Facebook Messenger App
Facebook App Secret: the app secret from Facebook Messenger App
- Configure the WebHook into Facebook Developer App Console by insering
Verify Tokenfrom step 4.
- Publish your Facebook Messenger App
- You have to submit your Messenger Application to Facebook in order to be able to respond to Facebook users that are not admins, developers or testers of your application.