line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message; |
2
|
51
|
|
|
51
|
|
369
|
use strict; |
|
51
|
|
|
|
|
115
|
|
|
51
|
|
|
|
|
1610
|
|
3
|
51
|
|
|
51
|
|
279
|
use warnings; |
|
51
|
|
|
|
|
100
|
|
|
51
|
|
|
|
|
1569
|
|
4
|
51
|
|
|
51
|
|
783
|
use parent 'LINE::Bot::API::Event::Base'; |
|
51
|
|
|
|
|
463
|
|
|
51
|
|
|
|
|
347
|
|
5
|
|
|
|
|
|
|
|
6
|
51
|
|
|
51
|
|
2497
|
use Carp 'carp'; |
|
51
|
|
|
|
|
191
|
|
|
51
|
|
|
|
|
16420
|
|
7
|
|
|
|
|
|
|
our @CARP_NOT = qw( LINE::Bot::API::Event::Message LINE::Bot::API::Event LINE::Bot::API); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my %TYPE2CLASS = ( |
10
|
|
|
|
|
|
|
text => 'LINE::Bot::API::Event::Message::Text', |
11
|
|
|
|
|
|
|
image => 'LINE::Bot::API::Event::Message::Image', |
12
|
|
|
|
|
|
|
video => 'LINE::Bot::API::Event::Message::Video', |
13
|
|
|
|
|
|
|
audio => 'LINE::Bot::API::Event::Message::Audio', |
14
|
|
|
|
|
|
|
location => 'LINE::Bot::API::Event::Message::Location', |
15
|
|
|
|
|
|
|
sticker => 'LINE::Bot::API::Event::Message::Sticker', |
16
|
|
|
|
|
|
|
file => 'LINE::Bot::API::Event::Message::File', |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub new { |
20
|
19
|
|
|
19
|
0
|
61
|
my($class, %args) = @_; |
21
|
|
|
|
|
|
|
|
22
|
19
|
|
|
|
|
28
|
my $type = $args{message}{type}; |
23
|
19
|
|
|
|
|
36
|
my $message_class = $TYPE2CLASS{$type}; |
24
|
19
|
50
|
|
|
|
35
|
unless ($message_class) { |
25
|
0
|
|
|
|
|
0
|
carp 'Unsupported message type: ' . $type; |
26
|
0
|
|
|
|
|
0
|
$message_class = $class; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
19
|
|
|
|
|
121
|
bless { %args }, $message_class; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
0
|
7
|
sub is_message_event { 1 } |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
0
|
7
|
sub message_id { $_[0]->{message}{id} } |
35
|
|
|
|
|
|
|
|
36
|
11
|
|
|
11
|
0
|
8236
|
sub message_type { $_[0]->{message}{type} } |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
0
|
0
|
0
|
sub is_text_message { 0 } |
39
|
0
|
|
|
0
|
0
|
0
|
sub is_image_message { 0 } |
40
|
0
|
|
|
0
|
0
|
0
|
sub is_video_message { 0 } |
41
|
0
|
|
|
0
|
0
|
0
|
sub is_audio_message { 0 } |
42
|
0
|
|
|
0
|
0
|
0
|
sub is_location_message { 0 } |
43
|
0
|
|
|
0
|
0
|
0
|
sub is_sticker_message { 0 } |
44
|
0
|
|
|
0
|
0
|
0
|
sub is_file_message { 0 } |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Text { |
47
|
51
|
|
|
51
|
|
404
|
use parent 'LINE::Bot::API::Event::Message'; |
|
51
|
|
|
|
|
153
|
|
|
51
|
|
|
|
|
328
|
|
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
1
|
|
5
|
sub is_text_message { 1 } |
50
|
|
|
|
|
|
|
|
51
|
1
|
|
|
1
|
|
5
|
sub text { $_[0]->{message}{text} } |
52
|
1
|
|
|
1
|
|
13
|
sub emojis { $_[0]->{message}{emojis} } |
53
|
0
|
|
|
0
|
|
0
|
sub mention { $_[0]->{mention} } |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Image { |
57
|
51
|
|
|
51
|
|
8400
|
use parent 'LINE::Bot::API::Event::Message'; |
|
51
|
|
|
|
|
125
|
|
|
51
|
|
|
|
|
279
|
|
58
|
|
|
|
|
|
|
|
59
|
1
|
|
|
1
|
|
6
|
sub is_image_message { 1 } |
60
|
|
|
|
|
|
|
|
61
|
3
|
|
|
3
|
|
23
|
sub content_provider { $_[0]->{message}{contentProvider} } |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Video { |
65
|
51
|
|
|
51
|
|
6350
|
use parent 'LINE::Bot::API::Event::Message'; |
|
51
|
|
|
|
|
158
|
|
|
51
|
|
|
|
|
237
|
|
66
|
|
|
|
|
|
|
|
67
|
1
|
|
|
1
|
|
6
|
sub is_video_message { 1 } |
68
|
|
|
|
|
|
|
|
69
|
3
|
|
|
3
|
|
22
|
sub content_provider { $_[0]->{message}{contentProvider} } |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Audio { |
73
|
51
|
|
|
51
|
|
6138
|
use parent 'LINE::Bot::API::Event::Message'; |
|
51
|
|
|
|
|
127
|
|
|
51
|
|
|
|
|
275
|
|
74
|
|
|
|
|
|
|
|
75
|
1
|
|
|
1
|
|
7
|
sub is_audio_message { 1 } |
76
|
|
|
|
|
|
|
|
77
|
3
|
|
|
3
|
|
23
|
sub content_provider { $_[0]->{message}{contentProvider} } |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Location { |
81
|
51
|
|
|
51
|
|
5853
|
use parent 'LINE::Bot::API::Event::Message'; |
|
51
|
|
|
|
|
162
|
|
|
51
|
|
|
|
|
196
|
|
82
|
|
|
|
|
|
|
|
83
|
1
|
|
|
1
|
|
6
|
sub is_location_message { 1 } |
84
|
|
|
|
|
|
|
|
85
|
1
|
|
|
1
|
|
7
|
sub title { $_[0]->{message}{title} } |
86
|
1
|
|
|
1
|
|
6
|
sub address { $_[0]->{message}{address} } |
87
|
1
|
|
|
1
|
|
6
|
sub latitude { $_[0]->{message}{latitude} } |
88
|
1
|
|
|
1
|
|
7
|
sub longitude { $_[0]->{message}{longitude} } |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Sticker { |
92
|
51
|
|
|
51
|
|
9477
|
use parent 'LINE::Bot::API::Event::Message'; |
|
51
|
|
|
|
|
122
|
|
|
51
|
|
|
|
|
247
|
|
93
|
|
|
|
|
|
|
|
94
|
1
|
|
|
1
|
|
7
|
sub is_sticker_message { 1 } |
95
|
|
|
|
|
|
|
|
96
|
1
|
|
|
1
|
|
6
|
sub package_id { $_[0]->{message}{packageId} } |
97
|
1
|
|
|
1
|
|
6
|
sub sticker_id { $_[0]->{message}{stickerId} } |
98
|
0
|
|
|
0
|
|
0
|
sub stickerResourceType { $_[0]->{message}{stickerResourceType} } |
99
|
0
|
|
|
0
|
|
0
|
sub keywords { $_[0]->{message}{keywords} } |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::File { |
103
|
51
|
|
|
51
|
|
9363
|
use parent 'LINE::Bot::API::Event::Message'; |
|
51
|
|
|
|
|
139
|
|
|
51
|
|
|
|
|
313
|
|
104
|
|
|
|
|
|
|
|
105
|
1
|
|
|
1
|
|
7
|
sub is_file_message { 1 } |
106
|
|
|
|
|
|
|
|
107
|
1
|
|
|
1
|
|
6
|
sub file_name { $_[0]->{message}{fileName} } |
108
|
1
|
|
|
1
|
|
7
|
sub file_size { $_[0]->{message}{fileSize} } |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
1; |