The main zoot chatbot. This is very much in its infancy & currently most resembles a development playground. Expect it to change.
Currently the supported functionality & keywords are supported:
| Action | Examples |
|---|---|
| What's On | What's happening? Who's playing at jazzlab? What's on tomorrow? Show me todays gigs |
| Help | Help! help me What can you do? |
| Hello | Hey! Hello sup |
| Venues | What're the cool venues? What're the hip joints around town? What venues are there? |
Quite a number of steps are required to get BeBot up & running. Simplifying this process & making it repeatable for multiple developers in parallel is something that is absolutely required.
BeBot is deployed to Heroku, which simply starts the app (npm start). Collect the hosted domain from:
- Enter app (
zoot-botin this case) - Settings
- Domain, eg
https://what-a-great-app.herokuapp.com
Local hosting might be desirable though for development purposes:
ngrok allows for exposing local webservers without having to deal with opening ports etc.
- Download ngrok & unzip
- Navigate to where it's located & start a server on port 3000 using:
./ngrok http 3000Take note of the https forwarding URL as you'll need to provide that to facebook.
In a new terminal:
- Navigate to the bot location:
cd ../BeBot/- Create a
.envfile so the app can load in required tokens and secrets
FACEBOOK_APPID={appId}
FACEBOOK_APP_SECRET={appSecret}
FACEBOOK_ACCESS_TOKEN={accessToken}
FACEBOOK_VERIFY_TOKEN={verifyToken}
WIT_TOKEN={witToken}- Install dependencies
npm ci- Start BeBot for development. nodemon will watch for changes to files and re-start BeBot for you.
npm run dev- Or to start BeBot regularly.
npm run startNOTE: BeBot must be started before this step or Facebook won't accept the webhook URL as valid.
Next we'll configure our Facebook page to talk to allow messenger conversations & tell it how to connect with our chatbot.
- Navigate to Developer Facebook
- Go to
My Apps& select your app - Go to
Webhooks->Edit subscription& enter:- Callback URL:
https://{hostname}:3000/api/messages - Verify Token: The value specified in your
FACEBOOK_VERIFY_TOKENenvironment variable
- Callback URL:
- Go to
Messenger->Settings& scroll down toWebhooks& select the page to subscribe. If required, re-enter the webhook details used in step 3
If everything went as planned above you should now be able to chat with Zoot. Start a Facebook messenger chat with Zoot & chat away :)