Compare commits
8 Commits
afe50154ab
...
380bff679e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
380bff679e | ||
|
|
7d3d17f807 | ||
|
|
a9c049da13 | ||
|
|
ade7cefe5a | ||
|
|
6d7830024c | ||
|
|
33616284ca | ||
|
|
d8728b383e | ||
|
|
59e8fa525a |
@@ -5,6 +5,7 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
|
||||
use Teapot::Bot::Object::ChatPhoto;
|
||||
use Teapot::Bot::Object::Message;
|
||||
use Teapot::Bot::Object::ChatPermissions;
|
||||
use Teapot::Bot::Object::ChatLocation;
|
||||
|
||||
$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 'sticker_set_name'; # 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 {
|
||||
return {
|
||||
'scalar' => [qw/id type title username first_name last_name description
|
||||
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::Message' => [qw/pinned_message/],
|
||||
'Teapot::Bot::Object::ChatPermissions' => [qw/permissions/],
|
||||
'Teapot::Bot::Object::ChatLocation' => [qw/location/],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
51
lib/Teapot/Bot/Object/ChatLocation.pm
Normal file
51
lib/Teapot/Bot/Object/ChatLocation.pm
Normal 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
|
||||
@@ -9,7 +9,8 @@ $Teapot::Bot::Object::ChatMember::VERSION = '0.022';
|
||||
has 'user';
|
||||
has 'status';
|
||||
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_post_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_other_messages'; # optional. Restricted only.
|
||||
has 'can_add_web_page_previews'; # optional. Restricted only.
|
||||
has 'until_date'; # optional. Restricted and kicked only.
|
||||
|
||||
sub fields {
|
||||
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_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/],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,11 +6,13 @@ use Mojo::Base 'Teapot::Bot::Object::Base';
|
||||
$Teapot::Bot::Object::ChatPhoto::VERSION = '0.022';
|
||||
|
||||
has 'small_file_id';
|
||||
has 'small_file_unique_id';
|
||||
has 'big_file_id';
|
||||
has 'big_file_unique_id';
|
||||
|
||||
sub fields {
|
||||
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/],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,13 @@ $Teapot::Bot::Object::Location::VERSION = '0.022';
|
||||
|
||||
has 'longitude';
|
||||
has 'latitude';
|
||||
has 'horizontal_accuracy';
|
||||
has 'live_period';
|
||||
has 'heading';
|
||||
has 'proximity_alert_radius';
|
||||
|
||||
sub fields {
|
||||
return { scalar => [qw/longitude latitude/] };
|
||||
return { scalar => [qw/longitude latitude horizontal_accuracy live_period heading proximity_alert_radius/] };
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
@@ -9,17 +9,28 @@ $Teapot::Bot::Object::Poll::VERSION = '0.022';
|
||||
has 'id';
|
||||
has 'question';
|
||||
has 'options'; # Array of PollOption
|
||||
has 'total_voter_count';
|
||||
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 {
|
||||
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/],
|
||||
};
|
||||
}
|
||||
|
||||
sub arrays {
|
||||
return qw/options/;
|
||||
return qw/options explanation_entities/;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
56
lib/Teapot/Bot/Object/PollAnswer.pm
Normal file
56
lib/Teapot/Bot/Object/PollAnswer.pm
Normal 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
|
||||
@@ -11,10 +11,12 @@ has 'title';
|
||||
has 'address';
|
||||
has 'foursquare_id';
|
||||
has 'foursquare_type';
|
||||
has 'google_place_id';
|
||||
has 'google_place_type';
|
||||
|
||||
sub fields {
|
||||
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/]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user