This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
hubot-slack-reaction-example with all
npm packages installed. Try it out:
hubot-slack-reaction-example lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
All of the example code is in
Clone this repo:
$ git clone https://github.com/mbland/hubot-slack-reaction-example $ cd hubot-slack-reaction-example $ npm install
You must have administrator access for your Slack domain. Alternatively, you can create your own personal slack domain for testing.
Create a new Slack bot user for your team. Name it
anything you like, such as
reaction-example-bot. Take note of the
API token, which should start with
Invite the bot to a channel by
@-mentioning it in the channel, e.g.
Run the bot:
$ HUBOT_SLACK_TOKEN=<bot-test-token> ./bin/hubot --adapter slack
you should see output like:
[Sun Oct 09 2016 12:22:12 GMT-0400 (EDT)] INFO Logged in as reaction-example-bot of mbland [Sun Oct 09 2016 12:22:12 GMT-0400 (EDT)] INFO Slack client now connected [Sun Oct 09 2016 12:22:12 GMT-0400 (EDT)] INFO Listening for reaction_added, reaction_removed events
Post a message in your Slack domain and add an emoji reaction to it.
Now you should see something like:
That said, this is example code. Feel free to do with it what you like even without retaining the copyright. However, since publishing code as public domain still seems more complicated than it needs to be, the license is there if you need legal coverage.