line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LINE::Bot::API::Builder::SendMessage; |
2
|
50
|
|
|
50
|
|
390
|
use strict; |
|
50
|
|
|
|
|
109
|
|
|
50
|
|
|
|
|
1527
|
|
3
|
50
|
|
|
50
|
|
255
|
use warnings; |
|
50
|
|
|
|
|
97
|
|
|
50
|
|
|
|
|
27512
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
28
|
|
|
28
|
0
|
68508
|
my($class, ) = @_; |
7
|
28
|
|
|
|
|
114
|
bless [], $class; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub build { |
11
|
39
|
|
|
39
|
0
|
18305
|
my($self, ) = @_; |
12
|
39
|
|
|
|
|
286
|
+[ @$self ]; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub add { |
16
|
37
|
|
|
37
|
0
|
117
|
my($self, $message) = @_; |
17
|
37
|
|
|
|
|
74
|
push @{ $self }, $message; |
|
37
|
|
|
|
|
135
|
|
18
|
37
|
|
|
|
|
98
|
$self; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub add_text { |
22
|
16
|
|
|
16
|
0
|
89
|
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
|
|
|
|
154
|
):(), |
|
|
100
|
|
|
|
|
|
32
|
|
|
|
|
|
|
}); |
33
|
|
|
|
|
|
|
|
34
|
16
|
|
|
|
|
61
|
$self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub add_image { |
38
|
3
|
|
|
3
|
0
|
30
|
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
|
|
|
|
35
|
}); |
47
|
|
|
|
|
|
|
|
48
|
3
|
|
|
|
|
8
|
$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
|
|
|
|
38
|
}); |
61
|
|
|
|
|
|
|
|
62
|
3
|
|
|
|
|
9
|
$self; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub add_audio { |
66
|
3
|
|
|
3
|
0
|
31
|
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
|
|
|
|
33
|
}); |
75
|
|
|
|
|
|
|
|
76
|
3
|
|
|
|
|
6
|
$self; |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub add_location { |
80
|
3
|
|
|
3
|
0
|
39
|
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
|
|
|
|
97
|
}); |
91
|
|
|
|
|
|
|
|
92
|
3
|
|
|
|
|
11
|
$self; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub add_sticker { |
96
|
3
|
|
|
3
|
0
|
30
|
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
|
|
|
|
33
|
}); |
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
|
4
|
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
|
7
|
my($self, $template) = @_; |
118
|
4
|
|
|
|
|
9
|
$self->add($template); |
119
|
|
|
|
|
|
|
} |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
1; |