0.0.3 • Published 6 years ago

chatbot-commander v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Chatbot Commander

A chatbot-commander module to handle strings and call the proper callbacks, particularly usefull for command oriented chatbots.

How to use

At first don't forget to install the dependencies:

yarn add chatbot-commander

Then import the module and start the fun:

import ChatbotCommander from 'chatbot-commander'

const commander = new ChatbotCommander('!') // Set the command prefix to '!'

// Registers a command
commander.register({'test'}, (input, attrs) => {
  console.log(input) // outputs 'foo'
})

commander.handle('!test foo')
0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago