Skip to content

The zoot! Jazzy chatbot returning all the hip swingin' gigs in ol' Melbourne town

License

Notifications You must be signed in to change notification settings

zootytooty/BeBot

Repository files navigation

BeBot

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?

Running BeBot

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.

0. Deployment

BeBot is deployed to Heroku, which simply starts the app (npm start). Collect the hosted domain from:

  1. Enter app (zoot-bot in this case)
  2. Settings
  3. Domain, eg https://what-a-great-app.herokuapp.com

Local hosting might be desirable though for development purposes:

1. Setup NGROK

ngrok allows for exposing local webservers without having to deal with opening ports etc.

  1. Download ngrok & unzip
  2. Navigate to where it's located & start a server on port 3000 using:
./ngrok http 3000

Take note of the https forwarding URL as you'll need to provide that to facebook.

2. Start BeBot

In a new terminal:

  1. Navigate to the bot location:
cd ../BeBot/
  1. Create a .env file 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}
  1. Install dependencies
npm ci
  1. Start BeBot for development. nodemon will watch for changes to files and re-start BeBot for you.
npm run dev
  1. Or to start BeBot regularly.
npm run start

3. Configure Facebook

NOTE: 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.

  1. Navigate to Developer Facebook
  2. Go to My Apps & select your app
  3. Go to Webhooks -> Edit subscription & enter:
    • Callback URL: https://{hostname}:3000/api/messages
    • Verify Token: The value specified in your FACEBOOK_VERIFY_TOKEN environment variable
  4. Go to Messenger -> Settings & scroll down to Webhooks & select the page to subscribe. If required, re-enter the webhook details used in step 3

4. Chat with Zoot

If everything went as planned above you should now be able to chat with Zoot. Start a Facebook messenger chat with Zoot & chat away :)

About

The zoot! Jazzy chatbot returning all the hip swingin' gigs in ol' Melbourne town

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published