bot-talk
v1.0.0
Published
A simple rule-based Q&A bot library
Downloads
3
Readme
Bot-Talk
A simple regex based Q&A bot library.
Installation
Using npm
$ npm install bot-talk
Basic Usage
const {bot, r} = require("bot-talk");
bot.addRule(r`My name is ([^\s]+)`, "intro.name");
bot.addAnswer("intro.name", "Hello %1");
bot.train();
const result = bot.process("Hello, my name is John");
console.log(result.answer) // Outputs -> Hello John