1.0.0 • Published 3 years ago
bot-talk v1.0.0
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
License
1.0.0
3 years ago