line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LINE::Bot::API::Builder::SendMessage; |
2
|
46
|
|
|
46
|
|
354
|
use strict; |
|
46
|
|
|
|
|
104
|
|
|
46
|
|
|
|
|
1411
|
|
3
|
46
|
|
|
46
|
|
231
|
use warnings; |
|
46
|
|
|
|
|
100
|
|
|
46
|
|
|
|
|
24930
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
28
|
|
|
28
|
0
|
61617
|
my($class, ) = @_; |
7
|
28
|
|
|
|
|
105
|
bless [], $class; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub build { |
11
|
39
|
|
|
39
|
0
|
16248
|
my($self, ) = @_; |
12
|
39
|
|
|
|
|
230
|
+[ @$self ]; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub add { |
16
|
37
|
|
|
37
|
0
|
94
|
my($self, $message) = @_; |
17
|
37
|
|
|
|
|
65
|
push @{ $self }, $message; |
|
37
|
|
|
|
|
125
|
|
18
|
37
|
|
|
|
|
93
|
$self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub add_text { |
22
|
16
|
|
|
16
|
0
|
85
|
my($self, %args) = @_; |
23
|
|
|
|
|
|
|
$self->add(+{ |
24
|
|
|
|
|
|
|
type => 'text', |
25
|
|
|
|
|
|
|
text => $args{text}, |
26
|
|
|
|
|
|
|
$args{sender} ? ( |
27
|
|
|
|
|
|
|
sender => $args{sender}, |
28
|
|
|
|
|
|
|
) : (), |
29
|
|
|
|
|
|
|
$args{emojis} ? ( |
30
|
|
|
|
|
|
|
emojis => $args{emojis}, |
31
|
16
|
100
|
|
|
|
112
|
):(), |
|
|
100
|
|
|
|
|
|
32
|
|
|
|
|
|
|
}); |
33
|
|
|
|
|
|
|
|
34
|
16
|
|
|
|
|
47
|
$self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub add_image { |
38
|
3
|
|
|
3
|
0
|
32
|
my($self, %args) = @_; |
39
|
|
|
|
|
|
|
$self->add(+{ |
40
|
|
|
|
|
|
|
$args{sender} ? ( |
41
|
|
|
|
|
|
|
sender => $args{sender}, |
42
|
|
|
|
|
|
|
) : (), |
43
|
|
|
|
|
|
|
type => 'image', |
44
|
|
|
|
|
|
|
originalContentUrl => $args{image_url}, |
45
|
|
|
|
|
|
|
previewImageUrl => $args{preview_url}, |
46
|
3
|
100
|
|
|
|
26
|
}); |
47
|
|
|
|
|
|
|
|
48
|
3
|
|
|
|
|
10
|
$self; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub add_video { |
52
|
3
|
|
|
3
|
0
|
29
|
my($self, %args) = @_; |
53
|
|
|
|
|
|
|
$self->add(+{ |
54
|
|
|
|
|
|
|
$args{sender} ? ( |
55
|
|
|
|
|
|
|
sender => $args{sender}, |
56
|
|
|
|
|
|
|
) : (), |
57
|
|
|
|
|
|
|
type => 'video', |
58
|
|
|
|
|
|
|
originalContentUrl => $args{video_url}, |
59
|
|
|
|
|
|
|
previewImageUrl => $args{preview_url}, |
60
|
3
|
100
|
|
|
|
28
|
}); |
61
|
|
|
|
|
|
|
|
62
|
3
|
|
|
|
|
10
|
$self; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub add_audio { |
66
|
3
|
|
|
3
|
0
|
25
|
my($self, %args) = @_; |
67
|
|
|
|
|
|
|
$self->add(+{ |
68
|
|
|
|
|
|
|
$args{sender} ? ( |
69
|
|
|
|
|
|
|
sender => $args{sender}, |
70
|
|
|
|
|
|
|
) : (), |
71
|
|
|
|
|
|
|
type => 'audio', |
72
|
|
|
|
|
|
|
originalContentUrl => $args{audio_url}, |
73
|
|
|
|
|
|
|
duration => $args{duration}, |
74
|
3
|
100
|
|
|
|
26
|
}); |
75
|
|
|
|
|
|
|
|
76
|
3
|
|
|
|
|
8
|
$self; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub add_location { |
80
|
3
|
|
|
3
|
0
|
38
|
my($self, %args) = @_; |
81
|
|
|
|
|
|
|
$self->add(+{ |
82
|
|
|
|
|
|
|
$args{sender} ? ( |
83
|
|
|
|
|
|
|
sender => $args{sender}, |
84
|
|
|
|
|
|
|
) : (), |
85
|
|
|
|
|
|
|
type => 'location', |
86
|
|
|
|
|
|
|
title => $args{title}, |
87
|
|
|
|
|
|
|
address => $args{address}, |
88
|
|
|
|
|
|
|
latitude => $args{latitude}, |
89
|
|
|
|
|
|
|
longitude => $args{longitude}, |
90
|
3
|
100
|
|
|
|
29
|
}); |
91
|
|
|
|
|
|
|
|
92
|
3
|
|
|
|
|
9
|
$self; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub add_sticker { |
96
|
3
|
|
|
3
|
0
|
39
|
my($self, %args) = @_; |
97
|
|
|
|
|
|
|
$self->add(+{ |
98
|
|
|
|
|
|
|
$args{sender} ? ( |
99
|
|
|
|
|
|
|
sender => $args{sender}, |
100
|
|
|
|
|
|
|
) : (), |
101
|
|
|
|
|
|
|
type => 'sticker', |
102
|
|
|
|
|
|
|
packageId => $args{package_id}, |
103
|
|
|
|
|
|
|
stickerId => $args{sticker_id}, |
104
|
3
|
100
|
|
|
|
30
|
}); |
105
|
|
|
|
|
|
|
|
106
|
3
|
|
|
|
|
9
|
$self; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# If you want this method to use, I recommend using LINE::Bot::API::Builder::ImagemapMessage class for you. |
110
|
|
|
|
|
|
|
sub add_imagemap { |
111
|
2
|
|
|
2
|
0
|
6
|
my($self, $imagemap) = @_; |
112
|
2
|
|
|
|
|
6
|
$self->add($imagemap); |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
# If you want this method to use, I recommend using LINE::Bot::API::Builder::TemplateMessage class for you. |
116
|
|
|
|
|
|
|
sub add_template { |
117
|
4
|
|
|
4
|
0
|
10
|
my($self, $template) = @_; |
118
|
4
|
|
|
|
|
9
|
$self->add($template); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
1; |