slack-client-hook-word
v0.0.1
Published
simple tool for [node-slack-client](https://github.com/slackhq/node-slack-client)
Downloads
6
Readme
hook-word
simple tool for node-slack-client
Installation
$ npm install slack-client-hook-word
Usage
read source code plz :)
and this is sample code.
var Slack = require("slack-client");
var RtmClient = Slack.RtmClient;
var RTM_EVENTS = Slack.RTM_EVENTS;
var hook = require("slack-client-hook-word");
var rtm = new RtmClient("your token");
rtm.start();
hook.register("foo", function(message) {
console.log("foo");
});
hook.register("bar", function(message) {
console.log("bar");
});
rtm.on(RTM_EVENTS.MESSAGE, function (message) {
hook.call(message);
});
License
The MIT License (MIT)