Bot/Object/Message.pm

filter: Statementstmt 97.6% 126 / 129 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 96.4% 27 / 28 Podpod 33.3% 1 / 3 totaltotal 96.2% 154 / 160 SCAR 0.0
CC
1
Cov
98%
reply
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Bot/Object/Sticker.pm ↑ Summary Bot.pm »
1 package Telegram::Bot::Object::Message;
2 5 $Telegram::Bot::Object::Message::VERSION = '0.023';
3 # ABSTRACT: The base class for the Telegram type "Message".
4  
5  
6 5 ▶use Mojo::Base 'Telegram::Bot::Object::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 5 ▶use Telegram::Bot::Object::User;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use Telegram::Bot::Object::Chat;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use Telegram::Bot::Object::MessageEntity;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 5 ▶use Telegram::Bot::Object::Audio;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 5 ▶use Telegram::Bot::Object::Document;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 5 ▶use Telegram::Bot::Object::Animation;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 5 ▶use Telegram::Bot::Object::Game;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 5 ▶use Telegram::Bot::Object::PhotoSize;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 5 ▶use Telegram::Bot::Object::Sticker;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 5 ▶use Telegram::Bot::Object::Video;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 5 ▶use Telegram::Bot::Object::Voice;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 5 ▶use Telegram::Bot::Object::VideoNote;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 5 ▶use Telegram::Bot::Object::Contact;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 5 ▶use Telegram::Bot::Object::Location;
Subroutine BEGIN: called CC=1 SCAR=0.0
22 5 ▶use Telegram::Bot::Object::Poll;
Subroutine BEGIN: called CC=1 SCAR=0.0
23 5 ▶use Telegram::Bot::Object::Location;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 5 ▶use Telegram::Bot::Object::PhotoSize;
Subroutine BEGIN: called CC=1 SCAR=0.0
25 5 ▶use Telegram::Bot::Object::Invoice;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 5 ▶use Telegram::Bot::Object::Venue;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 5 ▶use Telegram::Bot::Object::SuccessfulPayment;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 5 ▶use Telegram::Bot::Object::PassportData;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 5 ▶use Telegram::Bot::Object::InlineKeyboardMarkup;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 5 ▶use Telegram::Bot::Object::ReplyKeyboardMarkup;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 5 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 # basic message stuff
35 5 has 'message_id';
36 5 has 'from'; # User
37 5 has 'date';
38 5 has 'chat'; # Chat
39  
40 5 has 'forward_from'; # User
41 5 has 'forward_from_chat'; # Chat
42 5 has 'forward_from_message_id';
43 5 has 'forward_signature';
44 5 has 'forward_sender_name';
45 5 has 'forward_date';
46  
47 5 has 'reply_to_message'; # Message
48 5 has 'edit_date';
49 5 has 'media_group_id';
50 5 has 'author_signature';
51 5 has 'text';
52 5 has 'entities'; # Array of MessageEntity
53  
54 5 has 'caption_entities'; # Array of MessageEntity
55  
56 5 has 'audio'; # Audio
57 5 has 'document'; # Document
58 5 has 'animation'; # Animation
59 5 has 'game'; # Game
60 5 has 'photo'; # Array of PhotoSize
61 5 has 'sticker'; # Sticker
62 5 has 'video'; # Video
63 5 has 'voice'; # Voice
64 5 has 'video_note'; # VideoNote
65 5 has 'caption';
66 5 has 'contact'; # Contact
67 5 has 'location'; # Location
68 5 has 'venue'; # Venue
69 5 has 'poll'; # Poll
70 5 has 'new_chat_members'; # Array of User
71 5 has 'left_chat_member'; # User
72 5 has 'new_chat_title';
73 5 has 'new_chat_photo'; # Array of PhotoSize
74 5 has 'delete_chat_photo';
75 5 has 'group_chat_created';
76 5 has 'supergroup_chat_created';
77 5 has 'channel_chat_created';
78 5 has 'migrate_to_chat_id';
79 5 has 'migrate_from_chat_id';
80 5 has 'pinned_message'; # Message
81 5 has 'invoice'; # Invoice
82 5 has 'successful_payment'; # SuccessfulPayment
83 5 has 'connected_website';
84 5 has 'passport_data'; # PassportData
85 5 has 'reply_markup'; # Array of InlineKeyboardMarkup/ReplyKeyboardMarkup
86  
87 sub fields {
88 return {
89 192 ▶ 'scalar' => [qw/message_id date forward_from_message_id
Subroutine fields: called CC=1 SCAR=0.0
Pod undocumented
90 forward_signature forward_sender_name
91 forward_date edit_date media_group_id
92 author_signature text caption
93 new_chat_title delete_chat_photo
94 group_chat_created supergroup_chat_created
95 channel_chat_created migrate_to_chat_id
96 migrate_from_chat_id connected_website/],
97 'Telegram::Bot::Object::User' => [qw/from forward_from new_chat_members left_chat_member /],
98  
99 'Telegram::Bot::Object::Chat' => [qw/chat forward_from_chat/],
100 'Telegram::Bot::Object::Message' => [qw/reply_to_message pinned_message/],
101 'Telegram::Bot::Object::MessageEntity' => [qw/entities caption_entities /],
102  
103 'Telegram::Bot::Object::Audio' => [qw/audio/],
104 'Telegram::Bot::Object::Document' => [qw/document/],
105 'Telegram::Bot::Object::Animation' => [qw/animation/],
106 'Telegram::Bot::Object::Game' => [qw/game/],
107 'Telegram::Bot::Object::PhotoSize' => [qw/photo new_chat_photo/],
108 'Telegram::Bot::Object::Sticker' => [qw/sticker/],
109 'Telegram::Bot::Object::Video' => [qw/video/],
110 'Telegram::Bot::Object::Voice' => [qw/voice/],
111 'Telegram::Bot::Object::VideoNote' => [qw/video_note/],
112  
113 'Telegram::Bot::Object::Contact' => [qw/contact/],
114 'Telegram::Bot::Object::Location' => [qw/location/],
115 'Telegram::Bot::Object::Venue' => [qw/venue/],
116  
117 'Telegram::Bot::Object::Poll' => [qw/poll/],
118  
119 'Telegram::Bot::Object::Invoice' => [qw/invoice/],
120 'Telegram::Bot::Object::SuccessfulPayment' => [qw/successful_payment/],
121 'Telegram::Bot::Object::PassportData' => [qw/passport_data/],
122 'Telegram::Bot::Object::InlineKeyboardMarkup' => [qw/reply_markup/],
123 'Telegram::Bot::Object::ReplyKeyboardMarkup' => [qw/reply_markup/],
124  
125 };
126 }
127  
128 sub arrays {
129 35 ▶ qw/photo entities caption_entities new_chat_members new_chat_photo/
Subroutine arrays: called CC=1 SCAR=0.0
Pod documented
130 }
131  
132  
133 sub reply {
134 0 ▶ my $self = shift;
Subroutine reply: not called CC=1 SCAR=6.9
Pod undocumented
135 0 my $text = shift;
136 0 return $self->_brain->sendMessage({chat_id => $self->chat->id, text => $text});
137 }
138  
139 5 1;
140  
141 __END__
« Bot/Object/Sticker.pm ↑ Summary Bot.pm »