File tree Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,9 @@ def reply_content(event, messages)
77
77
when Line ::Bot ::Event ::Things
78
78
reply_text ( event , "[THINGS]\n #{ JSON . generate ( event [ 'things' ] ) } " )
79
79
80
+ when Line ::Bot ::Event ::VideoPlayComplete
81
+ reply_text ( event , "[VIDEOPLAYCOMPLETE]\n #{ JSON . generate ( event [ 'videoPlayComplete' ] ) } " )
82
+
80
83
else
81
84
reply_text ( event , "Unknown event type: #{ event } " )
82
85
end
Original file line number Diff line number Diff line change 25
25
require 'line/bot/event/member_joined'
26
26
require 'line/bot/event/member_left'
27
27
require 'line/bot/event/things'
28
+ require 'line/bot/event/video_play_complete'
Original file line number Diff line number Diff line change
1
+ # Copyright 2016 LINE
2
+ #
3
+ # LINE Corporation licenses this file to you under the Apache License,
4
+ # version 2.0 (the "License"); you may not use this file except in compliance
5
+ # with the License. You may obtain a copy of the License at:
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12
+ # License for the specific language governing permissions and limitations
13
+ # under the License.
14
+
15
+ module Line
16
+ module Bot
17
+ module Event
18
+ # Event for when a user finishes viewing a video at least once with the specified trackingId sent by the LINE Official Account.
19
+ #
20
+ # https://developers.line.biz/en/reference/messaging-api/#video-viewing-complete
21
+ class VideoPlayComplete < Base
22
+ end
23
+ end
24
+ end
25
+ end
Original file line number Diff line number Diff line change 285
285
"unsend": {
286
286
"messageId": "325708"
287
287
}
288
+ },
289
+ {
290
+ "type": "videoPlayComplete",
291
+ "replyToken": "nHuyWi...",
292
+ "source": {
293
+ "type": "user",
294
+ "userId": "U4af4980629..."
295
+ },
296
+ "timestamp": 12345678901234,
297
+ "videoPlayComplete": {
298
+ "trackingId": "track_id"
299
+ }
288
300
}
289
301
]
290
302
}
@@ -417,6 +429,7 @@ def generate_client
417
429
expect ( events [ 18 ] . device_id ) . to eq ( 'deviceid4' )
418
430
419
431
expect ( events [ 19 ] ) . to be_a ( Line ::Bot ::Event ::Unsend )
432
+ expect ( events [ 20 ] ) . to be_a ( Line ::Bot ::Event ::VideoPlayComplete )
420
433
end
421
434
422
435
it 'parses unknown event' do
You can’t perform that action at this time.
0 commit comments