diff --git a/.perlcriticrc b/.perlcriticrc index 3eca9f0..56593a0 100644 --- a/.perlcriticrc +++ b/.perlcriticrc @@ -4,38 +4,38 @@ verbose = 8 # minorify some of warnings that are not really critical [-InputOutput::RequireCheckedClose] -# what can we handle in case of error? +# What can we handle in case of error? [-Modules::ProhibitExcessMainComplexity] -# noone cares +# Noone cares [-Subroutines::ProhibitExcessComplexity] -# noone cares +# Noone cares [-Subroutines::ProhibitExplicitReturnUndef] -# but it's very handy sometimes! +# But it's very handy sometimes! [-ValuesAndExpressions::ProhibitMagicNumbers] # this policy makes too much false positives [-RegularExpressions::RequireLineBoundaryMatching] -# we use /m as needed +# We use /m as needed [-RegularExpressions::RequireExtendedFormatting] -# we do not use extended formatting of regex, they still not THAT complex +# We do not use extended formatting of regex, they still not THAT complex [-RegularExpressions::RequireDotMatchAnything] # huh? [-RegularExpressions::ProhibitEscapedMetacharacters] -# looks like it pointless +# Looks like it pointless [-ControlStructures::ProhibitCascadingIfElse] -# I like long ifelse chains +# I like long if..else chains [-ControlStructures::ProhibitPostfixControls] -# in short lines we can afford ourselves to use postfix controls -# but ofcorse we shoul avoid such constructions in long lines +# In short lines we can afford ourselves to use postfix controls +# but ofcorse we should avoid such constructions in long lines. [-Subroutines::ProhibitSubroutinePrototypes] # Contrary to Perl::Critic we consider prototypes as useful, even if @@ -43,9 +43,9 @@ verbose = 8 # hints. [-CodeLayout::RequireTidyCode] -# impossible to complete, because of on higher linting levels ## no critic +# Impossible to complete, because of on higher linting levels "## no critic..." # require be per-case on same line where critique is, but tidy align them -# one line down +# one line down. [-CodeLayout::ProhibitParensWithBuiltins] # duh... @@ -55,7 +55,7 @@ verbose = 8 # the recomended use of q{} looks too complex: my $var = q{}; [-ValuesAndExpressions::ProhibitNoisyQuotes] -# other people, other opinions: "," is better readable than qw(,) +# Other people, other opinions: "," is better readable than qw(,) [-BuiltinFunctions::ProhibitSleepViaSelect] # We do not wish to use too much external modules. @@ -67,14 +67,22 @@ verbose = 8 # Noone care, really [-ControlStructures::ProhibitUnlessBlocks] -# they should not be too complex - only one condition should be checked, +# They should not be too complex - only one condition should be checked, # that's all [-Miscellanea::ProhibitTies] # Just allow it. It's very handy stuff and extremely simple and safe enugh to use. [-ValuesAndExpressions::RequireNumberSeparators] -# not really +# Not really [-InputOutput::RequireBracedFileHandleWithPrint] -# we prefer not to use braced file handles +# We prefer not to use braced file handles + +[-Documentation::PodSpelling] +# It doesn't help, but emits annoying errors + +[Documentation::RequirePodSections] +# Considering this as "soft" requirement. For modules that is (or will be) +# stand-alone libs well formed documentation is highly desired. +lib_sections = NAME | VERSION | DESCRIPTION | AUTHOR | LICENSE AND COPYRIGHT \ No newline at end of file diff --git a/cpanfile b/cpanfile index 3b5db6d..d8ba0a8 100644 --- a/cpanfile +++ b/cpanfile @@ -1,5 +1,6 @@ requires 'Carp'; requires 'Log::Any'; +requires 'List::Util'; requires 'Cwd::utf8'; requires 'DB_File'; requires 'Digest::MD5'; diff --git a/lib/Teapot/Bot.pm b/lib/Teapot/Bot.pm index b8bd228..5d6e8ed 100644 --- a/lib/Teapot/Bot.pm +++ b/lib/Teapot/Bot.pm @@ -15,7 +15,11 @@ __END__ =head1 NAME -Teapot::Bot - A base class to make your very own Telegram bot +Teapot::Bot + +=head1 DESCRIPTION + +A base class to make your very own Telegram bot =head1 VERSION @@ -70,6 +74,13 @@ and you've got yourself a stew, baby! Or a bot, anyway. Note that for the bot to see messages that do not start with a leading '/', you will need to use the C<'/setprivacy'> command on Telegram's C<@botfather> interface to change the privacy settings. +=head1 DEPENDENCIES + +IO::Socket::SSL +Log::Any +Mojolicious +Test::Exception + =head1 EXAMPLES This distribution's C directory contains some complete examples that may be @@ -79,7 +90,7 @@ instructive to look at. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Brain.pm b/lib/Teapot/Bot/Brain.pm index 1f76661..5adbf66 100644 --- a/lib/Teapot/Bot/Brain.pm +++ b/lib/Teapot/Bot/Brain.pm @@ -10,9 +10,9 @@ use warnings; use Mojo::IOLoop; use Mojo::UserAgent; use Carp qw/croak cluck confess/; # use croak where we return error up to app that supply something wrong - # use cluck where we want to say that something bad but non-critical happen in - # lower layer (Mojo loop) - # use confess where we want to say that fatal error happen in lower layer (Mojo loop) + # use cluck where we want to say that something bad but non-critical happen in + # lower layer (Mojo loop) + # use confess where we want to say that fatal error happen in lower layer (Mojo loop) use Log::Any; use Data::Dumper; @@ -22,13 +22,13 @@ $Teapot::Bot::Brain::VERSION = '0.021'; # base class for building telegram robots with Mojolicious has longpoll_time => 60; -has ua => sub { Mojo::UserAgent->new->inactivity_timeout(shift->longpoll_time + 15) }; -has token => sub { croak "you need to supply your own token"; }; +has ua => sub { Mojo::UserAgent->new->inactivity_timeout(shift->longpoll_time + 15) }; +has token => sub { croak 'You need to supply your own token'; }; -has tasks => sub { [] }; -has listeners => sub { [] }; +has tasks => sub { [] }; +has listeners => sub { [] }; -has log => sub { Log::Any->get_logger }; +has log => sub { Log::Any->get_logger }; sub add_repeating_task { @@ -43,7 +43,7 @@ sub add_repeating_task { Mojo::IOLoop->recurring(0.1 => sub { my $loop = shift; my $now = time(); - return unless ($now - $last_check) >= $seconds; + return if ($now - $last_check) < $seconds; $last_check = $now; $task->($self); }); @@ -67,7 +67,7 @@ sub add_listener { } sub init { - die "init was not overridden!"; + croak 'init() was not overridden!'; } @@ -84,7 +84,7 @@ sub think { sub getMe { my $self = shift; - my $token = $self->token || croak "no token?"; + my $token = $self->token || croak 'No token supplied to getMe()?'; my $url = "https://api.telegram.org/bot${token}/getMe"; my $api_response = $self->_post_request($url); @@ -93,7 +93,7 @@ sub getMe { return Teapot::Bot::Object::User->create_from_hash($api_response, $self); } else { - return {"error" => 1}; + return {'error' => 1}; } } @@ -103,12 +103,12 @@ sub getChatMember { my $args = shift || {}; my $send_args = {}; - croak "no chat_id supplied" unless $args->{chat_id}; - croak "no user_id supplied" unless $args->{user_id}; + croak 'No chat_id supplied to getChatMember()' unless $args->{chat_id}; + croak 'No user_id supplied to getChatMember()' unless $args->{user_id}; $send_args->{chat_id} = $args->{chat_id}; $send_args->{user_id} = $args->{user_id}; - my $token = $self->token || croak "no token?"; + my $token = $self->token || croak 'No token supplied to getChatMember?'; my $url = "https://api.telegram.org/bot${token}/getChatMember"; my $api_response = $self->_post_request($url, $send_args); @@ -117,7 +117,7 @@ sub getChatMember { return Teapot::Bot::Object::ChatMember->create_from_hash($api_response, $self); } else { - return {"error" => 1}; + return {'error' => 1}; } } @@ -127,10 +127,10 @@ sub getChat { my $args = shift || {}; my $send_args = {}; - croak "no chat_id supplied" unless $args->{chat_id}; + croak 'No chat_id supplied to getChat()' unless $args->{chat_id}; $send_args->{chat_id} = $args->{chat_id}; - my $token = $self->token || croak "no token?"; + my $token = $self->token || croak 'No token supplied to getChat()?'; my $url = "https://api.telegram.org/bot${token}/getChat"; my $api_response = $self->_post_request($url, $send_args); @@ -139,7 +139,7 @@ sub getChat { return Teapot::Bot::Object::Chat->create_from_hash($api_response, $self); } else { - return {"error" => 1}; + return {'error' => 1}; } } @@ -149,10 +149,10 @@ sub sendMessage { my $args = shift || {}; my $send_args = {}; - croak "no chat_id supplied in sendMessage" unless $args->{chat_id}; + croak 'No chat_id supplied in sendMessage()' unless $args->{chat_id}; $send_args->{chat_id} = $args->{chat_id}; - croak "no text supplied in sendMessage" unless $args->{text}; + croak 'No text supplied in sendMessage()' unless $args->{text}; $send_args->{text} = $args->{text}; # these are optional, send if they are supplied @@ -164,14 +164,18 @@ sub sendMessage { # check reply_markup is the right kind if (exists $args->{reply_markup}) { my $reply_markup = $args->{reply_markup}; - croak "Incorrect reply_markup in sendMessage" if ( ref($reply_markup) ne 'Teapot::Bot::Object::InlineKeyboardMarkup' && + + if ( ref($reply_markup) ne 'Teapot::Bot::Object::InlineKeyboardMarkup' && ref($reply_markup) ne 'Teapot::Bot::Object::ReplyKeyboardMarkup' && - ref($reply_markup) ne 'Teapot::Bot::Object::ReplyKeyboardRemove' && - ref($reply_markup) ne 'Teapot::Bot::Object::ForceReply' ); + ref($reply_markup) ne 'Teapot::Bot::Object::ReplyKeyboardRemove' && + ref($reply_markup) ne 'Teapot::Bot::Object::ForceReply' ) { + croak 'Incorrect reply_markup in sendMessage()'; + } + $send_args->{reply_markup} = $reply_markup; } - my $token = $self->token || croak "no token in sendMessage?"; + my $token = $self->token || croak 'No token supplied to sendMessage()?'; my $url = "https://api.telegram.org/bot${token}/sendMessage"; my $api_response = $self->_post_request($url, $send_args); @@ -179,7 +183,7 @@ sub sendMessage { return Teapot::Bot::Object::Message->create_from_hash($api_response, $self); } else { - return {"error" => 1}; + return {'error' => 1}; } } @@ -188,19 +192,19 @@ sub forwardMessage { my $self = shift; my $args = shift || {}; my $send_args = {}; - croak "no chat_id supplied in forwardMessage" unless $args->{chat_id}; + croak 'No chat_id supplied in forwardMessage()' unless $args->{chat_id}; $send_args->{chat_id} = $args->{chat_id}; - croak "no from_chat_id supplied in forwardMessage" unless $args->{from_chat_id}; - $send_args->{from_chat_id} = $args->{from_chat_id}; + croak 'No from_chat_id supplied in forwardMessage()' unless $args->{from_chat_id}; + $send_args->{from_chat_id} = $args->{from_chat_id}; - croak "no message_id supplied in forwardMessage" unless $args->{message_id}; - $send_args->{message_id} = $args->{message_id}; + croak 'No message_id supplied in forwardMessage()' unless $args->{message_id}; + $send_args->{message_id} = $args->{message_id}; # these are optional, send if they are supplied $send_args->{disable_notification} = $args->{disable_notification} if exists $args->{disable_notification}; - my $token = $self->token || croak "no token in forwardMessage?"; + my $token = $self->token || croak 'No token supplied to forwardMessage()?'; my $url = "https://api.telegram.org/bot${token}/forwardMessage"; my $api_response = $self->_post_request($url, $send_args); @@ -208,7 +212,7 @@ sub forwardMessage { return Teapot::Bot::Object::Message->create_from_hash($api_response, $self); } else { - return {"error" => 1}; + return {'error' => 1}; } } @@ -218,14 +222,14 @@ sub sendPhoto { my $args = shift || {}; my $send_args = {}; - croak "no chat_id supplied" unless $args->{chat_id}; + croak 'No chat_id supplied to sendPhoto()' unless $args->{chat_id}; $send_args->{chat_id} = $args->{chat_id}; # photo can be a string (which might be either a URL for telegram servers # to fetch, or a file_id string) or a file on disk to upload - we need # to handle that last case here as it changes the way we create the HTTP # request - croak "no photo supplied in sendPhoto" unless $args->{photo}; + croak 'No photo supplied in sendPhoto()' unless $args->{photo}; if (-e $args->{photo}) { $send_args->{photo} = { photo => { file => $args->{photo} } }; } @@ -233,7 +237,7 @@ sub sendPhoto { $send_args->{photo} = $args->{photo}; } - my $token = $self->token || croak "no token in sendPhoto?"; + my $token = $self->token || croak 'No token in sendPhoto()?'; my $url = "https://api.telegram.org/bot${token}/sendPhoto"; my $api_response = $self->_post_request($url, $send_args); @@ -241,7 +245,7 @@ sub sendPhoto { return Teapot::Bot::Object::Message->create_from_hash($api_response, $self); } else { - return {"error" => 1}; + return {'error' => 1}; } } @@ -251,7 +255,7 @@ sub sendChatAction { my $args = shift || {}; my $send_args = {}; - croak "no chat_id supplied in sendChatAction" unless $args->{chat_id}; + croak 'No chat_id supplied in sendChatAction()' unless $args->{chat_id}; $send_args->{chat_id} = $args->{chat_id}; unless (defined $args->{action}) { @@ -290,7 +294,7 @@ sub sendChatAction { $send_args->{action} = 'typing'; } - my $token = $self->token || croak "no token in sendChatAction?"; + my $token = $self->token || croak 'No token in sendChatAction()?'; my $url = "https://api.telegram.org/bot${token}/sendChatAction"; my $api_response = $self->_post_request ($url, $send_args); @@ -317,7 +321,7 @@ sub _add_getUpdates_handler { my ($ua, $tx) = @_; my $res = $tx->res->json; my $items = $res->{result}; - foreach my $item (@$items) { + foreach my $item (@{$items}) { $last_update_id = $item->{update_id}; $self->_process_message($item); } @@ -347,7 +351,7 @@ sub _process_message { # if we got to this point without creating a response, it must be a type we # don't handle yet if (! $update) { - cluck "Do not know how to handle this update: " . Dumper($item); + cluck 'Do not know how to handle this update: ' . Dumper($item); } foreach my $listener (@{ $self->listeners }) { @@ -366,17 +370,17 @@ sub _post_request { my $res = $self->ua->post($url, form => $form_args)->result; - if ($res->is_success) { + if ($res->is_success) { return $res->json->{result}; } elsif ($res->is_error) { # This can be non-fatal error: api change. - cluck "Failed to post: " . $res->message; + cluck 'Failed to post: ' . $res->message; return 0; # to handle this as false in upper layers } else { # This must be something fatal for sure, because either is_success or is_error must be set by Mojo - confess "Not sure what went wrong"; + confess 'Not sure what went wrong'; } } @@ -560,7 +564,7 @@ Note that not all methods have yet been implemented. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Animation.pm b/lib/Teapot/Bot/Object/Animation.pm index 8414370..c202017 100644 --- a/lib/Teapot/Bot/Object/Animation.pm +++ b/lib/Teapot/Bot/Object/Animation.pm @@ -17,7 +17,7 @@ has 'mime_type'; has 'file_size'; sub fields { - return { scalar => [qw/file_id width height duration file_name mime_type file_size/], + return { scalar => [qw/file_id width height duration file_name mime_type file_size/], 'Teapot::Bot::Object::PhotoSize' => [qw/thumb/], }; } @@ -33,13 +33,14 @@ __END__ =head1 NAME -Teapot::Bot::Object::Animation - The base class for Telegram message 'Animation' type. +Teapot::Bot::Object::Animation - The base class for Telegram message 'Animation' type =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram message 'Animation' type. See L for details of the attributes available for L objects. @@ -48,7 +49,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Audio.pm b/lib/Teapot/Bot/Object/Audio.pm index faab728..f629af3 100644 --- a/lib/Teapot/Bot/Object/Audio.pm +++ b/lib/Teapot/Bot/Object/Audio.pm @@ -14,7 +14,7 @@ has 'file_size'; has 'thumb'; #PhotoSize sub fields { - return { scalar => [qw/file_id duration performer title mime_type file_size/], + return { scalar => [qw/file_id duration performer title mime_type file_size/], 'Teapot::Bot::Object::PhotoSize' => [qw/thumb/], }; } @@ -36,6 +36,7 @@ Teapot::Bot::Object::Audio - The base class for Telegram 'Audio' type objects version 0.021 =head1 DESCRIPTION +The base class for Telegram 'Audio' type objects. See L for details of the attributes available for L objects. @@ -44,7 +45,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Base.pm b/lib/Teapot/Bot/Object/Base.pm index d5b108b..2db970d 100644 --- a/lib/Teapot/Bot/Object/Base.pm +++ b/lib/Teapot/Bot/Object/Base.pm @@ -2,28 +2,30 @@ package Teapot::Bot::Object::Base; # ABSTRACT: The base class for all Teapot::Bot::Object objects. use Mojo::Base -base; +use List::Util qw/any/; +use Carp qw/croak/; $Teapot::Bot::Object::Base::VERSION = '0.021'; has '_brain'; # a reference to our brain -sub arrays { qw// } # override if needed +sub arrays { return qw// } # override if needed sub _field_is_array { my $self = shift; my $field = shift; - if (grep /^$field$/, $self->arrays) { + if (any { /^$field$/ } $self->arrays) { return 1; } return; } -sub array_of_arrays { qw// } #override if needed +sub array_of_arrays { return qw// } #override if needed sub _field_is_array_of_arrays { my $self = shift; my $field = shift; - if (grep /^$field$/, $self->array_of_arrays) { + if (any { /^$field$/ } $self->array_of_arrays) { return 1; } return; @@ -35,7 +37,7 @@ sub _field_is_array_of_arrays { sub create_from_hash { my $class = shift; my $hash = shift; - my $brain = shift || die "no brain supplied"; + my $brain = shift || croak 'No brain supplied to create_from_hash()'; my $obj = $class->new(_brain => $brain); # deal with each type of field @@ -60,7 +62,7 @@ sub create_from_hash { $obj->$field($val); } elsif ($obj->_field_is_array_of_arrays) { - die "not yet implemented for scalars"; + croak 'Not yet implemented for scalars'; } else { my $val = $hash->{$field}; @@ -81,7 +83,7 @@ sub create_from_hash { $obj->$field(\@sub_array); } elsif ($obj->_field_is_array_of_arrays) { - die "not yet implemented for scalars"; + croak 'Not yet implemented for scalars'; } else { $obj->$field($type->create_from_hash($hash->{$field}, $brain)); @@ -129,7 +131,7 @@ __END__ =head1 NAME -Teapot::Bot::Object::Base - The base class for all Telegram::Bot::Object objects. +Teapot::Bot::Object::Base - The base class for all Telegram::Bot::Object objects =head1 VERSION @@ -137,6 +139,8 @@ version 0.021 =head1 DESCRIPTION +The base class for all Telegram::Bot::Object objects. + This class should not be instantiated itself. Instead, instantiate a sub-class. You should generally not need to instantiate objects of sub-classes of L, @@ -170,7 +174,7 @@ Return this object as a hashref. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/CallbackGame.pm b/lib/Teapot/Bot/Object/CallbackGame.pm index f30331a..c676def 100644 --- a/lib/Teapot/Bot/Object/CallbackGame.pm +++ b/lib/Teapot/Bot/Object/CallbackGame.pm @@ -1,9 +1,8 @@ package Teapot::Bot::Object::CallbackGame; -$Teapot::Bot::Object::CallbackGame::VERSION = '0.021'; # ABSTRACT: The base class for Telegram message 'CallbackGame' type. - use Mojo::Base 'Teapot::Bot::Object::Base'; +$Teapot::Bot::Object::CallbackGame::VERSION = '0.021'; # https://core.telegram.org/bots/api#callbackgame # "A placeholder, currently holds no information. Use BotFather to set up your game" @@ -22,13 +21,14 @@ __END__ =head1 NAME -Teapot::Bot::Object::CallbackGame - The base class for Telegram message 'CallbackGame' type. +Teapot::Bot::Object::CallbackGame - The base class for Telegram message 'CallbackGame' type =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram message 'CallbackGame' type. See L for details of the attributes available for L objects. @@ -37,7 +37,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Chat.pm b/lib/Teapot/Bot/Object/Chat.pm index 1a2841f..10ad426 100644 --- a/lib/Teapot/Bot/Object/Chat.pm +++ b/lib/Teapot/Bot/Object/Chat.pm @@ -62,6 +62,7 @@ Teapot::Bot::Object::Chat - The base class for Telegram 'Chat' type objects version 0.021 =head1 DESCRIPTION +The base class for Telegram 'Chat' type objects. See L for details of the attributes available for L objects. @@ -80,7 +81,7 @@ Returns true if this is a chat is a group. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/ChatMember.pm b/lib/Teapot/Bot/Object/ChatMember.pm index 7ee77ff..3513ca0 100644 --- a/lib/Teapot/Bot/Object/ChatMember.pm +++ b/lib/Teapot/Bot/Object/ChatMember.pm @@ -53,6 +53,7 @@ Teapot::Bot::Object::ChatMember - The base class for Telegram 'ChatMember' type version 0.021 =head1 DESCRIPTION +The base class for Telegram 'ChatMember' type objects. See L for details of the attributes available for L objects. @@ -61,7 +62,7 @@ attributes available for L objects. Sergei Fedosov -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2020 by Sergei Fedosov diff --git a/lib/Teapot/Bot/Object/ChatPermissions.pm b/lib/Teapot/Bot/Object/ChatPermissions.pm index ad4a26e..24d842f 100644 --- a/lib/Teapot/Bot/Object/ChatPermissions.pm +++ b/lib/Teapot/Bot/Object/ChatPermissions.pm @@ -25,7 +25,7 @@ sub fields { 'scalar' => [qw/can_send_messages can_send_media_messages can_send_polls can_send_other_messages can_add_web_page_previews can_change_info can_invite_users can_pin_messages/] - }; + }; } 1; @@ -45,6 +45,7 @@ Teapot::Bot::Object::ChatPermissions - The base class for Telegram 'ChatPermissi version 0.021 =head1 DESCRIPTION +The base class for Telegram 'ChatPermissions' type objects. See L for details of the attributes available for L objects. @@ -53,7 +54,7 @@ attributes available for L objects. Sergei Fedosov -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2020 Sergei Fedosov . diff --git a/lib/Teapot/Bot/Object/ChatPhoto.pm b/lib/Teapot/Bot/Object/ChatPhoto.pm index 9bbbddb..1a83dec 100644 --- a/lib/Teapot/Bot/Object/ChatPhoto.pm +++ b/lib/Teapot/Bot/Object/ChatPhoto.pm @@ -10,8 +10,8 @@ has 'big_file_id'; sub fields { return { - 'scalar' => [qw/small_file_id big_file_id/], - }; + 'scalar' => [qw/small_file_id big_file_id/], + }; } 1; @@ -31,6 +31,7 @@ Teapot::Bot::Object::ChatPhoto - The base class for Telegram 'ChatPhoto' type ob version 0.021 =head1 DESCRIPTION +The base class for Telegram 'ChatPhoto' type objects. See L for details of the attributes available for L objects. @@ -39,7 +40,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Contact.pm b/lib/Teapot/Bot/Object/Contact.pm index 97da25f..ce5eed2 100644 --- a/lib/Teapot/Bot/Object/Contact.pm +++ b/lib/Teapot/Bot/Object/Contact.pm @@ -11,7 +11,8 @@ has 'last_name'; has 'user_id'; sub fields { - return { scalar => [qw/phone_number first_name last_name user_id/], + return { + scalar => [qw/phone_number first_name last_name user_id/], }; } @@ -25,22 +26,23 @@ __END__ =head1 NAME -Teapot::Bot::Object::Contact - The base class for Telegram 'Contact' objects. +Teapot::Bot::Object::Contact - The base class for Telegram 'Contact' objects =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram 'Contact' objects. -See L for details of the +See L for details of the attributes available for L objects. =head1 AUTHOR Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Document.pm b/lib/Teapot/Bot/Object/Document.pm index 4f5cd1e..8c76161 100644 --- a/lib/Teapot/Bot/Object/Document.pm +++ b/lib/Teapot/Bot/Object/Document.pm @@ -14,7 +14,8 @@ has 'mime_type'; has 'file_size'; sub fields { - return { scalar => [qw/file_id file_name mime_type file_size/], + return { + scalar => [qw/file_id file_name mime_type file_size/], 'Teapot::Bot::Object::PhotoSize' => [qw/thumb/] }; } @@ -36,6 +37,7 @@ Teapot::Bot::Object::Document - The base class for Telegram 'Document' objects version 0.021 =head1 DESCRIPTION +The base class for Telegram 'Document' objects. See L for details of the attributes available for L objects. @@ -44,7 +46,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/EncryptedCredentials.pm b/lib/Teapot/Bot/Object/EncryptedCredentials.pm index 7cba096..bed9470 100644 --- a/lib/Teapot/Bot/Object/EncryptedCredentials.pm +++ b/lib/Teapot/Bot/Object/EncryptedCredentials.pm @@ -30,6 +30,7 @@ Teapot::Bot::Object::EncryptedCredentials - The base class for Telegram 'Encrypt version 0.021 =head1 DESCRIPTION +The base class for Telegram 'EncryptedCredentials' type objects. See L for details of the attributes available for L objects. @@ -38,7 +39,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/EncryptedPassportElement.pm b/lib/Teapot/Bot/Object/EncryptedPassportElement.pm index 41a1899..437d693 100644 --- a/lib/Teapot/Bot/Object/EncryptedPassportElement.pm +++ b/lib/Teapot/Bot/Object/EncryptedPassportElement.pm @@ -36,6 +36,7 @@ Teapot::Bot::Object::EncryptedPassportElement - The base class for Telegram 'Enc version 0.021 =head1 DESCRIPTION +The base class for Telegram 'EncryptedPassportElement' type objects. See L for details of the attributes available for L objects. @@ -46,7 +47,7 @@ Note that this type is not yet fully implemented. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Game.pm b/lib/Teapot/Bot/Object/Game.pm index 849b954..dd90926 100644 --- a/lib/Teapot/Bot/Object/Game.pm +++ b/lib/Teapot/Bot/Object/Game.pm @@ -17,7 +17,8 @@ has 'text_entities'; #Array of MessageEntity has 'animation'; #Animation sub fields { - return { scalar => [qw/title description text/], + return { + scalar => [qw/title description text/], 'Teapot::Bot::Object::PhotoSize' => [qw/photo/], 'Teapot::Bot::Object::MessageEntity' => [qw/text_entities/], 'Teapot::Bot::Object::Animation' => [qw/animation/], @@ -36,13 +37,14 @@ __END__ =head1 NAME -Teapot::Bot::Object::Game - The base class for Telegram message 'Game' type. +Teapot::Bot::Object::Game - The base class for Telegram message 'Game' type =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram message 'Game' type. See L for details of the attributes available for L objects. @@ -51,7 +53,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/InlineKeyboardButton.pm b/lib/Teapot/Bot/Object/InlineKeyboardButton.pm index d310556..d46cc0e 100644 --- a/lib/Teapot/Bot/Object/InlineKeyboardButton.pm +++ b/lib/Teapot/Bot/Object/InlineKeyboardButton.pm @@ -17,11 +17,11 @@ has 'callback_game'; # CallbackGame has 'pay'; sub fields { - return { 'scalar' => [qw/text url callback_data switch_inline_query - switch_inline_query_current_chat switch_inline_query_current_chat - pay/], - 'Teapot::Bot::Object::LoginUrl' => [qw/login_url/], - 'Teapot::Bot::Object::CallbackGame'=> [qw/callback_game/], + return { 'scalar' => [qw/text url callback_data switch_inline_query + switch_inline_query_current_chat switch_inline_query_current_chat + pay/], + 'Teapot::Bot::Object::LoginUrl' => [qw/login_url/], + 'Teapot::Bot::Object::CallbackGame' => [qw/callback_game/], }; } @@ -42,6 +42,7 @@ Teapot::Bot::Object::InlineKeyboardButton - The base class for Telegram 'InlineK version 0.021 =head1 DESCRIPTION +The base class for Telegram 'InlineKeyboardButton' type objects. See L for details of the attributes available for L objects. @@ -50,7 +51,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/InlineKeyboardMarkup.pm b/lib/Teapot/Bot/Object/InlineKeyboardMarkup.pm index 2a023ae..6f147aa 100644 --- a/lib/Teapot/Bot/Object/InlineKeyboardMarkup.pm +++ b/lib/Teapot/Bot/Object/InlineKeyboardMarkup.pm @@ -9,12 +9,11 @@ $Teapot::Bot::Object::InlineKeyboardMarkup::VERSION = '0.021'; has 'inline_keyboard'; sub fields { - return { 'Teapot::Bot::Object::InlineKeyboardButton' => [qw/inline_keyboard/], - }; + return { 'Teapot::Bot::Object::InlineKeyboardButton' => [qw/inline_keyboard/] }; } sub array_of_arrays { - qw/inline_keyboard/; + return qw/inline_keyboard/; } 1; @@ -34,6 +33,7 @@ Teapot::Bot::Object::InlineKeyboardMarkup - The base class for Telegram 'InlineK version 0.021 =head1 DESCRIPTION +The base class for Telegram 'InlineKeyboardMarkup' type objects. See L for details of the attributes available for L objects. @@ -42,7 +42,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Invoice.pm b/lib/Teapot/Bot/Object/Invoice.pm index a018392..632dc9f 100644 --- a/lib/Teapot/Bot/Object/Invoice.pm +++ b/lib/Teapot/Bot/Object/Invoice.pm @@ -12,8 +12,7 @@ has 'currency'; has 'total_amount'; sub fields { - return { scalar => [qw/title description start_parameter currency total_amount/], - }; + return { scalar => [qw/title description start_parameter currency total_amount/] }; } 1; @@ -33,6 +32,7 @@ Teapot::Bot::Object::Invoice - The base class for Telegram 'Invoice' type object version 0.021 =head1 DESCRIPTION +The base class for Telegram 'Invoice' type objects. See L for details of the attributes available for L objects. @@ -41,7 +41,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Location.pm b/lib/Teapot/Bot/Object/Location.pm index 0386ce6..f488b20 100644 --- a/lib/Teapot/Bot/Object/Location.pm +++ b/lib/Teapot/Bot/Object/Location.pm @@ -9,8 +9,7 @@ has 'longitude'; has 'latitude'; sub fields { - return { scalar => [qw/longitude latitude/], - }; + return { scalar => [qw/longitude latitude/] }; } 1; @@ -23,13 +22,14 @@ __END__ =head1 NAME -Teapot::Bot::Object::Location - The base class for Telegram message 'Location' type. +Teapot::Bot::Object::Location - The base class for Telegram message 'Location' type =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram message 'Location' type. See L for details of the attributes available for L objects. @@ -38,7 +38,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/LoginUrl.pm b/lib/Teapot/Bot/Object/LoginUrl.pm index 86f5ae9..83c27e8 100644 --- a/lib/Teapot/Bot/Object/LoginUrl.pm +++ b/lib/Teapot/Bot/Object/LoginUrl.pm @@ -31,6 +31,7 @@ Teapot::Bot::Object::LoginUrl - The base class for Telegram 'LoginUrl' type obje version 0.021 =head1 DESCRIPTION +The base class for Telegram 'LoginUrl' type objects. See L for details of the attributes available for L objects. @@ -39,7 +40,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Message.pm b/lib/Teapot/Bot/Object/Message.pm index b9876ce..a512f8f 100644 --- a/lib/Teapot/Bot/Object/Message.pm +++ b/lib/Teapot/Bot/Object/Message.pm @@ -152,31 +152,38 @@ __END__ =head1 NAME -Teapot::Bot::Object::Message - The base class for the Telegram type "Message". +Teapot::Bot::Object::Message - The base class for the Telegram type "Message" =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for the Telegram type "Message". See L for details of the attributes available for L objects. =head1 METHODS -=head2 +=head2 reply A convenience method to reply to a message with text. Will return the L object representing the message sent. +=head2 typing + +Sends notification to chat that bot is "typing" something. + +Returns nothing that should be checked. + =head1 AUTHOR Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/MessageEntity.pm b/lib/Teapot/Bot/Object/MessageEntity.pm index a2b1fbe..d95e874 100644 --- a/lib/Teapot/Bot/Object/MessageEntity.pm +++ b/lib/Teapot/Bot/Object/MessageEntity.pm @@ -15,9 +15,9 @@ has 'language'; # Optional. For “pre” only, the programming language of the sub fields { return { - 'scalar' => [qw/type offset length url language/], - 'Teapot::Bot::Object::User' => [qw/user/], - }; + 'scalar' => [qw/type offset length url language/], + 'Teapot::Bot::Object::User' => [qw/user/], + }; } 1; @@ -37,6 +37,7 @@ Teapot::Bot::Object::MessageEntity - The base class for Telegram 'MessageEntity' version 0.021 =head1 DESCRIPTION +The base class for Telegram 'MessageEntity' type objects. See L for details of the attributes available for L objects. @@ -45,7 +46,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/PassportData.pm b/lib/Teapot/Bot/Object/PassportData.pm index 98c6d06..e6f7af5 100644 --- a/lib/Teapot/Bot/Object/PassportData.pm +++ b/lib/Teapot/Bot/Object/PassportData.pm @@ -11,8 +11,9 @@ has 'data'; # Array of EncryptedPassportElement has 'credentials'; # EncryptedCredentials sub fields { - return { 'Teapot::Bot::Object::EncryptedPassportElement' => [qw/data/], - 'Teapot::Bot::Object::EncryptedCredentials' => [qw/credentials/], + return { + 'Teapot::Bot::Object::EncryptedPassportElement' => [qw/data/], + 'Teapot::Bot::Object::EncryptedCredentials' => [qw/credentials/], }; } @@ -37,6 +38,7 @@ Teapot::Bot::Object::PassportData - The base class for Telegram 'PassportData' t version 0.021 =head1 DESCRIPTION +The base class for Telegram 'PassportData' type objects. See L for details of the attributes available for L objects. @@ -45,7 +47,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/PhotoSize.pm b/lib/Teapot/Bot/Object/PhotoSize.pm index d4f0608..113028f 100644 --- a/lib/Teapot/Bot/Object/PhotoSize.pm +++ b/lib/Teapot/Bot/Object/PhotoSize.pm @@ -12,8 +12,7 @@ has 'height'; has 'file_size'; sub fields { - return { scalar => [qw/file_id width height file_size/] - }; + return { scalar => [qw/file_id width height file_size/] }; } 1; @@ -26,13 +25,14 @@ __END__ =head1 NAME -Teapot::Bot::Object::PhotoSize - The base class for Telegram message 'PhotoSize' type. +Teapot::Bot::Object::PhotoSize - The base class for Telegram message 'PhotoSize' type =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram message 'PhotoSize' type. See L for details of the attributes available for L objects. @@ -41,7 +41,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Poll.pm b/lib/Teapot/Bot/Object/Poll.pm index 61009b4..8bbcf0f 100644 --- a/lib/Teapot/Bot/Object/Poll.pm +++ b/lib/Teapot/Bot/Object/Poll.pm @@ -12,9 +12,9 @@ has 'options'; # Array of PollOption has 'is_closed'; sub fields { - return { scalar => [qw/id question is_closed/], - 'Teapot::Bot::Object::PollOption' => [qw/options /], - + return { + scalar => [qw/id question is_closed/], + 'Teapot::Bot::Object::PollOption' => [qw/options/], }; } @@ -39,6 +39,7 @@ Teapot::Bot::Object::Poll - The base class for Telegram 'Poll' type objects version 0.021 =head1 DESCRIPTION +The base class for Telegram 'Poll' type objects See L for details of the attributes available for L objects. @@ -47,7 +48,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/PollOption.pm b/lib/Teapot/Bot/Object/PollOption.pm index e2d2f2f..a9dc457 100644 --- a/lib/Teapot/Bot/Object/PollOption.pm +++ b/lib/Teapot/Bot/Object/PollOption.pm @@ -9,8 +9,7 @@ has 'text'; has 'voter_count'; sub fields { - return { scalar => [qw/text voter_count/], - }; + return { scalar => [qw/text voter_count/] }; } 1; @@ -30,6 +29,7 @@ Teapot::Bot::Object::PollOption - The base class for Telegram 'PollOption' type version 0.021 =head1 DESCRIPTION +The base class for Telegram 'PollOption' type objects. See L for details of the attributes available for L objects. @@ -38,7 +38,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Sticker.pm b/lib/Teapot/Bot/Object/Sticker.pm index 59d658e..064df45 100644 --- a/lib/Teapot/Bot/Object/Sticker.pm +++ b/lib/Teapot/Bot/Object/Sticker.pm @@ -16,8 +16,8 @@ has 'set_name'; has 'file_size'; sub fields { - return { scalar => [qw/file_id width height emoji - set_name file_size /], + return { + scalar => [ qw/file_id width height emoji set_name file_size/ ], 'Teapot::Bot::Object::PhotoSize' => [ qw/thumb/ ], }; } @@ -32,13 +32,14 @@ __END__ =head1 NAME -Teapot::Bot::Object::Sticker - The base class for Telegram message 'Sticker' type. +Teapot::Bot::Object::Sticker - The base class for Telegram message 'Sticker' type =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram message 'Sticker' type. See L for details of the attributes available for L objects. @@ -47,7 +48,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/SuccessfulPayment.pm b/lib/Teapot/Bot/Object/SuccessfulPayment.pm index 6574d91..db52f71 100644 --- a/lib/Teapot/Bot/Object/SuccessfulPayment.pm +++ b/lib/Teapot/Bot/Object/SuccessfulPayment.pm @@ -15,10 +15,10 @@ has 'telegram_payment_charge_id'; has 'provider_payment_charge_id'; sub fields { - return { scalar => [qw/currency total_amount invoice_payload shipping_option_id - telegram_payment_charge_id provider_payment_charge_id/], - # 'Teapot::Bot::Object::OrderInfo' => [qw/order_info/], - + return { + scalar => [qw/currency total_amount invoice_payload shipping_option_id + telegram_payment_charge_id provider_payment_charge_id/], +# 'Teapot::Bot::Object::OrderInfo' => [qw/order_info/], }; } @@ -39,6 +39,7 @@ Teapot::Bot::Object::SuccessfulPayment - The base class for Telegram 'Successful version 0.021 =head1 DESCRIPTION +The base class for Telegram 'SuccessfulPayment' type objects. See L for details of the attributes available for L objects. @@ -47,7 +48,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/User.pm b/lib/Teapot/Bot/Object/User.pm index a7ff9b4..8f8e831 100644 --- a/lib/Teapot/Bot/Object/User.pm +++ b/lib/Teapot/Bot/Object/User.pm @@ -17,7 +17,8 @@ has 'can_read_all_group_messages';# optional, only for getMe() method has 'supports_inline_queries'; # optional, only for getMe() method sub fields { - return { scalar => [qw/id is_bot first_name last_name username language_code can_join_groups + return { + scalar => [qw/id is_bot first_name last_name username language_code can_join_groups can_read_all_group_messages supports_inline_queries/] }; } @@ -32,13 +33,14 @@ __END__ =head1 NAME -Teapot::Bot::Object::User - The base class for Telegram message 'User' type. +Teapot::Bot::Object::User - The base class for Telegram message 'User' type =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram message 'User' type. See L for details of the attributes available for L objects. @@ -47,7 +49,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Venue.pm b/lib/Teapot/Bot/Object/Venue.pm index df50a5c..bdfa9c3 100644 --- a/lib/Teapot/Bot/Object/Venue.pm +++ b/lib/Teapot/Bot/Object/Venue.pm @@ -13,9 +13,10 @@ has 'foursquare_id'; has 'foursquare_type'; sub fields { - return { 'scalar' => [qw/title address - foursquare_id foursquare_type/], - 'Teapot::Bot::Object::Location' => [qw/location/] }; + return { + 'scalar' => [qw/title address foursquare_id foursquare_type/], + 'Teapot::Bot::Object::Location' => [qw/location/] + }; } @@ -36,6 +37,7 @@ Teapot::Bot::Object::Venue - The base class for Telegram 'LoginUrl' type objects version 0.021 =head1 DESCRIPTION +The base class for Telegram 'LoginUrl' type objects. See L for details of the attributes available for L objects. @@ -44,7 +46,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Video.pm b/lib/Teapot/Bot/Object/Video.pm index ae3bf69..1404508 100644 --- a/lib/Teapot/Bot/Object/Video.pm +++ b/lib/Teapot/Bot/Object/Video.pm @@ -15,8 +15,8 @@ has 'mime_type'; has 'file_size'; sub fields { - return { scalar => [qw/file_id width height duration - mime_type file_size /], + return { + scalar => [qw/file_id width height duration mime_type file_size/], 'Teapot::Bot::Object::PhotoSize' => [qw/thumb/] }; } @@ -31,13 +31,14 @@ __END__ =head1 NAME -Teapot::Bot::Object::Video - The base class for Telegram 'Video' object. +Teapot::Bot::Object::Video - The base class for Telegram 'Video' object =head1 VERSION version 0.021 =head1 DESCRIPTION +The base class for Telegram 'Video' object. See L for details of the attributes available for L objects. @@ -46,7 +47,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/VideoNote.pm b/lib/Teapot/Bot/Object/VideoNote.pm index d81273d..f5e7a27 100644 --- a/lib/Teapot/Bot/Object/VideoNote.pm +++ b/lib/Teapot/Bot/Object/VideoNote.pm @@ -15,9 +15,9 @@ has 'thumb'; #PhotoSize has 'file_size'; sub fields { - return { scalar => [qw/file_id length duration mime_type file_size/], + return { + scalar => [qw/file_id length duration mime_type file_size/], 'Teapot::Bot::Object::PhotoSize' => [qw/thumb /], - }; } @@ -38,6 +38,7 @@ Teapot::Bot::Object::VideoNote - The base class for Telegram 'VideoNote' type ob version 0.021 =head1 DESCRIPTION +The base class for Telegram 'VideoNote' type object. See L for details of the attributes available for L objects. @@ -46,7 +47,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins. diff --git a/lib/Teapot/Bot/Object/Voice.pm b/lib/Teapot/Bot/Object/Voice.pm index 6ca34f5..051c0b8 100644 --- a/lib/Teapot/Bot/Object/Voice.pm +++ b/lib/Teapot/Bot/Object/Voice.pm @@ -11,8 +11,7 @@ has 'mime_type'; has 'file_size'; sub fields { - return { scalar => [qw/file_id duration mime_type file_size/] - }; + return { scalar => [qw/file_id duration mime_type file_size/] }; } 1; @@ -32,6 +31,7 @@ Teapot::Bot::Object::Voice - The base class for Telegram 'Voice' type objects version 0.021 =head1 DESCRIPTION +The base class for Telegram 'Voice' type objects. See L for details of the attributes available for L objects. @@ -40,7 +40,7 @@ attributes available for L objects. Justin Hawkins -=head1 COPYRIGHT AND LICENSE +=head1 LICENSE AND COPYRIGHT This software is copyright (c) 2019 by Justin Hawkins.