1.0.3 • Published 1 year ago
chatbotframeworkbyzhiva8 v1.0.3
# Chatbot Framework
A simple and flexible Chatbot Framework for building conversational interfaces in JavaScript.
## Installation
Install the package using npm:
```bash
npm install chatbot-framework
```
## Usage
```javascript
const Chatbot = require('chatbot-framework');
// Create a new instance of Chatbot
const bot = new Chatbot();
// Define plugins
function greetingPlugin(message) {
const greetings = ["hi", "hello", "hey"];
if (greetings.includes(message.toLowerCase())) {
return "Hello! How can I assist you?";
}
}
// Use plugins
bot.use(greetingPlugin);
// Process messages
async function processMessage() {
const userInput = "Hi";
const response = await bot.processMessage(userInput);
console.log(response);
}
processMessage();
```
## Plugins
You can extend the functionality of the chatbot by adding plugins. Plugins are functions that take a message as input and return a response if the message matches certain criteria.
## Contributing
Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue on GitHub.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.