1.0.0 • Published 5 years ago
node-safety v1.0.0
node-safety
This library is an example of how you can make a library for the Safety messenger API on Node.JS
Installation
Library requires Node.JS v8.0.0+ to run.
$ npm install node-safety
Example polling
const {Safety} = require('node-safety');
const safety = new Safety({
access_token: process.env.TOKEN
});
safety.startPolling(async (response) => {
const {event, data} = response;
if(event === 'message') {
console.log(`Wow! User #${data.sender_id} sended message "${data.message}" for you!`);
}
});
1.0.0
5 years ago