diff --git a/routes/index.js b/routes/index.js index af00411..91e636d 100755 --- a/routes/index.js +++ b/routes/index.js @@ -84,7 +84,17 @@ router.post('/slack-moods', function(req, res, next) { return next(err); } } - res.json(mood); + + var responseAttachment = { + "text": "Thank you for your response!"
, + "fallback": "Oh no! Something went horribly wrong!"
, + "callback_id": "dab_mood_response"
, + "color": "#3AA3E3"
, + "attachment_type": "default"
, + "image_url": "http://wmt-awesome-bot.herokuapp.com/img/mood_" + mood.moodText + "_v2.png"
 + } + + 

res.json(responseAttachment); }); }); diff --git a/scripts/awesome.team.coffee b/scripts/awesome.team.coffee index 520e5a7..68dd65c 100755 --- a/scripts/awesome.team.coffee +++ b/scripts/awesome.team.coffee @@ -242,3 +242,14 @@ module.exports = (robot) -> type: "button" value: "sad" }] + + robot.respond /test response (.*)/i, (msg) ->
 + robot.emit 'slack.attachment', + message: msg.message + content: + text: "Thank you for your response!" + fallback: "Oh no! Something went horribly wrong!" + callback_id: "dab_mood_response"
 + color: "#3AA3E3" + attachment_type: "default" + image_url: "http://wmt-awesome-bot.herokuapp.com/img/mood_" + msg.match[1] + "_v2.png"