1

Compare commits

...

8 Commits

8 changed files with 141 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::ChatPhoto; use Teapot::Bot::Object::ChatPhoto;
use Teapot::Bot::Object::Message; use Teapot::Bot::Object::Message;
use Teapot::Bot::Object::ChatPermissions; use Teapot::Bot::Object::ChatPermissions;
use Teapot::Bot::Object::ChatLocation;
$Teapot::Bot::Object::Chat::VERSION = '0.022'; $Teapot::Bot::Object::Chat::VERSION = '0.022';
@@ -23,15 +24,18 @@ has 'permissions'; # Teapot::Bot::Object::ChatPermissions. Optional. Def
has 'slow_mode_delay'; # Optional. Returned only in getChat. has 'slow_mode_delay'; # Optional. Returned only in getChat.
has 'sticker_set_name'; # Optional. Returned only in getChat. has 'sticker_set_name'; # Optional. Returned only in getChat.
has 'can_set_sticker_set'; # Optional. Returned only in getChat. has 'can_set_sticker_set'; # Optional. Returned only in getChat.
has 'linked_chat_id'; # Optional. greater than 32 bits, smaller than 52 bits
has 'location'; # Optional. Returned only in getChat.
sub fields { sub fields {
return { return {
'scalar' => [qw/id type title username first_name last_name description 'scalar' => [qw/id type title username first_name last_name description
invite_link slow_mode_delay sticker_set_name invite_link slow_mode_delay sticker_set_name
can_set_sticker_set /], can_set_sticker_set linked_chat_id/],
'Teapot::Bot::Object::ChatPhoto' => [qw/photo/], 'Teapot::Bot::Object::ChatPhoto' => [qw/photo/],
'Teapot::Bot::Object::Message' => [qw/pinned_message/], 'Teapot::Bot::Object::Message' => [qw/pinned_message/],
'Teapot::Bot::Object::ChatPermissions' => [qw/permissions/], 'Teapot::Bot::Object::ChatPermissions' => [qw/permissions/],
'Teapot::Bot::Object::ChatLocation' => [qw/location/],
}; };
} }

View File

@@ -0,0 +1,51 @@
package Teapot::Bot::Object::ChatLocation;
# ABSTRACT: The base class for Telegram message 'ChatLocation' type.
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::ChatLocation::VERSION = '0.022';
has 'location';
has 'address';
sub fields {
return {
'Teapot::Bot::Object::Location' => [qw/location/],
'scalar' => [qw/address/],
};
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Teapot::Bot::Object::ChatLocation - The base class for Telegram message 'ChatLocation' type
=head1 VERSION
version 0.022
=head1 DESCRIPTION
The base class for Telegram message 'ChatLocation' type.
See L<https://core.telegram.org/bots/api#chatlocation> for details of the
attributes available for L<Teapot::Bot::Object::ChatLocation> objects.
=head1 AUTHOR
Sergei Fedosov <eleksir@gmail.com>
=head1 LICENSE AND COPYRIGHT
This software is copyright (c) 2019 by Sergei Fedosov <eleksir@gmail.com>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut

View File

@@ -9,7 +9,8 @@ $Teapot::Bot::Object::ChatMember::VERSION = '0.022';
has 'user'; has 'user';
has 'status'; has 'status';
has 'custom_title'; # optional. Owner and administrators only. has 'custom_title'; # optional. Owner and administrators only.
has 'until'; # optional. Restricted and kicked only. has 'is_anonymous'; # Optional. Owner and administrators only.
has 'can_be_edited'; # optional. Administrators only. has 'can_be_edited'; # optional. Administrators only.
has 'can_post_messages'; # optional. Administrators only. has 'can_post_messages'; # optional. Administrators only.
has 'can_edit_messages'; # optional. Administrators only. has 'can_edit_messages'; # optional. Administrators only.
@@ -25,13 +26,14 @@ has 'can_send_media_messages'; # optional. Restricted only.
has 'can_send_polls'; # optional. Restricted only. has 'can_send_polls'; # optional. Restricted only.
has 'can_send_other_messages'; # optional. Restricted only. has 'can_send_other_messages'; # optional. Restricted only.
has 'can_add_web_page_previews'; # optional. Restricted only. has 'can_add_web_page_previews'; # optional. Restricted only.
has 'until_date'; # optional. Restricted and kicked only.
sub fields { sub fields {
return { return {
'scalar' => [qw/status custom_title until can_be_edited can_post_messages can_edit_messages 'scalar' => [qw/status custom_title is_anonymous can_be_edited can_post_messages can_edit_messages
can_delete_messages can_restrict_members can_promote_members can_change_info can_delete_messages can_restrict_members can_promote_members can_change_info
can_invite_users can_pin_messages is_member can_send_messages can_invite_users can_pin_messages is_member can_send_messages
can_send_media_messages can_send_polls can_send_other_messages can_add_web_page_previews/], can_send_media_messages can_send_polls can_send_other_messages can_add_web_page_previews until_date/],
'Teapot::Bot::Object::User' => [qw/user/], 'Teapot::Bot::Object::User' => [qw/user/],
}; };
} }

View File

@@ -6,11 +6,13 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::ChatPhoto::VERSION = '0.022'; $Teapot::Bot::Object::ChatPhoto::VERSION = '0.022';
has 'small_file_id'; has 'small_file_id';
has 'small_file_unique_id';
has 'big_file_id'; has 'big_file_id';
has 'big_file_unique_id';
sub fields { sub fields {
return { return {
'scalar' => [qw/small_file_id big_file_id/], 'scalar' => [qw/small_file_id small_file_unique_id big_file_id big_file_unique_id/],
}; };
} }

View File

@@ -7,9 +7,13 @@ $Teapot::Bot::Object::Location::VERSION = '0.022';
has 'longitude'; has 'longitude';
has 'latitude'; has 'latitude';
has 'horizontal_accuracy';
has 'live_period';
has 'heading';
has 'proximity_alert_radius';
sub fields { sub fields {
return { scalar => [qw/longitude latitude/] }; return { scalar => [qw/longitude latitude horizontal_accuracy live_period heading proximity_alert_radius/] };
} }
1; 1;

View File

@@ -9,17 +9,28 @@ $Teapot::Bot::Object::Poll::VERSION = '0.022';
has 'id'; has 'id';
has 'question'; has 'question';
has 'options'; # Array of PollOption has 'options'; # Array of PollOption
has 'total_voter_count';
has 'is_closed'; has 'is_closed';
has 'is_anonymous';
has 'type';
has 'allows_multiple_answers';
has 'correct_option_id';
has 'explanation';
has 'explanation_entities';
has 'open_period';
has 'close_date';
sub fields { sub fields {
return { return {
scalar => [qw/id question is_closed/], scalar => [qw/id question total_voter_count is_closed is_anonymous type
allows_multiple_answers correct_option_id explanation
explanation_entities open_period close_date/],
'Teapot::Bot::Object::PollOption' => [qw/options/], 'Teapot::Bot::Object::PollOption' => [qw/options/],
}; };
} }
sub arrays { sub arrays {
return qw/options/; return qw/options explanation_entities/;
} }
1; 1;

View File

@@ -0,0 +1,56 @@
package Teapot::Bot::Object::PollOption;
# ABSTRACT: The base class for Telegram 'PollOption' type objects
use Mojo::Base 'Teapot::Bot::Object::Base';
$Teapot::Bot::Object::PollOption::VERSION = '0.022';
has 'poll_id';
has 'user';
has 'option_ids';
sub fields {
return {
'scalar' => [qw/poll_id option_ids/],
'Teapot::Bot::Object::User' => [qw/user/],
};
}
sub arrays {
return qw/option_ids/;
}
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Teapot::Bot::Object::PollOption - The base class for Telegram 'PollOption' type objects
=head1 VERSION
version 0.022
=head1 DESCRIPTION
The base class for Telegram 'PollOption' type objects.
See L<https://core.telegram.org/bots/api#polloption> for details of the
attributes available for L<Teapot::Bot::Object::PollOption> objects.
=head1 AUTHOR
Sergei Fedosov <eleksir@gmail.com>
=head1 LICENSE AND COPYRIGHT
This software is copyright (c) 2020 Sergei Fedosov <eleksir@gmail.com>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut

View File

@@ -11,10 +11,12 @@ has 'title';
has 'address'; has 'address';
has 'foursquare_id'; has 'foursquare_id';
has 'foursquare_type'; has 'foursquare_type';
has 'google_place_id';
has 'google_place_type';
sub fields { sub fields {
return { return {
'scalar' => [qw/title address foursquare_id foursquare_type/], 'scalar' => [qw/title address foursquare_id foursquare_type google_place_id google_place_type/],
'Teapot::Bot::Object::Location' => [qw/location/] 'Teapot::Bot::Object::Location' => [qw/location/]
}; };