slacquer
v0.1.3
Published
Send and receieve messages from Slack in Node.js.
Downloads
21
Maintainers
Readme
Slacquer
Send and receieve messages from Slack in Node.js!
Usage
Import
You can import either via CommonJS or ES6, depending on what you're using.
var Slacquer = require( 'slacquer' );
or
import Slacquer from 'slacquer';
Send
let slack = new Slacquer( 'https://mywebhook.url/192873982173' );
// Slacquer.send is a Promise
slack.send({
text: 'This is a test.',
channel: '#testing-bots',
username: 'my-cool-bot'
})
.then( response => {
// do something with <response.body>
})
;
Respond
let slack = new Slacquer( 'https://mywebhook.url/192873982173' );
slack.respond( req.body )
.then( response => {
console.log( response.userName + ' said: "' + response.text + '"' );
})
;
Build
You can build easily with gulp
, which will test then build. To just test, run gulp test
. More tests are coming...
Requirements
You'll need a Slack account and a webhook URL set up.
Contribute
Please fork the project, then use a pull request to make improvements and fixes.
Authors and Acknowledgements
Written by Robert Gerald Porter.
Based upon node-slack by Ben Brown.
License
BSD