Created
August 28, 2014 22:46
-
-
Save ota42y/5b4342b36ba845d40197 to your computer and use it in GitHub Desktop.
When post /hubot/send_message, hubot send message to chat
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
module.exports = (robot) -> | |
robot.router.post "/hubot/send_message", (req, res) -> | |
if not req.body | |
res.end "" | |
return | |
room_name = req.body.room | |
message = req.body.message | |
room_name = process.env.HUBOT_DEFAULT_POST_ROOM unless room_name | |
robot.send {room: room_name}, message | |
res.end "send #{room_name} #{message}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment