Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sergiopvilar/chatbot-commander
A chatbot commander module to handle strings and call the proper callbacks
https://github.com/sergiopvilar/chatbot-commander
Last synced: about 1 month ago
JSON representation
A chatbot commander module to handle strings and call the proper callbacks
- Host: GitHub
- URL: https://github.com/sergiopvilar/chatbot-commander
- Owner: sergiopvilar
- Created: 2019-10-01T03:29:39.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T22:03:10.000Z (about 2 years ago)
- Last Synced: 2024-04-17T03:50:44.020Z (9 months ago)
- Language: JavaScript
- Size: 271 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Chatbot Commander
[![Build Status](https://travis-ci.org/sergiopvilar/chatbot-commander.svg?branch=master)](https://travis-ci.org/sergiopvilar/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:
```javascript
import ChatbotCommander from 'chatbot-commander'const commander = new ChatbotCommander('!') // Set the command prefix to '!'
// Registers a command
commander.register({command: 'test'}, (input, attrs) => {
console.log(input) // outputs 'foo'
})commander.handle('!test foo')
```