Skip to content

Instantly share code, notes, and snippets.

@MakoTano
Created August 31, 2016 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MakoTano/afe4ecf32dcb5370f2cd2c767409376f to your computer and use it in GitHub Desktop.
Save MakoTano/afe4ecf32dcb5370f2cd2c767409376f to your computer and use it in GitHub Desktop.
単純なレスポンスサンプル
module.exports = (robot) ->
# 「予定表」という言葉に反応してURLを発言
robot.hear /予定表/i, (msg) ->
msg.send "http://sample.com/team/schedule"
# 「hubot my pr」と話かけられたら、自分向けのプルリクエスト一覧URLを発言
# この例はSlackとGithubのアカウント名が同一であることを前提にしていますが、異なる場合は変換が必要です
URL = {}
URL.PR = "https://github.com/eure/repo/pulls/assigned/"
robot.respond /my\spr$/i, (msg) ->
my_name = msg.message.user.name
msg.send "#{URL.PR}#{my_name}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment