All of the example code is in
Running the bot
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:
After the message received the +1 emoji reaction, the example bot posted a response to the channel reporting the details of the event.
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.