slack-client-hook-word

simple tool for node-slack-client

Usage no npm install needed!

<script type="module">
  import slackClientHookWord from 'https://cdn.skypack.dev/slack-client-hook-word';
</script>

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)