Skip to content

Instantly share code, notes, and snippets.

@matsuhisa
Created September 9, 2015 16:24
Show Gist options
  • Save matsuhisa/d8b4fa626c8570d1fddb to your computer and use it in GitHub Desktop.
Save matsuhisa/d8b4fa626c8570d1fddb to your computer and use it in GitHub Desktop.
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