File tree Expand file tree Collapse file tree 3 files changed +6
-25
lines changed
Expand file tree Collapse file tree 3 files changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -8,32 +8,8 @@ module.exports = async (ctx) => {
88 if ( ctx . request . header [ 'X-GitHub-Event' ] === 'issues' || ctx . request . body . action === 'opened' ) {
99 console . log ( 'action' , ctx . request . body . action )
1010 console . log ( 'issues' , ctx . request . body . issue )
11-
1211 eventEmitter . emit ( 'github:issue:opened' , ctx . request . body )
13- ctx . body = { }
14- return
1512 }
1613
17- // let message = {
18- // 'type': 'template',
19- // 'altText': 'nodejs-tw/jobs 新職缺通知',
20- // 'template': {
21- // 'type': 'buttons',
22- // 'thumbnailImageUrl': ctx.request.body.sender.avatar_url,
23- // 'title': ctx.request.body.issue.title.substr(0, 40),
24- // 'text': ctx.request.body.issue.body.substr(0, 60),
25- // 'actions': [
26- // {
27- // 'type': 'uri',
28- // 'label': '點我看更多',
29- // 'uri': ctx.request.body.issue.html_url
30- // }
31- // ]
32- // }
33- // }
34-
35- // let res = await linebot.push(process.env.LINE_GROUP_ID, message)
36- // console.log('res', res)
37-
3814 ctx . body = { success : true }
3915}
Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ const eventEmitter = require('../service/eventEmitter')
22
33module . exports = async ( ctx ) => {
44 console . log ( 'ctx' , ctx )
5- console . log ( 'ctx' , ctx . request . body )
5+ console . log ( 'body' , ctx . request . body )
6+
7+ let titile = ctx . request . body . title
8+ let link = ctx . request . body . link
9+
610 ctx . body = { }
711}
Original file line number Diff line number Diff line change 11const eventEmitter = require ( '../eventEmitter' )
2+ const linebot = require ( '../linebot' )
23
34eventEmitter . on ( 'line:push_to_nodejs_group' , async ( message ) => {
45 let res = await linebot . push ( process . env . LINE_GROUP_ID , message )
You can’t perform that action at this time.
0 commit comments