README
The Slack Real Time Messaging module is a WebSocket-based API that allows
you to create advanced Slack Bots to send and receive messages in real time.
≪ Documentation · My other Modules · Buy me a Coffee ≫
Made with ♥ by Jeffrey Lanters
Hard work in progress!!
This package is currently is developement. You can use the beta version to test the current build, but keep in mind future changes may be made. Thanks for testing!
Installation
Install using npm.
$ npm install slack-real-time-messaging@1.0.0-beta.3
Example usage
IN DEVELOPMENT
const rtmClient = new RTMClient({
token: "..."
});
rtmClient.addListener("start", async _slack => {
const _user = await rtmClient.getUser("jeffrey2");
rtmClient.postMessageToUser(
"jeffrey2",
_user.is_admin ? "Hey boss!" : "Hey!"
);
rtmClient
.postMessageToUser("jeffrey2", "Hey!")
.then(_message => {})
.catch(_reason => {
console.log("Error");
console.log(_reason);
});
});