A Facebook chatbot for the charity Euan's Guide to help users leave reviews through Facebook as well as their website. The bot sends the user questions for the review as messages takes the responses then emails them to a given email address.
Switching Github account: After forking project: In Heroku, click account settings (top right corner) => applications => revoke access, then add new github account
Deploying using Heroku: In Heroku, click deploy tab and check application is connected to github. You can use 'manual deploy' to deploy any branch in your repository. Please don't rely on automatic deploy to master like the group before us, keep development to develop branch!
When testing, console logs and other useful information will appear in the Heroku console (on the right, => view logs).
Don't expect the "open app" button to do anything, the bot lives on Facebook.
Heroku will wipe all local app files every deploy and also every 24 hours.
You will need to access 'Facebook for Developers' to access the Euan's Guide app and add Facebook accounts as testers/developers. The developer website uses normal Facebook accounts to log in. The off/on button on this page will switch the app to 'live' mode allowing users to see it. You do not need the bot in 'live' mode for testing! The 'get started!' button will not appear to users not added as testers/developers while in development modes.
To change things like the 'get started' info text, send POST requests to the Messenger Profile API (we used Insomnia). The request looked like this: https://graph.facebook.com/v4.0/me/messenger_profile?access_token= [access token goes here!!!]
{ "greeting":[ { "locale":"default", "text":"Hello {{user_full_name}}. You are chatting with a facebook bot, not a person! Click get started to get started. blah blah blah info text" } ] }
The access token is found in Heroku => Settings => Config Vars (you want page_access_token). You will need to do this process again when connecting this bot to the real Euan's Guide page.
Make sure the account you are using is added as a Developer or Tester on the Facebook App then go to the page the bot is connected to, for this app it is: https://www.facebook.com/clancodeeuan/ then click the Send Message button at the top right.
Once the get started button has been clicked the messenger will open and the bot will ask if the user wants to leave a review or chat.
Currently the chat does nothing else than tell the user that the staff will get back to them. If the user clicks Review the bot sends the questions one at a time to the user then waits for a response.