var Slack = require('./SlackAPI.js')
Use bot or user token for authentication.
var WebAPI = Slack(<TOKEN>)
Call the API methods.
WebAPI.call('chat.postMessage', {
channel: 'general',
text: 'API is simple(rr)',
attachments: JSON.stringify([
{
fields: [{
'title': 'Status',
'value': '👍'
}]
}
])
}).then(response => {
// it went smoothly!
}).catch(error => {
// something shucks..
})