Last active
October 6, 2015 19:02
-
-
Save dieseltravis/253eb1c6fea97f116ab0 to your computer and use it in GitHub Desktop.
hubot clock --> bomb plug-in for slack
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: | |
# it looks like a clock but is probably a bomb | |
# | |
# Dependencies: | |
# None | |
# | |
# Configuration: | |
# None | |
# | |
# Commands: | |
# clock | |
# | |
# Author | |
# dieseltravis | |
# | |
module.exports = (robot) -> | |
robot.hear /\bclocks?\b/i, (msg) -> | |
queryData = { | |
token: process.env.HUBOT_SLACK_TOKEN | |
name: "bomb" | |
channel: msg.message.rawMessage.channel | |
timestamp: msg.message.id | |
} | |
if (queryData.timestamp?) | |
msg.http("https://slack.com/api/reactions.add") | |
.query(queryData) | |
.post() (err, res, body) -> | |
# error handling? | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment