0.0.3 • Published 5 years ago

chatbot-commander v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
5 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

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago