Skip to content

Instantly share code, notes, and snippets.

@kirkins
Last active October 5, 2018 18:52
Show Gist options
  • Save kirkins/ce66b5fa88e17459c32e3e86a0bba45b to your computer and use it in GitHub Desktop.
Save kirkins/ce66b5fa88e17459c32e3e86a0bba45b to your computer and use it in GitHub Desktop.
const botBuilder = require('claudia-bot-builder');
const AIMLInterpreter = require('aimlinterpreter');
var aimlInterpreter = new AIMLInterpreter({name:'Philip', age:'42'});
aimlInterpreter.loadAIMLFilesIntoArray(["aiml/bot.aiml"]);
module.exports = botBuilder(function (request) {
});
module.exports = botBuilder(message => {
aimlInterpreter.findAnswerInLoadedAIMLFiles("how do you work?", function(answer, wildCardArray, input){
if(answer){
return answer;
}else{
return "no response found in aiml";
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment