Created
September 9, 2015 16:24
-
-
Save matsuhisa/d8b4fa626c8570d1fddb to your computer and use it in GitHub Desktop.
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) -> | |
github = require('githubot')(robot) | |
robot.router.post '/github', (req, res) -> | |
room = 'general' | |
issue = req.body.issue ? req.body.pull_request | |
type = if req.body.pull_request then 'Pull Request' else 'issue' | |
assignee = if issue.assignee then issue.assignee.login else 'No Aassignee' | |
if req.body.action in ['labeled'] | |
if req.body.label.name == "レビュー" | |
robot.messageRoom room, "#{assignee} レビューをお願いします!(#{type}) :dolphin: \n#{issue.title}\n#{issue.html_url}" | |
return res.end '' | |
if req.body.action in ['unlabeled'] | |
if req.body.label.name == "レビュー" | |
robot.messageRoom room, "#{assignee} レビュー終わりました!(#{type}) :dolphin: \n#{issue.title}\n#{issue.html_url}" | |
return res.end '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment