Created
January 17, 2015 03:49
-
-
Save shokai/e52dd7fdd5d2592878b0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Description: | |
# notify "star_added" event for slack.com | |
# | |
# Author: | |
# @shokai <hashimoto@shokai.org> | |
debug = require('debug')('hubot:slack-star') | |
module.exports = (robot) -> | |
robot.adapter.client?.on? 'raw_message', (msg) -> | |
return unless msg.type is 'star_added' | |
debug msg | |
return unless msg.item.message.permalink | |
user = robot.adapter.client.getUserByID msg.user | |
text = ":star: @#{user.name} added star #{msg.item.message.permalink}" | |
debug text | |
robot.send {room: 'stars'}, text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment