line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message; |
2
|
47
|
|
|
47
|
|
334
|
use strict; |
|
47
|
|
|
|
|
111
|
|
|
47
|
|
|
|
|
1399
|
|
3
|
47
|
|
|
47
|
|
250
|
use warnings; |
|
47
|
|
|
|
|
95
|
|
|
47
|
|
|
|
|
1324
|
|
4
|
47
|
|
|
47
|
|
699
|
use parent 'LINE::Bot::API::Event::Base'; |
|
47
|
|
|
|
|
410
|
|
|
47
|
|
|
|
|
329
|
|
5
|
|
|
|
|
|
|
|
6
|
47
|
|
|
47
|
|
2196
|
use Carp 'carp'; |
|
47
|
|
|
|
|
110
|
|
|
47
|
|
|
|
|
14769
|
|
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
|
57
|
my($class, %args) = @_; |
21
|
|
|
|
|
|
|
|
22
|
19
|
|
|
|
|
32
|
my $type = $args{message}{type}; |
23
|
19
|
|
|
|
|
38
|
my $message_class = $TYPE2CLASS{$type}; |
24
|
19
|
50
|
|
|
|
37
|
unless ($message_class) { |
25
|
0
|
|
|
|
|
0
|
carp 'Unsupported message type: ' . $type; |
26
|
0
|
|
|
|
|
0
|
$message_class = $class; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
19
|
|
|
|
|
132
|
bless { %args }, $message_class; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
1
|
0
|
4
|
sub is_message_event { 1 } |
33
|
|
|
|
|
|
|
|
34
|
1
|
|
|
1
|
0
|
5
|
sub message_id { $_[0]->{message}{id} } |
35
|
|
|
|
|
|
|
|
36
|
11
|
|
|
11
|
0
|
7813
|
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
|
47
|
|
|
47
|
|
418
|
use parent 'LINE::Bot::API::Event::Message'; |
|
47
|
|
|
|
|
145
|
|
|
47
|
|
|
|
|
299
|
|
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
1
|
|
6
|
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
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Image { |
56
|
47
|
|
|
47
|
|
6965
|
use parent 'LINE::Bot::API::Event::Message'; |
|
47
|
|
|
|
|
124
|
|
|
47
|
|
|
|
|
213
|
|
57
|
|
|
|
|
|
|
|
58
|
1
|
|
|
1
|
|
5
|
sub is_image_message { 1 } |
59
|
|
|
|
|
|
|
|
60
|
3
|
|
|
3
|
|
20
|
sub content_provider { $_[0]->{message}{contentProvider} } |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Video { |
64
|
47
|
|
|
47
|
|
5770
|
use parent 'LINE::Bot::API::Event::Message'; |
|
47
|
|
|
|
|
130
|
|
|
47
|
|
|
|
|
205
|
|
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
1
|
|
4
|
sub is_video_message { 1 } |
67
|
|
|
|
|
|
|
|
68
|
3
|
|
|
3
|
|
25
|
sub content_provider { $_[0]->{message}{contentProvider} } |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Audio { |
72
|
47
|
|
|
47
|
|
5323
|
use parent 'LINE::Bot::API::Event::Message'; |
|
47
|
|
|
|
|
116
|
|
|
47
|
|
|
|
|
211
|
|
73
|
|
|
|
|
|
|
|
74
|
1
|
|
|
1
|
|
5
|
sub is_audio_message { 1 } |
75
|
|
|
|
|
|
|
|
76
|
3
|
|
|
3
|
|
17
|
sub content_provider { $_[0]->{message}{contentProvider} } |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Location { |
80
|
47
|
|
|
47
|
|
5263
|
use parent 'LINE::Bot::API::Event::Message'; |
|
47
|
|
|
|
|
98
|
|
|
47
|
|
|
|
|
272
|
|
81
|
|
|
|
|
|
|
|
82
|
1
|
|
|
1
|
|
4
|
sub is_location_message { 1 } |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
1
|
|
6
|
sub title { $_[0]->{message}{title} } |
85
|
1
|
|
|
1
|
|
8
|
sub address { $_[0]->{message}{address} } |
86
|
1
|
|
|
1
|
|
7
|
sub latitude { $_[0]->{message}{latitude} } |
87
|
1
|
|
|
1
|
|
8
|
sub longitude { $_[0]->{message}{longitude} } |
88
|
|
|
|
|
|
|
} |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::Sticker { |
91
|
47
|
|
|
47
|
|
8512
|
use parent 'LINE::Bot::API::Event::Message'; |
|
47
|
|
|
|
|
136
|
|
|
47
|
|
|
|
|
312
|
|
92
|
|
|
|
|
|
|
|
93
|
1
|
|
|
1
|
|
6
|
sub is_sticker_message { 1 } |
94
|
|
|
|
|
|
|
|
95
|
1
|
|
|
1
|
|
5
|
sub package_id { $_[0]->{message}{packageId} } |
96
|
1
|
|
|
1
|
|
6
|
sub sticker_id { $_[0]->{message}{stickerId} } |
97
|
0
|
|
|
0
|
|
0
|
sub stickerResourceType { $_[0]->{message}{stickerResourceType} } |
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
package LINE::Bot::API::Event::Message::File { |
101
|
47
|
|
|
47
|
|
7274
|
use parent 'LINE::Bot::API::Event::Message'; |
|
47
|
|
|
|
|
131
|
|
|
47
|
|
|
|
|
239
|
|
102
|
|
|
|
|
|
|
|
103
|
1
|
|
|
1
|
|
5
|
sub is_file_message { 1 } |
104
|
|
|
|
|
|
|
|
105
|
1
|
|
|
1
|
|
7
|
sub file_name { $_[0]->{message}{fileName} } |
106
|
1
|
|
|
1
|
|
6
|
sub file_size { $_[0]->{message}{fileSize} } |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
1; |