| 1 | package LINE::Bot::API::Builder::SendMessage; | ||||||||||||||
| 2 | 46 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | 46 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | |||||||||||||||
| 5 | sub new { | ||||||||||||||
| 6 | 28 | ▶ | my($class, ) = @_; | ||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 7 | 28 | bless [], $class; | |||||||||||||
| 8 | } | ||||||||||||||
| 9 | |||||||||||||||
| 10 | sub build { | ||||||||||||||
| 11 | 39 | ▶ | my($self, ) = @_; | ||||||||||||
|
Subroutine
build: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 12 | 39 | +[ @$self ]; | |||||||||||||
| 13 | } | ||||||||||||||
| 14 | |||||||||||||||
| 15 | sub add { | ||||||||||||||
| 16 | 37 | ▶ | my($self, $message) = @_; | ||||||||||||
|
Subroutine
add: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 17 | 37 | push @{ $self }, $message; | |||||||||||||
| 18 | 37 | $self; | |||||||||||||
| 19 | } | ||||||||||||||
| 20 | |||||||||||||||
| 21 | sub add_text { | ||||||||||||||
| 22 | 16 | ▶ | my($self, %args) = @_; | ||||||||||||
|
Subroutine
add_text: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||
| 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 | ▶ | ):(), | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 32 | }); | ||||||||||||||
| 33 | |||||||||||||||
| 34 | 16 | $self; | |||||||||||||
| 35 | } | ||||||||||||||
| 36 | |||||||||||||||
| 37 | sub add_image { | ||||||||||||||
| 38 | 3 | ▶ | my($self, %args) = @_; | ||||||||||||
|
Subroutine
add_image: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 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 | ▶ | }); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 47 | |||||||||||||||
| 48 | 3 | $self; | |||||||||||||
| 49 | } | ||||||||||||||
| 50 | |||||||||||||||
| 51 | sub add_video { | ||||||||||||||
| 52 | 3 | ▶ | my($self, %args) = @_; | ||||||||||||
|
Subroutine
add_video: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 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 | ▶ | }); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 61 | |||||||||||||||
| 62 | 3 | $self; | |||||||||||||
| 63 | } | ||||||||||||||
| 64 | |||||||||||||||
| 65 | sub add_audio { | ||||||||||||||
| 66 | 3 | ▶ | my($self, %args) = @_; | ||||||||||||
|
Subroutine
add_audio: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 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 | ▶ | }); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 75 | |||||||||||||||
| 76 | 3 | $self; | |||||||||||||
| 77 | } | ||||||||||||||
| 78 | |||||||||||||||
| 79 | sub add_location { | ||||||||||||||
| 80 | 3 | ▶ | my($self, %args) = @_; | ||||||||||||
|
Subroutine
add_location: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 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 | ▶ | }); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 91 | |||||||||||||||
| 92 | 3 | $self; | |||||||||||||
| 93 | } | ||||||||||||||
| 94 | |||||||||||||||
| 95 | sub add_sticker { | ||||||||||||||
| 96 | 3 | ▶ | my($self, %args) = @_; | ||||||||||||
|
Subroutine
add_sticker: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||
| 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 | ▶ | }); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 105 | |||||||||||||||
| 106 | 3 | $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 | ▶ | my($self, $imagemap) = @_; | ||||||||||||
|
Subroutine
add_imagemap: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 112 | 2 | $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 | ▶ | my($self, $template) = @_; | ||||||||||||
|
Subroutine
add_template: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||
| 118 | 4 | $self->add($template); | |||||||||||||
| 119 | } | ||||||||||||||
| 120 | |||||||||||||||
| 121 | 46 | 1; | |||||||||||||