0.0.1-pre-alpha.1 • Published 8 years ago
passbot.js v0.0.1-pre-alpha.1
passbot.js
Flexible and modular, chatbot adapter for Node.js
Install
npm install passbot.js --save
Usage
'use strict';
const passbot = require('passbot.js');
passbot.config( {
messenger:{},
slack:{},
kik: {},
hipchat: {},
telegram:{},
skype:{},
twillio: {},
twitter: {},
});
passbot.on('message:received', function(message, reply){
console.log('You have received a message.');
var echo = {
text: message.text
};
reply(echo);
});
passbot.on('message:delivered', function(message){
console.log('Your message was delivered.', message);
});
passbot.on('message:read', function(message){
console.log('Your message was read.', message);
});
passbot.on('message:sent', function(message){
console.log('You sent a message.', message);
});
passbot.on('facebook:message:received', function(message, reply){
console.log('You have received a message on facebook.');
});
passbot.on('slack:message:received', function(message, reply){
console.log('You have received a message on slack.');
});
Schemas
Message
Attribute | Type | Description |
---|---|---|
sender | User | |
recipient | User | |
is_private | Boolean | |
is_group | Boolean | |
provider | Enum,String | |
type | Enum,String | |
id | String | |
externalId | String | |
raw | Mix Object | |
text | String |
User
Attribute | Type | Description |
---|---|---|
externalId | String | |
id | String | |
url | Url, String | |
displayName | String | |
is_bot | Boolean | |
emails | String[] |
Development
Dealing with chat platforms locally can get tricky. Thankfully https://ngrok.com/ helps the process by setting up a secure tunnel to your localhost.
0.0.1-pre-alpha.1
8 years ago
0.0.1-pre-alpha
8 years ago