chatbot-commander

    0.0.3 • Public • Published

    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')

    Keywords

    none

    Install

    npm i chatbot-commander

    DownloadsWeekly Downloads

    1

    Version

    0.0.3

    License

    MIT

    Unpacked Size

    3.89 kB

    Total Files

    5

    Last publish

    Collaborators

    • sergiovilar