line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Base; |
2
|
47
|
|
|
47
|
|
21202
|
use strict; |
|
47
|
|
|
|
|
108
|
|
|
47
|
|
|
|
|
1402
|
|
3
|
47
|
|
|
47
|
|
229
|
use warnings; |
|
47
|
|
|
|
|
514
|
|
|
47
|
|
|
|
|
1525
|
|
4
|
|
|
|
|
|
|
|
5
|
47
|
|
|
47
|
|
313
|
use Carp 'croak'; |
|
47
|
|
|
|
|
89
|
|
|
47
|
|
|
|
|
24093
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
17
|
|
|
17
|
0
|
56
|
my($class, %args) = @_; |
9
|
17
|
|
|
|
|
71
|
bless { %args }, $class; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Accessors for Event-level properties. https://developers.line.biz/en/reference/messaging-api/#common-properties |
13
|
1
|
|
|
1
|
0
|
6
|
sub type { $_[0]->{type} } |
14
|
16
|
|
|
16
|
0
|
75779
|
sub mode { $_[0]->{mode} } |
15
|
2
|
|
|
2
|
0
|
11
|
sub timestamp { $_[0]->{timestamp} } |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Unfollow and Leave events don't have this |
18
|
17
|
|
|
17
|
0
|
110
|
sub reply_token { $_[0]->{replyToken} } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# type |
21
|
0
|
|
|
0
|
0
|
0
|
sub is_message_event { 0 } |
22
|
0
|
|
|
0
|
0
|
0
|
sub is_follow_event { 0 } |
23
|
0
|
|
|
0
|
0
|
0
|
sub is_unfollow_event { 0 } |
24
|
0
|
|
|
0
|
0
|
0
|
sub is_join_event { 0 } |
25
|
0
|
|
|
0
|
0
|
0
|
sub is_leave_event { 0 } |
26
|
0
|
|
|
0
|
0
|
0
|
sub is_member_join_event { 0 } |
27
|
0
|
|
|
0
|
0
|
0
|
sub is_member_leave_event { 0 } |
28
|
0
|
|
|
0
|
0
|
0
|
sub is_postback_event { 0 } |
29
|
0
|
|
|
0
|
0
|
0
|
sub is_beacon_detection_event { 0 } |
30
|
0
|
|
|
0
|
0
|
0
|
sub is_device_link_event { 0 } |
31
|
0
|
|
|
0
|
0
|
0
|
sub is_device_unlink_event { 0 } |
32
|
0
|
|
|
0
|
0
|
0
|
sub is_account_link_event { 0 } |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# source field |
35
|
1
|
|
|
1
|
0
|
6
|
sub is_user_event { $_[0]->{source}{type} eq 'user' } |
36
|
4
|
|
|
4
|
0
|
21
|
sub is_group_event { $_[0]->{source}{type} eq 'group' } |
37
|
4
|
|
|
4
|
0
|
20
|
sub is_room_event { $_[0]->{source}{type} eq 'room' } |
38
|
|
|
|
|
|
|
|
39
|
3
|
|
|
3
|
0
|
15
|
sub user_id { $_[0]->{source}{userId} } |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub group_id { |
42
|
2
|
|
|
2
|
0
|
5
|
my $self = shift; |
43
|
2
|
50
|
|
|
|
41
|
croak 'This event source is not a group type.' unless $self->is_group_event; |
44
|
2
|
|
|
|
|
11
|
$self->{source}{groupId}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub room_id { |
48
|
2
|
|
|
2
|
0
|
7
|
my $self = shift; |
49
|
2
|
50
|
|
|
|
6
|
croak 'This event source is not a room type.' unless $self->is_room_event; |
50
|
2
|
|
|
|
|
16
|
$self->{source}{roomId}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |