{"action":"opened","number":1021,"pull_request":{"url":"https://api.github.com/repos/github/hubot/pulls/1021","id":41824971,"html_url":"https://github.com/github/hubot/pull/1021","diff_url":"https://github.com/github/hubot/pull/1021.diff","patch_url":"https://github.com/github/hubot/pull/1021.patch","issue_url":"https://api.github.com/repos/github/hubot/issues/1021","number":1021,"state":"open","locked":false,"title":"Response middleware","user":{"login":"bhuga","id":12676,"avatar_url":"https://avatars.githubusercontent.com/u/12676?v=3","gravatar_id":"","url":"https://api.github.com/users/bhuga","html_url":"https://github.com/bhuga","followers_url":"https://api.github.com/users/bhuga/followers","following_url":"https://api.github.com/users/bhuga/following{/other_user}","gists_url":"https://api.github.com/users/bhuga/gists{/gist_id}","starred_url":"https://api.github.com/users/bhuga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhuga/subscriptions","organizations_url":"https://api.github.com/users/bhuga/orgs","repos_url":"https://api.github.com/users/bhuga/repos","events_url":"https://api.github.com/users/bhuga/events{/privacy}","received_events_url":"https://api.github.com/users/bhuga/received_events","type":"User","site_admin":true},"body":"Hot on the heels of #1019, response middleware gives you the chance to edit outgoing messages.\r\n\r\nIt looks like this:\r\n\r\n```coffeescript\r\n# Replace markdown links with slack's dumb <url|text> format.\r\nmodule.exports = (robot) ->\r\n  robot.responseMiddleware (context, next, done) ->\r\n    regex = /\\[([^\\[\\]]*?)\\]\\((https?:\\/\\/.*?)\\)/g\r\n\r\n    context.string = context.string.replace(regex, \"<$2|$1>\")\r\n    next(done)\r\n```","created_at":"2015-08-06T19:25:47Z","updated_at":"2015-08-06T19:25:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/github/hubot/pulls/1021/commits","review_comments_url":"https://api.github.com/repos/github/hubot/pulls/1021/comments","review_comment_url":"https://api.github.com/repos/github/hubot/pulls/comments{/number}","comments_url":"https://api.github.com/repos/github/hubot/issues/1021/comments","statuses_url":"https://api.github.com/repos/github/hubot/statuses/ea1de9c2e1f5fd32e7e0acbe215c537779b113a5","head":{"label":"github:response-middleware","ref":"response-middleware","sha":"ea1de9c2e1f5fd32e7e0acbe215c537779b113a5","user":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"repo":{"id":2278524,"name":"hubot","full_name":"github/hubot","owner":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/github/hubot","description":"A customizable life embetterment robot.","fork":false,"url":"https://api.github.com/repos/github/hubot","forks_url":"https://api.github.com/repos/github/hubot/forks","keys_url":"https://api.github.com/repos/github/hubot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/github/hubot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/github/hubot/teams","hooks_url":"https://api.github.com/repos/github/hubot/hooks","issue_events_url":"https://api.github.com/repos/github/hubot/issues/events{/number}","events_url":"https://api.github.com/repos/github/hubot/events","assignees_url":"https://api.github.com/repos/github/hubot/assignees{/user}","branches_url":"https://api.github.com/repos/github/hubot/branches{/branch}","tags_url":"https://api.github.com/repos/github/hubot/tags","blobs_url":"https://api.github.com/repos/github/hubot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/github/hubot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/github/hubot/git/refs{/sha}","trees_url":"https://api.github.com/repos/github/hubot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/github/hubot/statuses/{sha}","languages_url":"https://api.github.com/repos/github/hubot/languages","stargazers_url":"https://api.github.com/repos/github/hubot/stargazers","contributors_url":"https://api.github.com/repos/github/hubot/contributors","subscribers_url":"https://api.github.com/repos/github/hubot/subscribers","subscription_url":"https://api.github.com/repos/github/hubot/subscription","commits_url":"https://api.github.com/repos/github/hubot/commits{/sha}","git_commits_url":"https://api.github.com/repos/github/hubot/git/commits{/sha}","comments_url":"https://api.github.com/repos/github/hubot/comments{/number}","issue_comment_url":"https://api.github.com/repos/github/hubot/issues/comments{/number}","contents_url":"https://api.github.com/repos/github/hubot/contents/{+path}","compare_url":"https://api.github.com/repos/github/hubot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/github/hubot/merges","archive_url":"https://api.github.com/repos/github/hubot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/github/hubot/downloads","issues_url":"https://api.github.com/repos/github/hubot/issues{/number}","pulls_url":"https://api.github.com/repos/github/hubot/pulls{/number}","milestones_url":"https://api.github.com/repos/github/hubot/milestones{/number}","notifications_url":"https://api.github.com/repos/github/hubot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/github/hubot/labels{/name}","releases_url":"https://api.github.com/repos/github/hubot/releases{/id}","created_at":"2011-08-27T08:30:59Z","updated_at":"2015-08-06T17:23:06Z","pushed_at":"2015-08-06T19:05:37Z","git_url":"git://github.com/github/hubot.git","ssh_url":"git@github.com:github/hubot.git","clone_url":"https://github.com/github/hubot.git","svn_url":"https://github.com/github/hubot","homepage":"http://hubot.github.com","size":5895,"stargazers_count":8573,"watchers_count":8573,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1890,"mirror_url":null,"open_issues_count":94,"forks":1890,"open_issues":94,"watchers":8573,"default_branch":"master"}},"base":{"label":"github:master","ref":"master","sha":"14c1b9ff69f4e2c6e6c15ef4bd5adb8320a77804","user":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"repo":{"id":2278524,"name":"hubot","full_name":"github/hubot","owner":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/github/hubot","description":"A customizable life embetterment robot.","fork":false,"url":"https://api.github.com/repos/github/hubot","forks_url":"https://api.github.com/repos/github/hubot/forks","keys_url":"https://api.github.com/repos/github/hubot/keys{/key_id}","collaborators_url":"https://api.github.com/repos/github/hubot/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/github/hubot/teams","hooks_url":"https://api.github.com/repos/github/hubot/hooks","issue_events_url":"https://api.github.com/repos/github/hubot/issues/events{/number}","events_url":"https://api.github.com/repos/github/hubot/events","assignees_url":"https://api.github.com/repos/github/hubot/assignees{/user}","branches_url":"https://api.github.com/repos/github/hubot/branches{/branch}","tags_url":"https://api.github.com/repos/github/hubot/tags","blobs_url":"https://api.github.com/repos/github/hubot/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/github/hubot/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/github/hubot/git/refs{/sha}","trees_url":"https://api.github.com/repos/github/hubot/git/trees{/sha}","statuses_url":"https://api.github.com/repos/github/hubot/statuses/{sha}","languages_url":"https://api.github.com/repos/github/hubot/languages","stargazers_url":"https://api.github.com/repos/github/hubot/stargazers","contributors_url":"https://api.github.com/repos/github/hubot/contributors","subscribers_url":"https://api.github.com/repos/github/hubot/subscribers","subscription_url":"https://api.github.com/repos/github/hubot/subscription","commits_url":"https://api.github.com/repos/github/hubot/commits{/sha}","git_commits_url":"https://api.github.com/repos/github/hubot/git/commits{/sha}","comments_url":"https://api.github.com/repos/github/hubot/comments{/number}","issue_comment_url":"https://api.github.com/repos/github/hubot/issues/comments{/number}","contents_url":"https://api.github.com/repos/github/hubot/contents/{+path}","compare_url":"https://api.github.com/repos/github/hubot/compare/{base}...{head}","merges_url":"https://api.github.com/repos/github/hubot/merges","archive_url":"https://api.github.com/repos/github/hubot/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/github/hubot/downloads","issues_url":"https://api.github.com/repos/github/hubot/issues{/number}","pulls_url":"https://api.github.com/repos/github/hubot/pulls{/number}","milestones_url":"https://api.github.com/repos/github/hubot/milestones{/number}","notifications_url":"https://api.github.com/repos/github/hubot/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/github/hubot/labels{/name}","releases_url":"https://api.github.com/repos/github/hubot/releases{/id}","created_at":"2011-08-27T08:30:59Z","updated_at":"2015-08-06T17:23:06Z","pushed_at":"2015-08-06T19:05:37Z","git_url":"git://github.com/github/hubot.git","ssh_url":"git@github.com:github/hubot.git","clone_url":"https://github.com/github/hubot.git","svn_url":"https://github.com/github/hubot","homepage":"http://hubot.github.com","size":5895,"stargazers_count":8573,"watchers_count":8573,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1890,"mirror_url":null,"open_issues_count":94,"forks":1890,"open_issues":94,"watchers":8573,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/github/hubot/pulls/1021"},"html":{"href":"https://github.com/github/hubot/pull/1021"},"issue":{"href":"https://api.github.com/repos/github/hubot/issues/1021"},"comments":{"href":"https://api.github.com/repos/github/hubot/issues/1021/comments"},"review_comments":{"href":"https://api.github.com/repos/github/hubot/pulls/1021/comments"},"review_comment":{"href":"https://api.github.com/repos/github/hubot/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/github/hubot/pulls/1021/commits"},"statuses":{"href":"https://api.github.com/repos/github/hubot/statuses/ea1de9c2e1f5fd32e7e0acbe215c537779b113a5"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":52,"deletions":6,"changed_files":3}}