summaryrefslogtreecommitdiff
path: root/src/api/service
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2017-02-12 06:44:16 +0900
committersyuilo <syuilotan@yahoo.co.jp>2017-02-12 06:44:16 +0900
commit1e4533e06952846a90556132cd9c7edf65664839 (patch)
tree5f4b7ffad5a38c951b5f79d26eca716753d193e3 /src/api/service
parent[Server] Fix bug (diff)
downloadsharkey-1e4533e06952846a90556132cd9c7edf65664839.tar.gz
sharkey-1e4533e06952846a90556132cd9c7edf65664839.tar.bz2
sharkey-1e4533e06952846a90556132cd9c7edf65664839.zip
[Server] Fix bug
Diffstat (limited to 'src/api/service')
-rw-r--r--src/api/service/github.ts24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/api/service/github.ts b/src/api/service/github.ts
index 2b70675010..1f3d5671a0 100644
--- a/src/api/service/github.ts
+++ b/src/api/service/github.ts
@@ -29,16 +29,16 @@ module.exports = async (app: express.Application) => {
});
handler.on('push', event => {
- const ref = event.payload.ref;
+ const ref = event.ref;
if (ref != 'refs/heads/master') return;
- const pusher = event.payload.pusher;
- const compare = event.payload.compare;
+ const pusher = event.pusher;
+ const compare = event.compare;
post(`Pushed! (Pusher: ${pusher.name})\nCompare changes: ${compare}`);
});
handler.on('issues', event => {
- const issue = event.payload.issue;
- const action = event.payload.action;
+ const issue = event.issue;
+ const action = event.action;
let title: string;
switch (action) {
case 'opened': title = 'New Issue'; break;
@@ -50,9 +50,9 @@ module.exports = async (app: express.Application) => {
});
handler.on('issue_comment', event => {
- const issue = event.payload.issue;
- const comment = event.payload.comment;
- const action = event.payload.action;
+ const issue = event.issue;
+ const comment = event.comment;
+ const action = event.action;
let text: string;
switch (action) {
case 'created': text = `Comment to「${issue.title}」:${comment.user.login}「${comment.body}」\n${comment.html_url}`; break;
@@ -62,18 +62,18 @@ module.exports = async (app: express.Application) => {
});
handler.on('started', event => {
- const sender = event.payload.sender;
+ const sender = event.sender;
post(`⭐️Started by ${sender.login}`);
});
handler.on('fork', event => {
- const repo = event.payload.forkee;
+ const repo = event.forkee;
post(`🍴Forked:\n${repo.html_url}`);
});
handler.on('pull_request', event => {
- const pr = event.payload.pull_request;
- const action = event.payload.action;
+ const pr = event.pull_request;
+ const action = event.action;
let text: string;
switch (action) {
case 'opened': text = `New Pull Request:「${pr.title}」\n${pr.html_url}`; break;