Skip to content

Commit

Permalink
Fixing response for button click (#32)
Browse files Browse the repository at this point in the history
* Baselining (#17)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images (#27)

* Baselining with master (#13)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images

* Baselining with master (#14)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Moving images to public directory (#28)

* Baselining with master (#13)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images

* Baselining with master (#14)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Moving images to public directory

* Baselining (#15)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images (#27)

* Baselining with master (#13)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images

* Baselining with master (#14)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Removing redundant img directory from root (#29)

* Baselining with master (#13)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images

* Baselining with master (#14)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Moving images to public directory

* Baselining (#15)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images (#27)

* Baselining with master (#13)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images

* Baselining with master (#14)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Baselining (#16)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images (#27)

* Baselining with master (#13)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images

* Baselining with master (#14)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Moving images to public directory (#28)

* Baselining with master (#13)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images

* Baselining with master (#14)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Moving images to public directory

* Baselining (#15)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images (#27)

* Baselining with master (#13)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Adding full-size mood images

* Baselining with master (#14)

* Adding logging for debugging purposes (#26)

* Update index.js

* Parsing the payload for slack button responses

Following the guidance at https://api.slack.com/tutorials/intro-to-message-buttons

* Removed logging

It works now!

* Removed logging

It works now!

* Removing img from root (they exist in public, where they belong)

* Add REST endpoint for given a time range, return moods within it. (#30)

* remove images and directory from top level

* Fixing response for button click
  • Loading branch information
MLCarey321 authored Jun 29, 2017
1 parent 1196ff3 commit 0ab7a2e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
12 changes: 11 additions & 1 deletion routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

Expand Down
11 changes: 11 additions & 0 deletions scripts/awesome.team.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 0ab7a2e

Please sign in to comment.