Add general support for BotAPI v6.6

This commit is contained in:
eleksir
2023-04-16 16:58:59 +03:00
parent f019b98b1f
commit df3c198bce
6 changed files with 31 additions and 16 deletions

View File

@@ -16,7 +16,7 @@ has 'file_unique_id';
has 'width';
has 'height';
has 'duration';
has 'thumb'; #PhotoSize
has 'thumbnail'; #PhotoSize
has 'file_name';
has 'mime_type';
has 'file_size';
@@ -24,7 +24,7 @@ has 'file_size';
sub fields {
return { scalar => [qw/file_id file_unique_id width height duration file_name mime_type
file_size/],
'Teapot::Bot::Object::PhotoSize' => [qw/thumb/],
'Teapot::Bot::Object::PhotoSize' => [qw/thumbnail/],
};
}

View File

@@ -7,7 +7,7 @@ use 5.018; ## no critic (ProhibitImplicitImport)
use utf8;
use Mojo::Base 'Teapot::Bot::Object::Base';
use Teapot::Bot::Object::PhotoSize ();
$Teapot::Bot::Object::Audio::VERSION = '0.025';
has 'file_id';
@@ -18,12 +18,12 @@ has 'title'; # Optional. Title of the audio as defined by sender or by audio
has 'file_name'; # Optional. Original filename as defined by sender
has 'mime_type'; # Optional. MIME type of the file as defined by sender
has 'file_size'; # Optional. File size
has 'thumb'; # Optional. Thumbnail of the album cover to which the music file belongs
has 'thumbnail'; # Optional. Thumbnail of the album cover to which the music file belongs
sub fields {
return { scalar => [qw/file_id file_unique_id duration performer title file_name mime_type
file_size/],
'Teapot::Bot::Object::PhotoSize' => [qw/thumb/],
'Teapot::Bot::Object::PhotoSize' => [qw/thumbnail/],
};
}

View File

@@ -30,6 +30,13 @@ has 'bio'; # Optional. Bio of the other party in a private
has 'has_private_forwards'; # Optional. True, if privacy settings of the other party in the private chat allows to
# use tg://user?id=<user_id> links only in chats with the user.
# Returned only in getChat.
has 'has_restricted_voice_and_video_messages'; # Optional. True, if the privacy settings of the other party restrict
# sending voice and video note messages in the private chat.
# Returned only in getChat.
has 'join_to_send_messages'; # Optional. True, if users need to join the supergroup before they can send messages.
# Returned only in getChat.
has 'join_by_request' # Optional. True, if all users directly joining the supergroup need to be approved by
# supergroup administrators. Returned only in getChat.
has 'description'; # Optional. Returned only in getChat.
has 'invite_link'; # Optional. Returned only in getChat.
has 'pinned_message'; # Teapot::Bot::Object::Message
@@ -53,10 +60,12 @@ sub fields {
return {
'scalar' => [qw/id type title username first_name last_name is_forum
emoji_status_custom_emoji_id bio
has_private_forwards description invite_link slow_mode_delay
message_auto_delete_time has_aggressive_anti_spam_enabled
has_hidden_members has_protected_content sticker_set_name
can_set_sticker_set linked_chat_id/],
has_private_forwards has_restricted_voice_and_video_messages
join_to_send_messages join_by_request description invite_link
slow_mode_delay message_auto_delete_time
has_aggressive_anti_spam_enabled has_hidden_members
has_protected_content sticker_set_name 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/],

View File

@@ -13,7 +13,7 @@ $Teapot::Bot::Object::Document::VERSION = '0.025';
has 'file_id';
has 'file_unique_id';
has 'thumb'; #PhotoSize
has 'thumbnail'; #PhotoSize
has 'file_name';
has 'mime_type';
has 'file_size';
@@ -21,7 +21,7 @@ has 'file_size';
sub fields {
return {
scalar => [qw/file_id file_unique_id file_name mime_type file_size/],
'Teapot::Bot::Object::PhotoSize' => [qw/thumb/],
'Teapot::Bot::Object::PhotoSize' => [qw/thumbnail/],
};
}

View File

@@ -14,20 +14,26 @@ $Teapot::Bot::Object::Sticker::VERSION = '0.025';
has 'file_id';
has 'file_unique_id';
has 'type';
has 'width';
has 'height';
has 'is_animated';
has 'is_video';
has 'thumb'; # PhotoSize
has 'thumbnail'; # PhotoSize
has 'emoji';
has 'set_name';
has 'premium_animation';
has 'mask_position';
has 'custom_emoji_id';
has 'needs_repainting';
has 'file_size';
sub fields {
return {
scalar => [ qw/file_id file_unique_id width height is_animated is_video emoji set_name file_size/ ],
'Teapot::Bot::Object::PhotoSize' => [ qw/thumb/ ],
scalar => [ qw/file_id file_unique_id type width height is_animated is_video emoji
set_name premium_animation custom_emoji_id needs_repainting
file_size/ ],
'Teapot::Bot::Object::PhotoSize' => [ qw/thumbnail/ ],
'Teapot::Bot::Object::MaskPosition' => [qw/mask_position/],
};
}

View File

@@ -16,7 +16,7 @@ has 'file_unique_id';
has 'width';
has 'height';
has 'duration';
has 'thumb'; # Optional. Video thumbnail
has 'thumbnail'; # Optional. Video thumbnail
has 'file_name'; # Optional. Original filename as defined by sender
has 'mime_type'; # Optional. Mime type of a file as defined by sender
has 'file_size'; # Optional. File size
@@ -25,7 +25,7 @@ sub fields {
return {
scalar => [qw/file_id file_unique_id width height duration file_name mime_type
file_size/],
'Teapot::Bot::Object::PhotoSize' => [qw/thumb/],
'Teapot::Bot::Object::PhotoSize' => [qw/thumbnail/],
};
}