diff --git a/data/methods.json b/data/methods.json index b55ee39..1765acc 100644 --- a/data/methods.json +++ b/data/methods.json @@ -12,6 +12,7 @@ "copyMessage": "MessageId", "copyMessages": "Array", "sendPhoto": "Message", + "sendLivePhoto": "Message", "sendAudio": "Message", "sendDocument": "Message", "sendVideo": "Message", @@ -62,6 +63,7 @@ "getChatAdministrators": "Array", "getChatMemberCount": "Integer", "getChatMember": "ChatMember", + "getUserPersonalChatMessages": "Array", "setChatStickerSet": "Boolean", "deleteChatStickerSet": "Boolean", "getForumTopicIconStickers": "Array", @@ -78,10 +80,13 @@ "unhideGeneralForumTopic": "Boolean", "unpinAllGeneralForumTopicMessages": "Boolean", "answerCallbackQuery": "Boolean", + "answerGuestQuery": "SentGuestMessage", "getUserChatBoosts": "UserChatBoosts", "getBusinessConnection": "BusinessConnection", "getManagedBotToken": "String", "replaceManagedBotToken": "String", + "getManagedBotAccessSettings": "BotAccessSettings", + "setManagedBotAccessSettings": "Boolean", "setMyCommands": "Boolean", "deleteMyCommands": "Boolean", "getMyCommands": "Array", @@ -139,6 +144,8 @@ "declineSuggestedPost": "Boolean", "deleteMessage": "Boolean", "deleteMessages": "Boolean", + "deleteMessageReaction": "Boolean", + "deleteAllMessageReactions": "Boolean", "sendSticker": "Message", "getStickerSet": "StickerSet", "getCustomEmojiStickers": "Array", diff --git a/data/types.json b/data/types.json index 34278b0..e05288b 100644 --- a/data/types.json +++ b/data/types.json @@ -28,6 +28,9 @@ "deleted_business_messages": { "type": "BusinessMessagesDeleted" }, + "guest_message": { + "type": "Message" + }, "message_reaction": { "type": "MessageReactionUpdated" }, @@ -146,6 +149,9 @@ "can_read_all_group_messages": { "type": "boolean" }, + "supports_guest_queries": { + "type": "boolean" + }, "supports_inline_queries": { "type": "boolean" }, @@ -399,6 +405,9 @@ "type": "integer", "required": true }, + "guest_query_id": { + "type": "string" + }, "business_connection_id": { "type": "string" }, @@ -438,6 +447,12 @@ "via_bot": { "type": "User" }, + "guest_bot_caller_user": { + "type": "User" + }, + "guest_bot_caller_chat": { + "type": "Chat" + }, "edit_date": { "type": "integer" }, @@ -487,6 +502,9 @@ "document": { "type": "Document" }, + "live_photo": { + "type": "LivePhoto" + }, "paid_media": { "type": "PaidMediaInfo" }, @@ -819,6 +837,9 @@ "document": { "type": "Document" }, + "live_photo": { + "type": "LivePhoto" + }, "paid_media": { "type": "PaidMediaInfo" }, @@ -1102,6 +1123,38 @@ "type": "integer" } }, + "LivePhoto": { + "photo": { + "type": "array", + "items": "PhotoSize" + }, + "file_id": { + "type": "string", + "required": true + }, + "file_unique_id": { + "type": "string", + "required": true + }, + "width": { + "type": "integer", + "required": true + }, + "height": { + "type": "integer", + "required": true + }, + "duration": { + "type": "integer", + "required": true + }, + "mime_type": { + "type": "string" + }, + "file_size": { + "type": "integer" + } + }, "Story": { "chat": { "type": "Chat", @@ -1239,26 +1292,22 @@ }, "PaidMedia": { "type": [ - "PaidMediaPreview", + "PaidMediaLivePhoto", "PaidMediaPhoto", + "PaidMediaPreview", "PaidMediaVideo" ] }, - "PaidMediaPreview": { + "PaidMediaLivePhoto": { "type": { "type": "string", "required": true, - "required_value": "preview", - "default": "preview" - }, - "width": { - "type": "integer" + "required_value": "live_photo", + "default": "live_photo" }, - "height": { - "type": "integer" - }, - "duration": { - "type": "integer" + "live_photo": { + "type": "LivePhoto", + "required": true } }, "PaidMediaPhoto": { @@ -1274,6 +1323,23 @@ "required": true } }, + "PaidMediaPreview": { + "type": { + "type": "string", + "required": true, + "required_value": "preview", + "default": "preview" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "duration": { + "type": "integer" + } + }, "PaidMediaVideo": { "type": { "type": "string", @@ -1315,6 +1381,59 @@ "required": true } }, + "PollMedia": { + "animation": { + "type": "Animation" + }, + "audio": { + "type": "Audio" + }, + "document": { + "type": "Document" + }, + "live_photo": { + "type": "LivePhoto" + }, + "location": { + "type": "Location" + }, + "photo": { + "type": "array", + "items": "PhotoSize" + }, + "sticker": { + "type": "Sticker" + }, + "venue": { + "type": "Venue" + }, + "video": { + "type": "Video" + } + }, + "InputPollMedia": { + "type": [ + "InputMediaAnimation", + "InputMediaAudio", + "InputMediaDocument", + "InputMediaLivePhoto", + "InputMediaLocation", + "InputMediaPhoto", + "InputMediaVenue", + "InputMediaVideo" + ] + }, + "InputPollOptionMedia": { + "type": [ + "InputMediaAnimation", + "InputMediaLivePhoto", + "InputMediaLocation", + "InputMediaPhoto", + "InputMediaSticker", + "InputMediaVenue", + "InputMediaVideo" + ] + }, "PollOption": { "persistent_id": { "type": "string", @@ -1330,6 +1449,9 @@ "type": "array", "items": "MessageEntity" }, + "media": { + "type": "PollMedia" + }, "voter_count": { "type": "integer", "required": true @@ -1357,6 +1479,9 @@ "text_entities": { "type": "array", "items": "MessageEntity" + }, + "media": { + "type": "InputPollOptionMedia" } }, "PollAnswer": { @@ -1425,6 +1550,14 @@ "type": "boolean", "required": true }, + "members_only": { + "type": "boolean", + "required": true + }, + "country_codes": { + "type": "array", + "items": "string" + }, "correct_option_ids": { "type": "array", "items": "integer" @@ -1437,6 +1570,9 @@ "type": "array", "items": "MessageEntity" }, + "explanation_media": { + "type": "PollMedia" + }, "open_period": { "type": "integer" }, @@ -1449,6 +1585,9 @@ "description_entities": { "type": "array", "items": "MessageEntity" + }, + "media": { + "type": "PollMedia" } }, "ChecklistTask": { @@ -2856,6 +2995,10 @@ "type": "boolean", "required": true }, + "can_react_to_messages": { + "type": "boolean", + "required": true + }, "can_edit_tag": { "type": "boolean", "required": true @@ -2964,6 +3107,9 @@ "can_add_web_page_previews": { "type": "boolean" }, + "can_react_to_messages": { + "type": "boolean" + }, "can_edit_tag": { "type": "boolean" }, @@ -3705,6 +3851,16 @@ "type": "string" } }, + "BotAccessSettings": { + "is_access_restricted": { + "type": "boolean", + "required": true + }, + "added_users": { + "type": "array", + "items": "User" + } + }, "AcceptedGiftTypes": { "unlimited_gifts": { "type": "boolean", @@ -4119,6 +4275,12 @@ "type": "string" } }, + "SentGuestMessage": { + "inline_message_id": { + "type": "string", + "required": true + } + }, "PreparedInlineMessage": { "id": { "type": "string", @@ -4146,23 +4308,27 @@ "InputMedia": { "type": [ "InputMediaAnimation", - "InputMediaDocument", "InputMediaAudio", + "InputMediaDocument", + "InputMediaLivePhoto", "InputMediaPhoto", "InputMediaVideo" ] }, - "InputMediaPhoto": { + "InputMediaAnimation": { "type": { "type": "string", "required": true, - "required_value": "photo", - "default": "photo" + "required_value": "animation", + "default": "animation" }, "media": { "type": "string", "required": true }, + "thumbnail": { + "type": "string" + }, "caption": { "type": "string", "max_size": 1024 @@ -4177,16 +4343,25 @@ "show_caption_above_media": { "type": "boolean" }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "duration": { + "type": "integer" + }, "has_spoiler": { "type": "boolean" } }, - "InputMediaVideo": { + "InputMediaAudio": { "type": { "type": "string", "required": true, - "required_value": "video", - "default": "video" + "required_value": "audio", + "default": "audio" }, "media": { "type": "string", @@ -4195,12 +4370,6 @@ "thumbnail": { "type": "string" }, - "cover": { - "type": "string" - }, - "start_timestamp": { - "type": "integer" - }, "caption": { "type": "string", "max_size": 1024 @@ -4212,31 +4381,22 @@ "type": "array", "items": "MessageEntity" }, - "show_caption_above_media": { - "type": "boolean" - }, - "width": { - "type": "integer" - }, - "height": { - "type": "integer" - }, "duration": { "type": "integer" }, - "supports_streaming": { - "type": "boolean" + "performer": { + "type": "string" }, - "has_spoiler": { - "type": "boolean" + "title": { + "type": "string" } }, - "InputMediaAnimation": { + "InputMediaDocument": { "type": { "type": "string", "required": true, - "required_value": "animation", - "default": "animation" + "required_value": "document", + "default": "document" }, "media": { "type": "string", @@ -4256,36 +4416,73 @@ "type": "array", "items": "MessageEntity" }, - "show_caption_above_media": { + "disable_content_type_detection": { "type": "boolean" + } + }, + "InputMediaLivePhoto": { + "type": { + "type": "string", + "required": true, + "required_value": "live_photo", + "default": "live_photo" }, - "width": { - "type": "integer" + "media": { + "type": "string", + "required": true }, - "height": { - "type": "integer" + "photo": { + "type": "string", + "required": true }, - "duration": { - "type": "integer" + "caption": { + "type": "string", + "max_size": 1024 + }, + "parse_mode": { + "type": "string" + }, + "caption_entities": { + "type": "array", + "items": "MessageEntity" + }, + "show_caption_above_media": { + "type": "boolean" }, "has_spoiler": { "type": "boolean" } }, - "InputMediaAudio": { + "InputMediaLocation": { "type": { "type": "string", "required": true, - "required_value": "audio", - "default": "audio" + "required_value": "location", + "default": "location" + }, + "latitude": { + "type": "number", + "required": true + }, + "longitude": { + "type": "number", + "required": true + }, + "horizontal_accuracy": { + "type": "number" + } + }, + "InputMediaPhoto": { + "type": { + "type": "string", + "required": true, + "required_value": "photo", + "default": "photo" }, "media": { "type": "string", "required": true }, - "thumbnail": { - "type": "string" - }, "caption": { "type": "string", "max_size": 1024 @@ -4297,22 +4494,70 @@ "type": "array", "items": "MessageEntity" }, - "duration": { - "type": "integer" + "show_caption_above_media": { + "type": "boolean" }, - "performer": { + "has_spoiler": { + "type": "boolean" + } + }, + "InputMediaSticker": { + "type": { + "type": "string", + "required": true, + "required_value": "sticker", + "default": "sticker" + }, + "media": { + "type": "string", + "required": true + }, + "emoji": { "type": "string" + } + }, + "InputMediaVenue": { + "type": { + "type": "string", + "required": true, + "required_value": "venue", + "default": "venue" + }, + "latitude": { + "type": "number", + "required": true + }, + "longitude": { + "type": "number", + "required": true }, "title": { + "type": "string", + "required": true + }, + "address": { + "type": "string", + "required": true + }, + "foursquare_id": { + "type": "string" + }, + "foursquare_type": { + "type": "string" + }, + "google_place_id": { + "type": "string" + }, + "google_place_type": { "type": "string" } }, - "InputMediaDocument": { + "InputMediaVideo": { "type": { "type": "string", "required": true, - "required_value": "document", - "default": "document" + "required_value": "video", + "default": "video" }, "media": { "type": "string", @@ -4321,6 +4566,12 @@ "thumbnail": { "type": "string" }, + "cover": { + "type": "string" + }, + "start_timestamp": { + "type": "integer" + }, "caption": { "type": "string", "max_size": 1024 @@ -4332,17 +4583,49 @@ "type": "array", "items": "MessageEntity" }, - "disable_content_type_detection": { + "show_caption_above_media": { + "type": "boolean" + }, + "width": { + "type": "integer" + }, + "height": { + "type": "integer" + }, + "duration": { + "type": "integer" + }, + "supports_streaming": { + "type": "boolean" + }, + "has_spoiler": { "type": "boolean" } }, "InputFile": {}, "InputPaidMedia": { "type": [ + "InputPaidMediaLivePhoto", "InputPaidMediaPhoto", "InputPaidMediaVideo" ] }, + "InputPaidMediaLivePhoto": { + "type": { + "type": "string", + "required": true, + "required_value": "live_photo", + "default": "live_photo" + }, + "media": { + "type": "string", + "required": true + }, + "photo": { + "type": "string", + "required": true + } + }, "InputPaidMediaPhoto": { "type": { "type": "string", @@ -5066,7 +5349,9 @@ "type": "number" }, "live_period": { - "type": "integer" + "type": "integer", + "min_size": 60, + "max_size": 86400 }, "heading": { "type": "integer" @@ -5540,7 +5825,9 @@ "type": "number" }, "live_period": { - "type": "integer" + "type": "integer", + "min_size": 60, + "max_size": 86400 }, "heading": { "type": "integer" diff --git a/lib/telegram/bot/api/endpoints.rb b/lib/telegram/bot/api/endpoints.rb index aba38d6..a12e351 100644 --- a/lib/telegram/bot/api/endpoints.rb +++ b/lib/telegram/bot/api/endpoints.rb @@ -17,6 +17,7 @@ class Api 'copyMessage' => Types::MessageId, 'copyMessages' => Types::Array.of(Types::MessageId), 'sendPhoto' => Types::Message, + 'sendLivePhoto' => Types::Message, 'sendAudio' => Types::Message, 'sendDocument' => Types::Message, 'sendVideo' => Types::Message, @@ -67,6 +68,7 @@ class Api 'getChatAdministrators' => Types::Array.of(Types::ChatMember), 'getChatMemberCount' => Types::Integer, 'getChatMember' => Types::ChatMember, + 'getUserPersonalChatMessages' => Types::Array.of(Types::Message), 'setChatStickerSet' => Types::Bool, 'deleteChatStickerSet' => Types::Bool, 'getForumTopicIconStickers' => Types::Array.of(Types::Sticker), @@ -83,10 +85,13 @@ class Api 'unhideGeneralForumTopic' => Types::Bool, 'unpinAllGeneralForumTopicMessages' => Types::Bool, 'answerCallbackQuery' => Types::Bool, + 'answerGuestQuery' => Types::SentGuestMessage, 'getUserChatBoosts' => Types::UserChatBoosts, 'getBusinessConnection' => Types::BusinessConnection, 'getManagedBotToken' => Types::String, 'replaceManagedBotToken' => Types::String, + 'getManagedBotAccessSettings' => Types::BotAccessSettings, + 'setManagedBotAccessSettings' => Types::Bool, 'setMyCommands' => Types::Bool, 'deleteMyCommands' => Types::Bool, 'getMyCommands' => Types::Array.of(Types::BotCommand), @@ -144,6 +149,8 @@ class Api 'declineSuggestedPost' => Types::Bool, 'deleteMessage' => Types::Bool, 'deleteMessages' => Types::Bool, + 'deleteMessageReaction' => Types::Bool, + 'deleteAllMessageReactions' => Types::Bool, 'sendSticker' => Types::Message, 'getStickerSet' => Types::StickerSet, 'getCustomEmojiStickers' => Types::Array.of(Types::Sticker), diff --git a/lib/telegram/bot/types/bot_access_settings.rb b/lib/telegram/bot/types/bot_access_settings.rb new file mode 100644 index 0000000..7ec61e2 --- /dev/null +++ b/lib/telegram/bot/types/bot_access_settings.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class BotAccessSettings < Base + attribute :is_access_restricted, Types::Bool + attribute? :added_users, Types::Array.of(User) + end + end + end +end diff --git a/lib/telegram/bot/types/chat_member_restricted.rb b/lib/telegram/bot/types/chat_member_restricted.rb index a7f3196..417be05 100644 --- a/lib/telegram/bot/types/chat_member_restricted.rb +++ b/lib/telegram/bot/types/chat_member_restricted.rb @@ -18,6 +18,7 @@ class ChatMemberRestricted < Base attribute :can_send_polls, Types::Bool attribute :can_send_other_messages, Types::Bool attribute :can_add_web_page_previews, Types::Bool + attribute :can_react_to_messages, Types::Bool attribute :can_edit_tag, Types::Bool attribute :can_change_info, Types::Bool attribute :can_invite_users, Types::Bool diff --git a/lib/telegram/bot/types/chat_permissions.rb b/lib/telegram/bot/types/chat_permissions.rb index 43eb185..c948e44 100644 --- a/lib/telegram/bot/types/chat_permissions.rb +++ b/lib/telegram/bot/types/chat_permissions.rb @@ -14,6 +14,7 @@ class ChatPermissions < Base attribute? :can_send_polls, Types::Bool attribute? :can_send_other_messages, Types::Bool attribute? :can_add_web_page_previews, Types::Bool + attribute? :can_react_to_messages, Types::Bool attribute? :can_edit_tag, Types::Bool attribute? :can_change_info, Types::Bool attribute? :can_invite_users, Types::Bool diff --git a/lib/telegram/bot/types/external_reply_info.rb b/lib/telegram/bot/types/external_reply_info.rb index 096f4b6..de6aeda 100644 --- a/lib/telegram/bot/types/external_reply_info.rb +++ b/lib/telegram/bot/types/external_reply_info.rb @@ -11,6 +11,7 @@ class ExternalReplyInfo < Base attribute? :animation, Animation attribute? :audio, Audio attribute? :document, Document + attribute? :live_photo, LivePhoto attribute? :paid_media, PaidMediaInfo attribute? :photo, Types::Array.of(PhotoSize) attribute? :sticker, Sticker diff --git a/lib/telegram/bot/types/inline_query_result_location.rb b/lib/telegram/bot/types/inline_query_result_location.rb index 72d6de1..59677b7 100644 --- a/lib/telegram/bot/types/inline_query_result_location.rb +++ b/lib/telegram/bot/types/inline_query_result_location.rb @@ -10,7 +10,7 @@ class InlineQueryResultLocation < Base attribute :longitude, Types::Float attribute :title, Types::String attribute? :horizontal_accuracy, Types::Float - attribute? :live_period, Types::Integer + attribute? :live_period, Types::Integer.constrained(min_size: 60, max_size: 86_400) attribute? :heading, Types::Integer attribute? :proximity_alert_radius, Types::Integer attribute? :reply_markup, InlineKeyboardMarkup diff --git a/lib/telegram/bot/types/input_location_message_content.rb b/lib/telegram/bot/types/input_location_message_content.rb index 653be3e..23d21b8 100644 --- a/lib/telegram/bot/types/input_location_message_content.rb +++ b/lib/telegram/bot/types/input_location_message_content.rb @@ -7,7 +7,7 @@ class InputLocationMessageContent < Base attribute :latitude, Types::Float attribute :longitude, Types::Float attribute? :horizontal_accuracy, Types::Float - attribute? :live_period, Types::Integer + attribute? :live_period, Types::Integer.constrained(min_size: 60, max_size: 86_400) attribute? :heading, Types::Integer attribute? :proximity_alert_radius, Types::Integer end diff --git a/lib/telegram/bot/types/input_media.rb b/lib/telegram/bot/types/input_media.rb index a654d90..0ba7a1f 100644 --- a/lib/telegram/bot/types/input_media.rb +++ b/lib/telegram/bot/types/input_media.rb @@ -7,8 +7,9 @@ module Types # rubocop:disable Naming/ConstantName InputMedia = ( InputMediaAnimation | - InputMediaDocument | InputMediaAudio | + InputMediaDocument | + InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo ) diff --git a/lib/telegram/bot/types/input_media_live_photo.rb b/lib/telegram/bot/types/input_media_live_photo.rb new file mode 100644 index 0000000..9a14864 --- /dev/null +++ b/lib/telegram/bot/types/input_media_live_photo.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class InputMediaLivePhoto < Base + attribute :type, Types::String.constrained(eql: 'live_photo').default('live_photo') + attribute :media, Types::String + attribute :photo, Types::String + attribute? :caption, Types::String + attribute? :parse_mode, Types::String + attribute? :caption_entities, Types::Array.of(MessageEntity) + attribute? :show_caption_above_media, Types::Bool + attribute? :has_spoiler, Types::Bool + end + end + end +end diff --git a/lib/telegram/bot/types/input_media_location.rb b/lib/telegram/bot/types/input_media_location.rb new file mode 100644 index 0000000..bf6349f --- /dev/null +++ b/lib/telegram/bot/types/input_media_location.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class InputMediaLocation < Base + attribute :type, Types::String.constrained(eql: 'location').default('location') + attribute :latitude, Types::Float + attribute :longitude, Types::Float + attribute? :horizontal_accuracy, Types::Float + end + end + end +end diff --git a/lib/telegram/bot/types/input_media_sticker.rb b/lib/telegram/bot/types/input_media_sticker.rb new file mode 100644 index 0000000..582ac66 --- /dev/null +++ b/lib/telegram/bot/types/input_media_sticker.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class InputMediaSticker < Base + attribute :type, Types::String.constrained(eql: 'sticker').default('sticker') + attribute :media, Types::String + attribute? :emoji, Types::String + end + end + end +end diff --git a/lib/telegram/bot/types/input_media_venue.rb b/lib/telegram/bot/types/input_media_venue.rb new file mode 100644 index 0000000..1f38a02 --- /dev/null +++ b/lib/telegram/bot/types/input_media_venue.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class InputMediaVenue < Base + attribute :type, Types::String.constrained(eql: 'venue').default('venue') + attribute :latitude, Types::Float + attribute :longitude, Types::Float + attribute :title, Types::String + attribute :address, Types::String + attribute? :foursquare_id, Types::String + attribute? :foursquare_type, Types::String + attribute? :google_place_id, Types::String + attribute? :google_place_type, Types::String + end + end + end +end diff --git a/lib/telegram/bot/types/input_paid_media.rb b/lib/telegram/bot/types/input_paid_media.rb index 703457d..ede051b 100644 --- a/lib/telegram/bot/types/input_paid_media.rb +++ b/lib/telegram/bot/types/input_paid_media.rb @@ -6,6 +6,7 @@ module Types ## Just for classes consistency # rubocop:disable Naming/ConstantName InputPaidMedia = ( + InputPaidMediaLivePhoto | InputPaidMediaPhoto | InputPaidMediaVideo ) diff --git a/lib/telegram/bot/types/input_paid_media_live_photo.rb b/lib/telegram/bot/types/input_paid_media_live_photo.rb new file mode 100644 index 0000000..1e61f13 --- /dev/null +++ b/lib/telegram/bot/types/input_paid_media_live_photo.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class InputPaidMediaLivePhoto < Base + attribute :type, Types::String.constrained(eql: 'live_photo').default('live_photo') + attribute :media, Types::String + attribute :photo, Types::String + end + end + end +end diff --git a/lib/telegram/bot/types/input_poll_media.rb b/lib/telegram/bot/types/input_poll_media.rb new file mode 100644 index 0000000..d6e3da9 --- /dev/null +++ b/lib/telegram/bot/types/input_poll_media.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + ## Just for classes consistency + # rubocop:disable Naming/ConstantName + InputPollMedia = ( + InputMediaAnimation | + InputMediaAudio | + InputMediaDocument | + InputMediaLivePhoto | + InputMediaLocation | + InputMediaPhoto | + InputMediaVenue | + InputMediaVideo + ) + # rubocop:enable Naming/ConstantName + end + end +end diff --git a/lib/telegram/bot/types/input_poll_option.rb b/lib/telegram/bot/types/input_poll_option.rb index 8418232..db1b12f 100644 --- a/lib/telegram/bot/types/input_poll_option.rb +++ b/lib/telegram/bot/types/input_poll_option.rb @@ -7,6 +7,7 @@ class InputPollOption < Base attribute :text, Types::String.constrained(min_size: 1, max_size: 100) attribute? :text_parse_mode, Types::String attribute? :text_entities, Types::Array.of(MessageEntity) + attribute? :media, InputPollOptionMedia end end end diff --git a/lib/telegram/bot/types/input_poll_option_media.rb b/lib/telegram/bot/types/input_poll_option_media.rb new file mode 100644 index 0000000..7d992a3 --- /dev/null +++ b/lib/telegram/bot/types/input_poll_option_media.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + ## Just for classes consistency + # rubocop:disable Naming/ConstantName + InputPollOptionMedia = ( + InputMediaAnimation | + InputMediaLivePhoto | + InputMediaLocation | + InputMediaPhoto | + InputMediaSticker | + InputMediaVenue | + InputMediaVideo + ) + # rubocop:enable Naming/ConstantName + end + end +end diff --git a/lib/telegram/bot/types/live_photo.rb b/lib/telegram/bot/types/live_photo.rb new file mode 100644 index 0000000..eebc7e2 --- /dev/null +++ b/lib/telegram/bot/types/live_photo.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class LivePhoto < Base + attribute? :photo, Types::Array.of(PhotoSize) + attribute :file_id, Types::String + attribute :file_unique_id, Types::String + attribute :width, Types::Integer + attribute :height, Types::Integer + attribute :duration, Types::Integer + attribute? :mime_type, Types::String + attribute? :file_size, Types::Integer + end + end + end +end diff --git a/lib/telegram/bot/types/message.rb b/lib/telegram/bot/types/message.rb index df42478..7e0c9ec 100644 --- a/lib/telegram/bot/types/message.rb +++ b/lib/telegram/bot/types/message.rb @@ -13,6 +13,7 @@ class Message < Base attribute? :sender_business_bot, User attribute? :sender_tag, Types::String attribute :date, Types::Integer + attribute? :guest_query_id, Types::String attribute? :business_connection_id, Types::String attribute :chat, Chat attribute? :forward_origin, MessageOrigin @@ -25,6 +26,8 @@ class Message < Base attribute? :reply_to_checklist_task_id, Types::Integer attribute? :reply_to_poll_option_id, Types::String attribute? :via_bot, User + attribute? :guest_bot_caller_user, User + attribute? :guest_bot_caller_chat, Chat attribute? :edit_date, Types::Integer attribute? :has_protected_content, Types::True attribute? :is_from_offline, Types::True @@ -40,6 +43,7 @@ class Message < Base attribute? :animation, Animation attribute? :audio, Audio attribute? :document, Document + attribute? :live_photo, LivePhoto attribute? :paid_media, PaidMediaInfo attribute? :photo, Types::Array.of(PhotoSize) attribute? :sticker, Sticker diff --git a/lib/telegram/bot/types/paid_media.rb b/lib/telegram/bot/types/paid_media.rb index eea7374..a8a9671 100644 --- a/lib/telegram/bot/types/paid_media.rb +++ b/lib/telegram/bot/types/paid_media.rb @@ -6,8 +6,9 @@ module Types ## Just for classes consistency # rubocop:disable Naming/ConstantName PaidMedia = ( - PaidMediaPreview | + PaidMediaLivePhoto | PaidMediaPhoto | + PaidMediaPreview | PaidMediaVideo ) # rubocop:enable Naming/ConstantName diff --git a/lib/telegram/bot/types/paid_media_live_photo.rb b/lib/telegram/bot/types/paid_media_live_photo.rb new file mode 100644 index 0000000..92f0907 --- /dev/null +++ b/lib/telegram/bot/types/paid_media_live_photo.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class PaidMediaLivePhoto < Base + attribute :type, Types::String.constrained(eql: 'live_photo').default('live_photo') + attribute :live_photo, LivePhoto + end + end + end +end diff --git a/lib/telegram/bot/types/poll.rb b/lib/telegram/bot/types/poll.rb index 58d56cb..fb3ba72 100644 --- a/lib/telegram/bot/types/poll.rb +++ b/lib/telegram/bot/types/poll.rb @@ -14,13 +14,17 @@ class Poll < Base attribute :type, Types::String attribute :allows_multiple_answers, Types::Bool attribute :allows_revoting, Types::Bool + attribute :members_only, Types::Bool + attribute? :country_codes, Types::Array.of(Types::String) attribute? :correct_option_ids, Types::Array.of(Types::Integer) attribute? :explanation, Types::String attribute? :explanation_entities, Types::Array.of(MessageEntity) + attribute? :explanation_media, PollMedia attribute? :open_period, Types::Integer attribute? :close_date, Types::Integer attribute? :description, Types::String attribute? :description_entities, Types::Array.of(MessageEntity) + attribute? :media, PollMedia end end end diff --git a/lib/telegram/bot/types/poll_media.rb b/lib/telegram/bot/types/poll_media.rb new file mode 100644 index 0000000..04cec34 --- /dev/null +++ b/lib/telegram/bot/types/poll_media.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class PollMedia < Base + attribute? :animation, Animation + attribute? :audio, Audio + attribute? :document, Document + attribute? :live_photo, LivePhoto + attribute? :location, Location + attribute? :photo, Types::Array.of(PhotoSize) + attribute? :sticker, Sticker + attribute? :venue, Venue + attribute? :video, Video + end + end + end +end diff --git a/lib/telegram/bot/types/poll_option.rb b/lib/telegram/bot/types/poll_option.rb index ef882c3..86c2b87 100644 --- a/lib/telegram/bot/types/poll_option.rb +++ b/lib/telegram/bot/types/poll_option.rb @@ -7,6 +7,7 @@ class PollOption < Base attribute :persistent_id, Types::String attribute :text, Types::String.constrained(min_size: 1, max_size: 100) attribute? :text_entities, Types::Array.of(MessageEntity) + attribute? :media, PollMedia attribute :voter_count, Types::Integer attribute? :added_by_user, User attribute? :added_by_chat, Chat diff --git a/lib/telegram/bot/types/sent_guest_message.rb b/lib/telegram/bot/types/sent_guest_message.rb new file mode 100644 index 0000000..427425b --- /dev/null +++ b/lib/telegram/bot/types/sent_guest_message.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +module Telegram + module Bot + module Types + class SentGuestMessage < Base + attribute :inline_message_id, Types::String + end + end + end +end diff --git a/lib/telegram/bot/types/update.rb b/lib/telegram/bot/types/update.rb index 0f32edc..273a4c2 100644 --- a/lib/telegram/bot/types/update.rb +++ b/lib/telegram/bot/types/update.rb @@ -13,6 +13,7 @@ class Update < Base attribute? :business_message, Message attribute? :edited_business_message, Message attribute? :deleted_business_messages, BusinessMessagesDeleted + attribute? :guest_message, Message attribute? :message_reaction, MessageReactionUpdated attribute? :message_reaction_count, MessageReactionCountUpdated attribute? :inline_query, InlineQuery diff --git a/lib/telegram/bot/types/user.rb b/lib/telegram/bot/types/user.rb index 6549e8d..bed0fdb 100644 --- a/lib/telegram/bot/types/user.rb +++ b/lib/telegram/bot/types/user.rb @@ -14,6 +14,7 @@ class User < Base attribute? :added_to_attachment_menu, Types::True attribute? :can_join_groups, Types::Bool attribute? :can_read_all_group_messages, Types::Bool + attribute? :supports_guest_queries, Types::Bool attribute? :supports_inline_queries, Types::Bool attribute? :can_connect_to_business, Types::Bool attribute? :has_main_web_app, Types::Bool