0.1.1 • Published 6 years ago
botmatic-integration v0.1.1
Create your Botmatic integration
Botmatic.ai is a keyboard first experience where you design your chatbot by writing a conversation. You can create your own integration to listen Botmatic events and actions.
Install
npm install --save botmatic-integration
Create a .env file
Create a file named .env to put environment variables with:
BOTMATIC_TOKEN=<your_botmatic_integration_token>
BOTMATIC_PORT=<your_express_server_port>
Usage
Execute action
On Botmatic chatbot editor, you can call custom action. Here you can define your action with:
const botmatic = require('botmatic-integration')
/**
*
*/
botmatic.onAction("my_action", function(data) {
return new Promise((resolve, reject) => {
resolve({data: {test: "data to return"}, type: "data"});
})
})
Listen event
const botmatic = require('botmatic-integration')
botmatic.onEvent("contact_created", function(data) {
return new Promise((resolve, reject) => {
resolve({data: {test: "ok"}, type: "data"});
})
})
More information about Botmatic integration here