This is the Slack client library for node.js, it:
- wraps the Slack Web API methods
- exposes the Real Time Messaging API's functionality
npm install slack-client --save
var WebClient = require('slack-client').WebClient;
var RtmClient = require('slack-client').RtmClient;
var token = '' || process.env.SLACK_API_TOKEN;
var webClient = new WebClient(token);
var rtm = new RtmClient(webClient, {logLevel: 'debug'});
rtm.start();
rtm.on('message', function(message) {
console.log(message);
});
A full example of how to use this module from Node.js can be found in the /examples directory.
Here's the most direct way to get your work merged into the project.
- Fork the project
- Clone down your fork
- Create a feature branch
- Hack away and add tests, not necessarily in that order
- Make sure everything still passes by running tests
- If necessary, rebase your commits into logical chunks without errors
- Add yourself to package.json as a contributor
- Push the branch up to your fork
- Send a pull request for your branch
Copyright © Slack Technologies, Inc. MIT License; see LICENSE for further details.
- add a retry policy to the web API
- handle and respect 429 responses in the web API
- update the remaining models to correctly pull out all properties
- figure out how data-store updates should handle updating objects where a richer object is already present, e.g. the self user is cached on RTM start and then a simplified version of the user object is received and overwrites it
- figure out how to make data-store methods async friendly, e.g. so that a redis data-store could be a thing
- improve the events emitted by the RTM api, e.g. errors etc.
- improve test coverage of the RTM Client API