Last active
August 22, 2016 02:34
-
-
Save UncannyBingo/81d8feeea27dea93d8c772cdcb0c3b1f to your computer and use it in GitHub Desktop.
slackbot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/slackhq/easy-peasy-bot | |
git clone [email protected]:slackuserdegoodmanwilson2/easy-peasy-bot.git | |
npm install --save botkit-middleware-apiai | |
var apiai = require('botkit-middleware-apiai')({ | |
token: process.env.APIAI_TOKEN | |
}); | |
controller.middleware.receive.use(apiai.receive); | |
//controller.hears(['hello'], 'direct_message,mention,direct_mention', apiai.hears, function ( | |
controller.hears(['hello'], 'direct_message', apiai.hears, function ( | |
bot, message) { | |
bot.reply(message, 'Hello!'); | |
}); | |
controller.hears(['booking'], 'direct_message', apiai.hears, function (bot, message) { | |
if(message.fulfillment.speech !== '') { | |
bot.reply(message, message.fulfillment.speech); | |
} else { | |
bot.reply(message, "You requested to fly to " + message.entities['geo-city'] + " on " + message.entities['date']+"."); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment