A lighting talk to help solve the national epidemic of Atrocious Tie Length using the technology of a bot.
Summarizes how to get started building bots with Botkit.
JavaScriptwithBuIlDiNg
View Slide
CoMmEnCe Eye RoLlInGJavaScriptwithBuIlDiNg
CoMmEnCe Eye RoLlInG
ThE InTeRnEt IsReAdY AgAiN
ThE InTeRnEt IsReAdY AgAiN2 eVeNtS
ReAdY AgAiN2 eVeNtS
AtRoCiOuS TiE LeNgTh
StAnDaRd TiE LeNgTh
StAnDaRd TiE LeNgTh58" Un-TiEd
StAnDaRd TiE LeNgTh58" Un-TiEd6'2"
StAnDaRd TiE LeNgTh58" Un-TiEd6'2" 18"
StAnDaRd TiE LeNgTh58" Un-TiEd6'2" 18" 22"
58" Un-TiEd6'2" 18" 22"68"
StAnDaRd LeNgTh TiEDeLiVeRy As A SeRvIcE
AmAzInG tIeS, VeRy, vErYsTaNdArD, eVeRyOnE iSsAyInG tHeSe tIeS aRetReMeNdOuS, lLc
AmAzInG tIeS, VeRy, vErYsTaNdArD, eVeRyOnE iSsAyInG tHeSe tIeS aRetReMeNdOuS, lLc™
AtVvSeIsTtAt, LlC.
AtVvSeIsTtAt-bOt
BoTkItgItHuB.cOm/hOwDyAi/bOtKiT
> npm install --save botkit
// package.json{// ..."main": "bot.js","dependencies": {"botkit": "^0.5"}}
// bot.jsvar Botkit = require('botkit');var controller = Botkit.slackbot({clientId: process.env.clientId,clientSecret: process.env.cSecret,scopes: ['bot']});
// bot.jscontroller.spawn().startRTM(function(error) {if (error) {// Handle web socket issues// Restart when possible}});
// bot.jscontroller.hears(['I want a tie'],['direct_message'],function(bot, message) {bot.say('I hope you want it in standard length!');});
// bot.js// ..controller.hears(['I want a tie'], ['direct_message'], function(bot, message) {bot.startConversation(message, askColor);});askColor = function(response, convo) {convo.ask('What color do you want?', function(response, convo) {storeColor(response.text);convo.say('Got it. Tremendous color.');askDelivery(response, convo);convo.next();});}askDelivery = function(response, convo) {convo.ask('Where do you want this shipped?', function(response, convo) {ensureNotMexico(response.text, function() {convo.say('Consider it done');convo.next();});});}
StAnDaRd LeNgTh TiEDeLiVeRy As A SeRvIcEA.I. PoWeReD
StAnDaRd LeNgTh TiEDeLiVeRy As A SeRvIcEA.I. PoWeReD™
NaTuRaL LaNgUaGePrOcEsSiNg
NaTuRaL LaNgUaGePrOcEsSiNgI want a tie
NaTuRaL LaNgUaGePrOcEsSiNgI want a tieI need a neck tie
I need a neck tie
I need a neck tieNlP
I need a neck tieNlP[{"intent": "buy",}]
I need a neck tieNlP[{"intent": "buy",}]"entities": ["action": "need","item": "tie"],
I need a neck tieNlP[{"intent": "buy",}]"entities": ["action": "need","item": "tie"],"confidence": "0.82"
> npm install --save api-ai-botkitApI.Ai
// bot.jsconst apiaibotkit = require('api-ai-botkit');const apiai =apiaibotkit(process.env.apiAiToken);ApI.Ai
// bot.jscontroller.hears('.*',['direct_message'], function(bot,message) {apiai.process(message, bot);});ApI.Ai
// bot.jsapiai.action('buy', function(message, response,bot) {var responseText =response.result.fulfillment.speech;bot.reply(message, responseText);bot.startConversation(message, askColor);});ApI.Ai
@jWrIgHt