1.0.0 • Published 3 years ago

bot-talk v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

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

MIT