Skip to content

Instantly share code, notes, and snippets.

@dieseltravis
Last active October 6, 2015 19:02
Show Gist options
  • Save dieseltravis/253eb1c6fea97f116ab0 to your computer and use it in GitHub Desktop.
Save dieseltravis/253eb1c6fea97f116ab0 to your computer and use it in GitHub Desktop.
hubot clock --> bomb plug-in for slack
# 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