telegram-bot-ruby 1.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +10 -0
- data/.github/workflows/ci.yml +0 -3
- data/.github/workflows/stale.yml +19 -0
- data/.gitignore +1 -0
- data/.rspec +1 -0
- data/.rubocop.yml +12 -7
- data/CHANGELOG.md +16 -0
- data/Gemfile +11 -3
- data/LICENSE +0 -1
- data/README.md +64 -20
- data/Rakefile +0 -43
- data/bin/console +4 -1
- data/lib/telegram/bot/api/endpoints.rb +124 -0
- data/lib/telegram/bot/api.rb +20 -44
- data/lib/telegram/bot/client.rb +9 -10
- data/lib/telegram/bot/exceptions/response_error.rb +2 -8
- data/lib/telegram/bot/types/animation.rb +1 -1
- data/lib/telegram/bot/types/audio.rb +1 -1
- data/lib/telegram/bot/types/background_fill.rb +16 -0
- data/lib/telegram/bot/types/background_fill_freeform_gradient.rb +12 -0
- data/lib/telegram/bot/types/background_fill_gradient.rb +14 -0
- data/lib/telegram/bot/types/background_fill_solid.rb +12 -0
- data/lib/telegram/bot/types/background_type.rb +17 -0
- data/lib/telegram/bot/types/background_type_chat_theme.rb +12 -0
- data/lib/telegram/bot/types/background_type_fill.rb +13 -0
- data/lib/telegram/bot/types/background_type_pattern.rb +16 -0
- data/lib/telegram/bot/types/background_type_wallpaper.rb +15 -0
- data/lib/telegram/bot/types/birthdate.rb +13 -0
- data/lib/telegram/bot/types/bot_command.rb +2 -2
- data/lib/telegram/bot/types/bot_command_scope.rb +20 -0
- data/lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb +1 -1
- data/lib/telegram/bot/types/bot_command_scope_all_group_chats.rb +1 -1
- data/lib/telegram/bot/types/bot_command_scope_all_private_chats.rb +1 -1
- data/lib/telegram/bot/types/bot_command_scope_chat.rb +2 -2
- data/lib/telegram/bot/types/bot_command_scope_chat_administrators.rb +2 -2
- data/lib/telegram/bot/types/bot_command_scope_chat_member.rb +2 -2
- data/lib/telegram/bot/types/bot_command_scope_default.rb +1 -1
- data/lib/telegram/bot/types/bot_description.rb +11 -0
- data/lib/telegram/bot/types/bot_name.rb +11 -0
- data/lib/telegram/bot/types/bot_short_description.rb +11 -0
- data/lib/telegram/bot/types/business_connection.rb +16 -0
- data/lib/telegram/bot/types/business_intro.rb +13 -0
- data/lib/telegram/bot/types/business_location.rb +12 -0
- data/lib/telegram/bot/types/business_messages_deleted.rb +13 -0
- data/lib/telegram/bot/types/business_opening_hours.rb +12 -0
- data/lib/telegram/bot/types/business_opening_hours_interval.rb +12 -0
- data/lib/telegram/bot/types/callback_query.rb +1 -1
- data/lib/telegram/bot/types/chat.rb +1 -22
- data/lib/telegram/bot/types/chat_administrator_rights.rb +3 -0
- data/lib/telegram/bot/types/chat_background.rb +11 -0
- data/lib/telegram/bot/types/chat_boost.rb +14 -0
- data/lib/telegram/bot/types/chat_boost_added.rb +11 -0
- data/lib/telegram/bot/types/chat_boost_removed.rb +14 -0
- data/lib/telegram/bot/types/chat_boost_source.rb +16 -0
- data/lib/telegram/bot/types/chat_boost_source_gift_code.rb +12 -0
- data/lib/telegram/bot/types/chat_boost_source_giveaway.rb +15 -0
- data/lib/telegram/bot/types/chat_boost_source_premium.rb +12 -0
- data/lib/telegram/bot/types/chat_boost_updated.rb +12 -0
- data/lib/telegram/bot/types/chat_full_info.rb +54 -0
- data/lib/telegram/bot/types/chat_invite_link.rb +2 -0
- data/lib/telegram/bot/types/chat_location.rb +1 -1
- data/lib/telegram/bot/types/chat_member.rb +11 -2
- data/lib/telegram/bot/types/chat_member_administrator.rb +8 -5
- data/lib/telegram/bot/types/chat_member_banned.rb +2 -2
- data/lib/telegram/bot/types/chat_member_left.rb +2 -2
- data/lib/telegram/bot/types/chat_member_member.rb +3 -2
- data/lib/telegram/bot/types/chat_member_owner.rb +2 -2
- data/lib/telegram/bot/types/chat_member_restricted.rb +2 -2
- data/lib/telegram/bot/types/chat_member_updated.rb +2 -0
- data/lib/telegram/bot/types/chat_shared.rb +3 -0
- data/lib/telegram/bot/types/compactable.rb +2 -7
- data/lib/telegram/bot/types/copy_text_button.rb +11 -0
- data/lib/telegram/bot/types/document.rb +1 -1
- data/lib/telegram/bot/types/error.rb +14 -0
- data/lib/telegram/bot/types/external_reply_info.rb +34 -0
- data/lib/telegram/bot/types/force_reply.rb +3 -3
- data/lib/telegram/bot/types/gift.rb +15 -0
- data/lib/telegram/bot/types/gifts.rb +11 -0
- data/lib/telegram/bot/types/giveaway.rb +19 -0
- data/lib/telegram/bot/types/giveaway_completed.rb +14 -0
- data/lib/telegram/bot/types/giveaway_created.rb +11 -0
- data/lib/telegram/bot/types/giveaway_winners.rb +22 -0
- data/lib/telegram/bot/types/inaccessible_message.rb +13 -0
- data/lib/telegram/bot/types/inline_keyboard_button.rb +2 -0
- data/lib/telegram/bot/types/inline_query_result.rb +33 -0
- data/lib/telegram/bot/types/inline_query_result_article.rb +4 -4
- data/lib/telegram/bot/types/inline_query_result_audio.rb +1 -1
- data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +1 -1
- data/lib/telegram/bot/types/inline_query_result_cached_document.rb +1 -1
- data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +2 -1
- data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +2 -1
- data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +2 -1
- data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +1 -1
- data/lib/telegram/bot/types/inline_query_result_cached_video.rb +2 -1
- data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +1 -1
- data/lib/telegram/bot/types/inline_query_result_contact.rb +4 -4
- data/lib/telegram/bot/types/inline_query_result_document.rb +4 -4
- data/lib/telegram/bot/types/inline_query_result_game.rb +1 -1
- data/lib/telegram/bot/types/inline_query_result_gif.rb +4 -3
- data/lib/telegram/bot/types/inline_query_result_location.rb +4 -4
- data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +4 -3
- data/lib/telegram/bot/types/inline_query_result_photo.rb +3 -2
- data/lib/telegram/bot/types/inline_query_result_venue.rb +4 -4
- data/lib/telegram/bot/types/inline_query_result_video.rb +3 -2
- data/lib/telegram/bot/types/inline_query_result_voice.rb +1 -1
- data/lib/telegram/bot/types/inline_query_results_button.rb +13 -0
- data/lib/telegram/bot/types/input_contact_message_content.rb +1 -1
- data/lib/telegram/bot/types/input_invoice_message_content.rb +5 -5
- data/lib/telegram/bot/types/input_location_message_content.rb +1 -1
- data/lib/telegram/bot/types/input_media.rb +18 -0
- data/lib/telegram/bot/types/input_media_animation.rb +3 -2
- data/lib/telegram/bot/types/input_media_audio.rb +2 -2
- data/lib/telegram/bot/types/input_media_document.rb +2 -2
- data/lib/telegram/bot/types/input_media_photo.rb +2 -1
- data/lib/telegram/bot/types/input_media_video.rb +3 -2
- data/lib/telegram/bot/types/input_message_content.rb +10 -2
- data/lib/telegram/bot/types/input_paid_media.rb +15 -0
- data/lib/telegram/bot/types/input_paid_media_photo.rb +12 -0
- data/lib/telegram/bot/types/input_paid_media_video.rb +17 -0
- data/lib/telegram/bot/types/input_poll_option.rb +13 -0
- data/lib/telegram/bot/types/input_sticker.rb +15 -0
- data/lib/telegram/bot/types/input_text_message_content.rb +3 -3
- data/lib/telegram/bot/types/input_venue_message_content.rb +1 -1
- data/lib/telegram/bot/types/keyboard_button.rb +1 -1
- data/lib/telegram/bot/types/keyboard_button_request_chat.rb +3 -0
- data/lib/telegram/bot/types/keyboard_button_request_users.rb +17 -0
- data/lib/telegram/bot/types/link_preview_options.rb +15 -0
- data/lib/telegram/bot/types/location.rb +1 -1
- data/lib/telegram/bot/types/maybe_inaccessible_message.rb +15 -0
- data/lib/telegram/bot/types/menu_button.rb +16 -0
- data/lib/telegram/bot/types/menu_button_commands.rb +1 -1
- data/lib/telegram/bot/types/menu_button_default.rb +1 -1
- data/lib/telegram/bot/types/menu_button_web_app.rb +1 -1
- data/lib/telegram/bot/types/message.rb +30 -16
- data/lib/telegram/bot/types/message_id.rb +11 -0
- data/lib/telegram/bot/types/message_origin.rb +17 -0
- data/lib/telegram/bot/types/message_origin_channel.rb +15 -0
- data/lib/telegram/bot/types/message_origin_chat.rb +14 -0
- data/lib/telegram/bot/types/message_origin_hidden_user.rb +13 -0
- data/lib/telegram/bot/types/message_origin_user.rb +13 -0
- data/lib/telegram/bot/types/message_reaction_count_updated.rb +14 -0
- data/lib/telegram/bot/types/message_reaction_updated.rb +17 -0
- data/lib/telegram/bot/types/paid_media.rb +16 -0
- data/lib/telegram/bot/types/paid_media_info.rb +12 -0
- data/lib/telegram/bot/types/paid_media_photo.rb +12 -0
- data/lib/telegram/bot/types/paid_media_preview.rb +14 -0
- data/lib/telegram/bot/types/paid_media_purchased.rb +12 -0
- data/lib/telegram/bot/types/paid_media_video.rb +12 -0
- data/lib/telegram/bot/types/passport_element_error.rb +22 -0
- data/lib/telegram/bot/types/passport_element_error_data_field.rb +1 -1
- data/lib/telegram/bot/types/passport_element_error_file.rb +1 -1
- data/lib/telegram/bot/types/passport_element_error_files.rb +2 -2
- data/lib/telegram/bot/types/passport_element_error_front_side.rb +1 -1
- data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +1 -1
- data/lib/telegram/bot/types/passport_element_error_selfie.rb +1 -1
- data/lib/telegram/bot/types/passport_element_error_translation_file.rb +1 -1
- data/lib/telegram/bot/types/passport_element_error_translation_files.rb +2 -2
- data/lib/telegram/bot/types/passport_element_error_unspecified.rb +1 -1
- data/lib/telegram/bot/types/poll.rb +2 -1
- data/lib/telegram/bot/types/poll_answer.rb +2 -1
- data/lib/telegram/bot/types/poll_option.rb +2 -1
- data/lib/telegram/bot/types/prepared_inline_message.rb +12 -0
- data/lib/telegram/bot/types/reaction_count.rb +12 -0
- data/lib/telegram/bot/types/reaction_type.rb +16 -0
- data/lib/telegram/bot/types/reaction_type_custom_emoji.rb +12 -0
- data/lib/telegram/bot/types/reaction_type_emoji.rb +12 -0
- data/lib/telegram/bot/types/reaction_type_paid.rb +11 -0
- data/lib/telegram/bot/types/refunded_payment.rb +15 -0
- data/lib/telegram/bot/types/reply_keyboard_markup.rb +2 -2
- data/lib/telegram/bot/types/reply_keyboard_remove.rb +2 -2
- data/lib/telegram/bot/types/reply_parameters.rb +17 -0
- data/lib/telegram/bot/types/response_parameters.rb +12 -0
- data/lib/telegram/bot/types/revenue_withdrawal_state.rb +16 -0
- data/lib/telegram/bot/types/revenue_withdrawal_state_failed.rb +11 -0
- data/lib/telegram/bot/types/revenue_withdrawal_state_pending.rb +11 -0
- data/lib/telegram/bot/types/revenue_withdrawal_state_succeeded.rb +13 -0
- data/lib/telegram/bot/types/shared_user.rb +15 -0
- data/lib/telegram/bot/types/star_transaction.rb +15 -0
- data/lib/telegram/bot/types/star_transactions.rb +11 -0
- data/lib/telegram/bot/types/sticker.rb +2 -1
- data/lib/telegram/bot/types/sticker_set.rb +1 -3
- data/lib/telegram/bot/types/story.rb +12 -0
- data/lib/telegram/bot/types/successful_payment.rb +3 -0
- data/lib/telegram/bot/types/switch_inline_query_chosen_chat.rb +15 -0
- data/lib/telegram/bot/types/text_quote.rb +14 -0
- data/lib/telegram/bot/types/transaction_partner.rb +18 -0
- data/lib/telegram/bot/types/transaction_partner_fragment.rb +12 -0
- data/lib/telegram/bot/types/transaction_partner_other.rb +11 -0
- data/lib/telegram/bot/types/transaction_partner_telegram_ads.rb +11 -0
- data/lib/telegram/bot/types/transaction_partner_telegram_api.rb +12 -0
- data/lib/telegram/bot/types/transaction_partner_user.rb +17 -0
- data/lib/telegram/bot/types/update.rb +9 -0
- data/lib/telegram/bot/types/user.rb +4 -2
- data/lib/telegram/bot/types/user_chat_boosts.rb +11 -0
- data/lib/telegram/bot/types/{user_shared.rb → users_shared.rb} +2 -2
- data/lib/telegram/bot/types/video.rb +1 -1
- data/lib/telegram/bot/types/video_note.rb +1 -1
- data/lib/telegram/bot/types/webhook_info.rb +1 -1
- data/lib/telegram/bot/types/write_access_allowed.rb +3 -0
- data/lib/telegram/bot/version.rb +1 -1
- data/lib/telegram/bot.rb +1 -0
- data/rakelib/parse_schema.rake +73 -0
- data/rakelib/rebuild_types.rake +90 -0
- data/telegram-bot-ruby.gemspec +1 -4
- data/utility/empty_type.erb +14 -0
- data/utility/type.erb +13 -0
- data/utility/type_attributes.json +5138 -0
- metadata +105 -5
- data/lib/telegram/bot/types/keyboard_button_request_user.rb +0 -13
@@ -4,18 +4,19 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultMpeg4Gif < Base
|
7
|
-
attribute :type, Types::String.default('mpeg4_gif')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'mpeg4_gif').default('mpeg4_gif')
|
8
8
|
attribute :id, Types::String
|
9
9
|
attribute :mpeg4_url, Types::String
|
10
10
|
attribute? :mpeg4_width, Types::Integer
|
11
11
|
attribute? :mpeg4_height, Types::Integer
|
12
12
|
attribute? :mpeg4_duration, Types::Integer
|
13
|
-
attribute :
|
14
|
-
attribute? :
|
13
|
+
attribute :thumbnail_url, Types::String
|
14
|
+
attribute? :thumbnail_mime_type, Types::String.default('image/jpeg')
|
15
15
|
attribute? :title, Types::String
|
16
16
|
attribute? :caption, Types::String
|
17
17
|
attribute? :parse_mode, Types::String
|
18
18
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
19
|
+
attribute? :show_caption_above_media, Types::Bool
|
19
20
|
attribute? :reply_markup, InlineKeyboardMarkup
|
20
21
|
attribute? :input_message_content, InputMessageContent
|
21
22
|
end
|
@@ -4,10 +4,10 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultPhoto < Base
|
7
|
-
attribute :type, Types::String.default('photo')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'photo').default('photo')
|
8
8
|
attribute :id, Types::String
|
9
9
|
attribute :photo_url, Types::String
|
10
|
-
attribute :
|
10
|
+
attribute :thumbnail_url, Types::String
|
11
11
|
attribute? :photo_width, Types::Integer
|
12
12
|
attribute? :photo_height, Types::Integer
|
13
13
|
attribute? :title, Types::String
|
@@ -15,6 +15,7 @@ module Telegram
|
|
15
15
|
attribute? :caption, Types::String
|
16
16
|
attribute? :parse_mode, Types::String
|
17
17
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
18
|
+
attribute? :show_caption_above_media, Types::Bool
|
18
19
|
attribute? :reply_markup, InlineKeyboardMarkup
|
19
20
|
attribute? :input_message_content, InputMessageContent
|
20
21
|
end
|
@@ -4,7 +4,7 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultVenue < Base
|
7
|
-
attribute :type, Types::String.default('venue')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'venue').default('venue')
|
8
8
|
attribute :id, Types::String
|
9
9
|
attribute :latitude, Types::Float
|
10
10
|
attribute :longitude, Types::Float
|
@@ -16,9 +16,9 @@ module Telegram
|
|
16
16
|
attribute? :google_place_type, Types::String
|
17
17
|
attribute? :reply_markup, InlineKeyboardMarkup
|
18
18
|
attribute? :input_message_content, InputMessageContent
|
19
|
-
attribute? :
|
20
|
-
attribute? :
|
21
|
-
attribute? :
|
19
|
+
attribute? :thumbnail_url, Types::String
|
20
|
+
attribute? :thumbnail_width, Types::Integer
|
21
|
+
attribute? :thumbnail_height, Types::Integer
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -4,15 +4,16 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultVideo < Base
|
7
|
-
attribute :type, Types::String.default('video')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'video').default('video')
|
8
8
|
attribute :id, Types::String
|
9
9
|
attribute :video_url, Types::String
|
10
10
|
attribute :mime_type, Types::String
|
11
|
-
attribute :
|
11
|
+
attribute :thumbnail_url, Types::String
|
12
12
|
attribute :title, Types::String
|
13
13
|
attribute? :caption, Types::String
|
14
14
|
attribute? :parse_mode, Types::String
|
15
15
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
16
|
+
attribute? :show_caption_above_media, Types::Bool
|
16
17
|
attribute? :video_width, Types::Integer
|
17
18
|
attribute? :video_height, Types::Integer
|
18
19
|
attribute? :video_duration, Types::Integer
|
@@ -4,7 +4,7 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InlineQueryResultVoice < Base
|
7
|
-
attribute :type, Types::String.default('voice')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'voice').default('voice')
|
8
8
|
attribute :id, Types::String
|
9
9
|
attribute :voice_url, Types::String
|
10
10
|
attribute :title, Types::String
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class InlineQueryResultsButton < Base
|
7
|
+
attribute :text, Types::String
|
8
|
+
attribute? :web_app, WebAppInfo
|
9
|
+
attribute? :start_parameter, Types::String.constrained(min_size: 1, max_size: 64)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -3,14 +3,14 @@
|
|
3
3
|
module Telegram
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
|
-
class InputInvoiceMessageContent <
|
7
|
-
attribute :title, Types::String
|
8
|
-
attribute :description, Types::String
|
6
|
+
class InputInvoiceMessageContent < Base
|
7
|
+
attribute :title, Types::String.constrained(min_size: 1, max_size: 32)
|
8
|
+
attribute :description, Types::String.constrained(min_size: 1, max_size: 255)
|
9
9
|
attribute :payload, Types::String
|
10
|
-
attribute :provider_token, Types::String
|
10
|
+
attribute? :provider_token, Types::String
|
11
11
|
attribute :currency, Types::String
|
12
12
|
attribute :prices, Types::Array.of(LabeledPrice)
|
13
|
-
attribute? :max_tip_amount, Types::Integer
|
13
|
+
attribute? :max_tip_amount, Types::Integer.default(0)
|
14
14
|
attribute? :suggested_tip_amounts, Types::Array.of(Types::Integer)
|
15
15
|
attribute? :provider_data, Types::String
|
16
16
|
attribute? :photo_url, Types::String
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
## Just for classes consistency
|
7
|
+
# rubocop:disable Naming/ConstantName
|
8
|
+
InputMedia = (
|
9
|
+
InputMediaAnimation |
|
10
|
+
InputMediaDocument |
|
11
|
+
InputMediaAudio |
|
12
|
+
InputMediaPhoto |
|
13
|
+
InputMediaVideo
|
14
|
+
)
|
15
|
+
# rubocop:enable Naming/ConstantName
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -4,12 +4,13 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InputMediaAnimation < Base
|
7
|
-
attribute :type, Types::String.default('animation')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'animation').default('animation')
|
8
8
|
attribute :media, Types::String
|
9
|
-
attribute? :
|
9
|
+
attribute? :thumbnail, Types::String
|
10
10
|
attribute? :caption, Types::String
|
11
11
|
attribute? :parse_mode, Types::String
|
12
12
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
13
|
+
attribute? :show_caption_above_media, Types::Bool
|
13
14
|
attribute? :width, Types::Integer
|
14
15
|
attribute? :height, Types::Integer
|
15
16
|
attribute? :duration, Types::Integer
|
@@ -4,9 +4,9 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InputMediaAudio < Base
|
7
|
-
attribute :type, Types::String.default('audio')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'audio').default('audio')
|
8
8
|
attribute :media, Types::String
|
9
|
-
attribute? :
|
9
|
+
attribute? :thumbnail, Types::String
|
10
10
|
attribute? :caption, Types::String
|
11
11
|
attribute? :parse_mode, Types::String
|
12
12
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
@@ -4,9 +4,9 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InputMediaDocument < Base
|
7
|
-
attribute :type, Types::String.default('document')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'document').default('document')
|
8
8
|
attribute :media, Types::String
|
9
|
-
attribute? :
|
9
|
+
attribute? :thumbnail, Types::String
|
10
10
|
attribute? :caption, Types::String
|
11
11
|
attribute? :parse_mode, Types::String
|
12
12
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
@@ -4,11 +4,12 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InputMediaPhoto < Base
|
7
|
-
attribute :type, Types::String.default('photo')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'photo').default('photo')
|
8
8
|
attribute :media, Types::String
|
9
9
|
attribute? :caption, Types::String
|
10
10
|
attribute? :parse_mode, Types::String
|
11
11
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
12
|
+
attribute? :show_caption_above_media, Types::Bool
|
12
13
|
attribute? :has_spoiler, Types::Bool
|
13
14
|
end
|
14
15
|
end
|
@@ -4,12 +4,13 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class InputMediaVideo < Base
|
7
|
-
attribute :type, Types::String.default('video')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'video').default('video')
|
8
8
|
attribute :media, Types::String
|
9
|
-
attribute? :
|
9
|
+
attribute? :thumbnail, Types::String
|
10
10
|
attribute? :caption, Types::String
|
11
11
|
attribute? :parse_mode, Types::String
|
12
12
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
13
|
+
attribute? :show_caption_above_media, Types::Bool
|
13
14
|
attribute? :width, Types::Integer
|
14
15
|
attribute? :height, Types::Integer
|
15
16
|
attribute? :duration, Types::Integer
|
@@ -3,8 +3,16 @@
|
|
3
3
|
module Telegram
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
|
-
|
7
|
-
|
6
|
+
## Just for classes consistency
|
7
|
+
# rubocop:disable Naming/ConstantName
|
8
|
+
InputMessageContent = (
|
9
|
+
InputTextMessageContent |
|
10
|
+
InputLocationMessageContent |
|
11
|
+
InputVenueMessageContent |
|
12
|
+
InputContactMessageContent |
|
13
|
+
InputInvoiceMessageContent
|
14
|
+
)
|
15
|
+
# rubocop:enable Naming/ConstantName
|
8
16
|
end
|
9
17
|
end
|
10
18
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
## Just for classes consistency
|
7
|
+
# rubocop:disable Naming/ConstantName
|
8
|
+
InputPaidMedia = (
|
9
|
+
InputPaidMediaPhoto |
|
10
|
+
InputPaidMediaVideo
|
11
|
+
)
|
12
|
+
# rubocop:enable Naming/ConstantName
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class InputPaidMediaVideo < Base
|
7
|
+
attribute :type, Types::String.constrained(eql: 'video').default('video')
|
8
|
+
attribute :media, Types::String
|
9
|
+
attribute? :thumbnail, Types::String
|
10
|
+
attribute? :width, Types::Integer
|
11
|
+
attribute? :height, Types::Integer
|
12
|
+
attribute? :duration, Types::Integer
|
13
|
+
attribute? :supports_streaming, Types::Bool
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class InputPollOption < Base
|
7
|
+
attribute :text, Types::String.constrained(min_size: 1, max_size: 100)
|
8
|
+
attribute? :text_parse_mode, Types::String
|
9
|
+
attribute? :text_entities, Types::Array.of(MessageEntity)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class InputSticker < Base
|
7
|
+
attribute :sticker, Types::String
|
8
|
+
attribute :format, Types::String
|
9
|
+
attribute :emoji_list, Types::Array.of(Types::String)
|
10
|
+
attribute? :mask_position, MaskPosition
|
11
|
+
attribute? :keywords, Types::Array.of(Types::String)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -3,11 +3,11 @@
|
|
3
3
|
module Telegram
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
|
-
class InputTextMessageContent <
|
7
|
-
attribute :message_text, Types::String
|
6
|
+
class InputTextMessageContent < Base
|
7
|
+
attribute :message_text, Types::String.constrained(min_size: 1, max_size: 4096)
|
8
8
|
attribute? :parse_mode, Types::String
|
9
9
|
attribute? :entities, Types::Array.of(MessageEntity)
|
10
|
-
attribute? :
|
10
|
+
attribute? :link_preview_options, LinkPreviewOptions
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -5,7 +5,7 @@ module Telegram
|
|
5
5
|
module Types
|
6
6
|
class KeyboardButton < Base
|
7
7
|
attribute :text, Types::String
|
8
|
-
attribute? :
|
8
|
+
attribute? :request_users, KeyboardButtonRequestUsers
|
9
9
|
attribute? :request_chat, KeyboardButtonRequestChat
|
10
10
|
attribute? :request_contact, Types::Bool
|
11
11
|
attribute? :request_location, Types::Bool
|
@@ -12,6 +12,9 @@ module Telegram
|
|
12
12
|
attribute? :user_administrator_rights, ChatAdministratorRights
|
13
13
|
attribute? :bot_administrator_rights, ChatAdministratorRights
|
14
14
|
attribute? :bot_is_member, Types::Bool
|
15
|
+
attribute? :request_title, Types::Bool
|
16
|
+
attribute? :request_username, Types::Bool
|
17
|
+
attribute? :request_photo, Types::Bool
|
15
18
|
end
|
16
19
|
end
|
17
20
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class KeyboardButtonRequestUsers < Base
|
7
|
+
attribute :request_id, Types::Integer
|
8
|
+
attribute? :user_is_bot, Types::Bool
|
9
|
+
attribute? :user_is_premium, Types::Bool
|
10
|
+
attribute? :max_quantity, Types::Integer.default(1)
|
11
|
+
attribute? :request_name, Types::Bool
|
12
|
+
attribute? :request_username, Types::Bool
|
13
|
+
attribute? :request_photo, Types::Bool
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class LinkPreviewOptions < Base
|
7
|
+
attribute? :is_disabled, Types::Bool
|
8
|
+
attribute? :url, Types::String
|
9
|
+
attribute? :prefer_small_media, Types::Bool
|
10
|
+
attribute? :prefer_large_media, Types::Bool
|
11
|
+
attribute? :show_above_text, Types::Bool
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -4,8 +4,8 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class Location < Base
|
7
|
-
attribute :longitude, Types::Float
|
8
7
|
attribute :latitude, Types::Float
|
8
|
+
attribute :longitude, Types::Float
|
9
9
|
attribute? :horizontal_accuracy, Types::Float
|
10
10
|
attribute? :live_period, Types::Integer
|
11
11
|
attribute? :heading, Types::Integer
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
## Just for classes consistency
|
7
|
+
# rubocop:disable Naming/ConstantName
|
8
|
+
MaybeInaccessibleMessage = (
|
9
|
+
Message |
|
10
|
+
InaccessibleMessage
|
11
|
+
)
|
12
|
+
# rubocop:enable Naming/ConstantName
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
## Just for classes consistency
|
7
|
+
# rubocop:disable Naming/ConstantName
|
8
|
+
MenuButton = (
|
9
|
+
MenuButtonCommands |
|
10
|
+
MenuButtonWebApp |
|
11
|
+
MenuButtonDefault
|
12
|
+
)
|
13
|
+
# rubocop:enable Naming/ConstantName
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -4,7 +4,7 @@ module Telegram
|
|
4
4
|
module Bot
|
5
5
|
module Types
|
6
6
|
class MenuButtonWebApp < Base
|
7
|
-
attribute :type, Types::String.default('web_app')
|
7
|
+
attribute :type, Types::String.constrained(eql: 'web_app').default('web_app')
|
8
8
|
attribute :text, Types::String
|
9
9
|
attribute :web_app, WebAppInfo
|
10
10
|
end
|
@@ -8,35 +8,42 @@ module Telegram
|
|
8
8
|
attribute? :message_thread_id, Types::Integer
|
9
9
|
attribute? :from, User
|
10
10
|
attribute? :sender_chat, Chat
|
11
|
+
attribute? :sender_boost_count, Types::Integer
|
12
|
+
attribute? :sender_business_bot, User
|
11
13
|
attribute :date, Types::Integer
|
14
|
+
attribute? :business_connection_id, Types::String
|
12
15
|
attribute :chat, Chat
|
13
|
-
attribute? :
|
14
|
-
attribute? :
|
15
|
-
attribute? :
|
16
|
-
attribute? :forward_signature, Types::String
|
17
|
-
attribute? :forward_sender_name, Types::String
|
18
|
-
attribute? :forward_date, Types::Integer
|
19
|
-
attribute? :is_topic_message, Types::Bool
|
20
|
-
attribute? :is_automatic_forward, Types::Bool
|
16
|
+
attribute? :forward_origin, MessageOrigin
|
17
|
+
attribute? :is_topic_message, Types::True
|
18
|
+
attribute? :is_automatic_forward, Types::True
|
21
19
|
attribute? :reply_to_message, Message
|
20
|
+
attribute? :external_reply, ExternalReplyInfo
|
21
|
+
attribute? :quote, TextQuote
|
22
|
+
attribute? :reply_to_story, Story
|
22
23
|
attribute? :via_bot, User
|
23
24
|
attribute? :edit_date, Types::Integer
|
24
|
-
attribute? :has_protected_content, Types::
|
25
|
+
attribute? :has_protected_content, Types::True
|
26
|
+
attribute? :is_from_offline, Types::True
|
25
27
|
attribute? :media_group_id, Types::String
|
26
28
|
attribute? :author_signature, Types::String
|
27
29
|
attribute? :text, Types::String
|
28
30
|
attribute? :entities, Types::Array.of(MessageEntity)
|
31
|
+
attribute? :link_preview_options, LinkPreviewOptions
|
32
|
+
attribute? :effect_id, Types::String
|
29
33
|
attribute? :animation, Animation
|
30
34
|
attribute? :audio, Audio
|
31
35
|
attribute? :document, Document
|
36
|
+
attribute? :paid_media, PaidMediaInfo
|
32
37
|
attribute? :photo, Types::Array.of(PhotoSize)
|
33
38
|
attribute? :sticker, Sticker
|
39
|
+
attribute? :story, Story
|
34
40
|
attribute? :video, Video
|
35
41
|
attribute? :video_note, VideoNote
|
36
42
|
attribute? :voice, Voice
|
37
43
|
attribute? :caption, Types::String
|
38
44
|
attribute? :caption_entities, Types::Array.of(MessageEntity)
|
39
|
-
attribute? :
|
45
|
+
attribute? :show_caption_above_media, Types::True
|
46
|
+
attribute? :has_media_spoiler, Types::True
|
40
47
|
attribute? :contact, Contact
|
41
48
|
attribute? :dice, Dice
|
42
49
|
attribute? :game, Game
|
@@ -47,28 +54,35 @@ module Telegram
|
|
47
54
|
attribute? :left_chat_member, User
|
48
55
|
attribute? :new_chat_title, Types::String
|
49
56
|
attribute? :new_chat_photo, Types::Array.of(PhotoSize)
|
50
|
-
attribute? :delete_chat_photo, Types::
|
51
|
-
attribute? :group_chat_created, Types::
|
52
|
-
attribute? :supergroup_chat_created, Types::
|
53
|
-
attribute? :channel_chat_created, Types::
|
57
|
+
attribute? :delete_chat_photo, Types::True
|
58
|
+
attribute? :group_chat_created, Types::True
|
59
|
+
attribute? :supergroup_chat_created, Types::True
|
60
|
+
attribute? :channel_chat_created, Types::True
|
54
61
|
attribute? :message_auto_delete_timer_changed, MessageAutoDeleteTimerChanged
|
55
62
|
attribute? :migrate_to_chat_id, Types::Integer
|
56
63
|
attribute? :migrate_from_chat_id, Types::Integer
|
57
|
-
attribute? :pinned_message,
|
64
|
+
attribute? :pinned_message, MaybeInaccessibleMessage
|
58
65
|
attribute? :invoice, Invoice
|
59
66
|
attribute? :successful_payment, SuccessfulPayment
|
60
|
-
attribute? :
|
67
|
+
attribute? :refunded_payment, RefundedPayment
|
68
|
+
attribute? :users_shared, UsersShared
|
61
69
|
attribute? :chat_shared, ChatShared
|
62
70
|
attribute? :connected_website, Types::String
|
63
71
|
attribute? :write_access_allowed, WriteAccessAllowed
|
64
72
|
attribute? :passport_data, PassportData
|
65
73
|
attribute? :proximity_alert_triggered, ProximityAlertTriggered
|
74
|
+
attribute? :boost_added, ChatBoostAdded
|
75
|
+
attribute? :chat_background_set, ChatBackground
|
66
76
|
attribute? :forum_topic_created, ForumTopicCreated
|
67
77
|
attribute? :forum_topic_edited, ForumTopicEdited
|
68
78
|
attribute? :forum_topic_closed, ForumTopicClosed
|
69
79
|
attribute? :forum_topic_reopened, ForumTopicReopened
|
70
80
|
attribute? :general_forum_topic_hidden, GeneralForumTopicHidden
|
71
81
|
attribute? :general_forum_topic_unhidden, GeneralForumTopicUnhidden
|
82
|
+
attribute? :giveaway_created, GiveawayCreated
|
83
|
+
attribute? :giveaway, Giveaway
|
84
|
+
attribute? :giveaway_winners, GiveawayWinners
|
85
|
+
attribute? :giveaway_completed, GiveawayCompleted
|
72
86
|
attribute? :video_chat_scheduled, VideoChatScheduled
|
73
87
|
attribute? :video_chat_started, VideoChatStarted
|
74
88
|
attribute? :video_chat_ended, VideoChatEnded
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
## Just for classes consistency
|
7
|
+
# rubocop:disable Naming/ConstantName
|
8
|
+
MessageOrigin = (
|
9
|
+
MessageOriginUser |
|
10
|
+
MessageOriginHiddenUser |
|
11
|
+
MessageOriginChat |
|
12
|
+
MessageOriginChannel
|
13
|
+
)
|
14
|
+
# rubocop:enable Naming/ConstantName
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Telegram
|
4
|
+
module Bot
|
5
|
+
module Types
|
6
|
+
class MessageOriginChannel < Base
|
7
|
+
attribute :type, Types::String.constrained(eql: 'channel').default('channel')
|
8
|
+
attribute :date, Types::Integer
|
9
|
+
attribute :chat, Chat
|
10
|
+
attribute :message_id, Types::Integer
|
11
|
+
attribute? :author_signature, Types::String
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|