telegram-bot-ruby 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/Gemfile +6 -2
  4. data/Rakefile +0 -45
  5. data/lib/telegram/bot/api/endpoints.rb +12 -2
  6. data/lib/telegram/bot/client.rb +1 -1
  7. data/lib/telegram/bot/exceptions/response_error.rb +1 -1
  8. data/lib/telegram/bot/types/background_fill.rb +16 -0
  9. data/lib/telegram/bot/types/background_fill_freeform_gradient.rb +12 -0
  10. data/lib/telegram/bot/types/background_fill_gradient.rb +14 -0
  11. data/lib/telegram/bot/types/background_fill_solid.rb +12 -0
  12. data/lib/telegram/bot/types/background_type.rb +17 -0
  13. data/lib/telegram/bot/types/background_type_chat_theme.rb +12 -0
  14. data/lib/telegram/bot/types/background_type_fill.rb +13 -0
  15. data/lib/telegram/bot/types/background_type_pattern.rb +16 -0
  16. data/lib/telegram/bot/types/background_type_wallpaper.rb +15 -0
  17. data/lib/telegram/bot/types/birthdate.rb +13 -0
  18. data/lib/telegram/bot/types/bot_command.rb +2 -2
  19. data/lib/telegram/bot/types/bot_command_scope.rb +20 -0
  20. data/lib/telegram/bot/types/business_connection.rb +16 -0
  21. data/lib/telegram/bot/types/business_intro.rb +13 -0
  22. data/lib/telegram/bot/types/business_location.rb +12 -0
  23. data/lib/telegram/bot/types/business_messages_deleted.rb +13 -0
  24. data/lib/telegram/bot/types/business_opening_hours.rb +12 -0
  25. data/lib/telegram/bot/types/business_opening_hours_interval.rb +12 -0
  26. data/lib/telegram/bot/types/chat.rb +0 -28
  27. data/lib/telegram/bot/types/chat_administrator_rights.rb +3 -3
  28. data/lib/telegram/bot/types/chat_background.rb +11 -0
  29. data/lib/telegram/bot/types/chat_boost_added.rb +11 -0
  30. data/lib/telegram/bot/types/chat_boost_source.rb +4 -1
  31. data/lib/telegram/bot/types/chat_boost_source_giveaway.rb +1 -0
  32. data/lib/telegram/bot/types/chat_full_info.rb +54 -0
  33. data/lib/telegram/bot/types/chat_invite_link.rb +2 -0
  34. data/lib/telegram/bot/types/chat_location.rb +1 -1
  35. data/lib/telegram/bot/types/chat_member.rb +4 -4
  36. data/lib/telegram/bot/types/chat_member_administrator.rb +3 -3
  37. data/lib/telegram/bot/types/chat_member_member.rb +1 -0
  38. data/lib/telegram/bot/types/chat_member_updated.rb +1 -0
  39. data/lib/telegram/bot/types/chat_shared.rb +3 -0
  40. data/lib/telegram/bot/types/copy_text_button.rb +11 -0
  41. data/lib/telegram/bot/types/error.rb +14 -0
  42. data/lib/telegram/bot/types/external_reply_info.rb +1 -0
  43. data/lib/telegram/bot/types/force_reply.rb +2 -2
  44. data/lib/telegram/bot/types/gift.rb +15 -0
  45. data/lib/telegram/bot/types/gifts.rb +11 -0
  46. data/lib/telegram/bot/types/giveaway.rb +1 -0
  47. data/lib/telegram/bot/types/giveaway_completed.rb +1 -0
  48. data/lib/telegram/bot/types/giveaway_created.rb +1 -0
  49. data/lib/telegram/bot/types/giveaway_winners.rb +1 -0
  50. data/lib/telegram/bot/types/inline_keyboard_button.rb +2 -1
  51. data/lib/telegram/bot/types/inline_query_result.rb +33 -0
  52. data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +1 -0
  53. data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +1 -0
  54. data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +1 -0
  55. data/lib/telegram/bot/types/inline_query_result_cached_video.rb +1 -0
  56. data/lib/telegram/bot/types/inline_query_result_gif.rb +2 -1
  57. data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +2 -1
  58. data/lib/telegram/bot/types/inline_query_result_photo.rb +1 -0
  59. data/lib/telegram/bot/types/inline_query_result_video.rb +1 -0
  60. data/lib/telegram/bot/types/inline_query_results_button.rb +13 -0
  61. data/lib/telegram/bot/types/input_contact_message_content.rb +1 -1
  62. data/lib/telegram/bot/types/input_invoice_message_content.rb +5 -5
  63. data/lib/telegram/bot/types/input_location_message_content.rb +1 -1
  64. data/lib/telegram/bot/types/input_media.rb +18 -0
  65. data/lib/telegram/bot/types/input_media_animation.rb +1 -0
  66. data/lib/telegram/bot/types/input_media_photo.rb +1 -0
  67. data/lib/telegram/bot/types/input_media_video.rb +1 -0
  68. data/lib/telegram/bot/types/input_message_content.rb +10 -2
  69. data/lib/telegram/bot/types/input_paid_media.rb +15 -0
  70. data/lib/telegram/bot/types/input_paid_media_photo.rb +12 -0
  71. data/lib/telegram/bot/types/input_paid_media_video.rb +17 -0
  72. data/lib/telegram/bot/types/input_poll_option.rb +13 -0
  73. data/lib/telegram/bot/types/input_sticker.rb +15 -0
  74. data/lib/telegram/bot/types/input_text_message_content.rb +2 -2
  75. data/lib/telegram/bot/types/input_venue_message_content.rb +1 -1
  76. data/lib/telegram/bot/types/keyboard_button_request_chat.rb +3 -0
  77. data/lib/telegram/bot/types/keyboard_button_request_users.rb +3 -0
  78. data/lib/telegram/bot/types/location.rb +1 -1
  79. data/lib/telegram/bot/types/maybe_inaccessible_message.rb +4 -1
  80. data/lib/telegram/bot/types/menu_button.rb +16 -0
  81. data/lib/telegram/bot/types/message.rb +11 -0
  82. data/lib/telegram/bot/types/message_origin.rb +4 -1
  83. data/lib/telegram/bot/types/paid_media.rb +16 -0
  84. data/lib/telegram/bot/types/paid_media_info.rb +12 -0
  85. data/lib/telegram/bot/types/paid_media_photo.rb +12 -0
  86. data/lib/telegram/bot/types/paid_media_preview.rb +14 -0
  87. data/lib/telegram/bot/types/paid_media_purchased.rb +12 -0
  88. data/lib/telegram/bot/types/paid_media_video.rb +12 -0
  89. data/lib/telegram/bot/types/passport_element_error.rb +22 -0
  90. data/lib/telegram/bot/types/poll.rb +2 -1
  91. data/lib/telegram/bot/types/poll_option.rb +2 -1
  92. data/lib/telegram/bot/types/prepared_inline_message.rb +12 -0
  93. data/lib/telegram/bot/types/reaction_type.rb +6 -2
  94. data/lib/telegram/bot/types/reaction_type_paid.rb +11 -0
  95. data/lib/telegram/bot/types/refunded_payment.rb +15 -0
  96. data/lib/telegram/bot/types/reply_keyboard_markup.rb +2 -2
  97. data/lib/telegram/bot/types/reply_keyboard_remove.rb +1 -1
  98. data/lib/telegram/bot/types/response_parameters.rb +12 -0
  99. data/lib/telegram/bot/types/revenue_withdrawal_state.rb +16 -0
  100. data/lib/telegram/bot/types/revenue_withdrawal_state_failed.rb +11 -0
  101. data/lib/telegram/bot/types/revenue_withdrawal_state_pending.rb +11 -0
  102. data/lib/telegram/bot/types/revenue_withdrawal_state_succeeded.rb +13 -0
  103. data/lib/telegram/bot/types/shared_user.rb +15 -0
  104. data/lib/telegram/bot/types/star_transaction.rb +15 -0
  105. data/lib/telegram/bot/types/star_transactions.rb +11 -0
  106. data/lib/telegram/bot/types/sticker_set.rb +0 -2
  107. data/lib/telegram/bot/types/story.rb +4 -1
  108. data/lib/telegram/bot/types/successful_payment.rb +3 -0
  109. data/lib/telegram/bot/types/transaction_partner.rb +18 -0
  110. data/lib/telegram/bot/types/transaction_partner_fragment.rb +12 -0
  111. data/lib/telegram/bot/types/transaction_partner_other.rb +11 -0
  112. data/lib/telegram/bot/types/transaction_partner_telegram_ads.rb +11 -0
  113. data/lib/telegram/bot/types/transaction_partner_telegram_api.rb +12 -0
  114. data/lib/telegram/bot/types/transaction_partner_user.rb +17 -0
  115. data/lib/telegram/bot/types/update.rb +5 -0
  116. data/lib/telegram/bot/types/user.rb +2 -0
  117. data/lib/telegram/bot/types/users_shared.rb +1 -1
  118. data/lib/telegram/bot/version.rb +1 -1
  119. data/rakelib/parse_schema.rake +73 -0
  120. data/rakelib/rebuild_types.rake +90 -0
  121. data/utility/empty_type.erb +14 -0
  122. data/utility/type.erb +13 -0
  123. data/utility/type_attributes.json +5138 -0
  124. metadata +65 -3
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class CopyTextButton < Base
7
+ attribute :text, Types::String.constrained(min_size: 1, max_size: 256)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class Error < Base
7
+ attribute :ok, Types::Bool
8
+ attribute :error_code, Types::Integer
9
+ attribute :description, Types::String
10
+ attribute? :parameters, ResponseParameters
11
+ end
12
+ end
13
+ end
14
+ end
@@ -11,6 +11,7 @@ module Telegram
11
11
  attribute? :animation, Animation
12
12
  attribute? :audio, Audio
13
13
  attribute? :document, Document
14
+ attribute? :paid_media, PaidMediaInfo
14
15
  attribute? :photo, Types::Array.of(PhotoSize)
15
16
  attribute? :sticker, Sticker
16
17
  attribute? :story, Story
@@ -5,8 +5,8 @@ module Telegram
5
5
  module Types
6
6
  class ForceReply < Base
7
7
  attribute :force_reply, Types::True
8
- attribute? :input_field_placeholder, Types::String
9
- attribute? :selective, Types::Bool.default(false)
8
+ attribute? :input_field_placeholder, Types::String.constrained(min_size: 1, max_size: 64)
9
+ attribute? :selective, Types::Bool
10
10
  end
11
11
  end
12
12
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class Gift < Base
7
+ attribute :id, Types::String
8
+ attribute :sticker, Sticker
9
+ attribute :star_count, Types::Integer
10
+ attribute? :total_count, Types::Integer
11
+ attribute? :remaining_count, Types::Integer
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class Gifts < Base
7
+ attribute :gifts, Types::Array.of(Gift)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -11,6 +11,7 @@ module Telegram
11
11
  attribute? :has_public_winners, Types::True
12
12
  attribute? :prize_description, Types::String
13
13
  attribute? :country_codes, Types::Array.of(Types::String)
14
+ attribute? :prize_star_count, Types::Integer
14
15
  attribute? :premium_subscription_month_count, Types::Integer
15
16
  end
16
17
  end
@@ -7,6 +7,7 @@ module Telegram
7
7
  attribute :winner_count, Types::Integer
8
8
  attribute? :unclaimed_prize_count, Types::Integer
9
9
  attribute? :giveaway_message, Message
10
+ attribute? :is_star_giveaway, Types::True
10
11
  end
11
12
  end
12
13
  end
@@ -4,6 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class GiveawayCreated < Base
7
+ attribute? :prize_star_count, Types::Integer
7
8
  end
8
9
  end
9
10
  end
@@ -10,6 +10,7 @@ module Telegram
10
10
  attribute :winner_count, Types::Integer
11
11
  attribute :winners, Types::Array.of(User)
12
12
  attribute? :additional_chat_count, Types::Integer
13
+ attribute? :prize_star_count, Types::Integer
13
14
  attribute? :premium_subscription_month_count, Types::Integer
14
15
  attribute? :unclaimed_prize_count, Types::Integer
15
16
  attribute? :only_new_members, Types::True
@@ -11,7 +11,8 @@ module Telegram
11
11
  attribute? :login_url, LoginUrl
12
12
  attribute? :switch_inline_query, Types::String
13
13
  attribute? :switch_inline_query_current_chat, Types::String
14
- attribute? :switch_inline_query_chosen_chat, Types::SwitchInlineQueryChosenChat
14
+ attribute? :switch_inline_query_chosen_chat, SwitchInlineQueryChosenChat
15
+ attribute? :copy_text, CopyTextButton
15
16
  attribute? :callback_game, CallbackGame
16
17
  attribute? :pay, Types::Bool
17
18
  end
@@ -0,0 +1,33 @@
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
+ InlineQueryResult = (
9
+ InlineQueryResultCachedAudio |
10
+ InlineQueryResultCachedDocument |
11
+ InlineQueryResultCachedGif |
12
+ InlineQueryResultCachedMpeg4Gif |
13
+ InlineQueryResultCachedPhoto |
14
+ InlineQueryResultCachedSticker |
15
+ InlineQueryResultCachedVideo |
16
+ InlineQueryResultCachedVoice |
17
+ InlineQueryResultArticle |
18
+ InlineQueryResultAudio |
19
+ InlineQueryResultContact |
20
+ InlineQueryResultGame |
21
+ InlineQueryResultDocument |
22
+ InlineQueryResultGif |
23
+ InlineQueryResultLocation |
24
+ InlineQueryResultMpeg4Gif |
25
+ InlineQueryResultPhoto |
26
+ InlineQueryResultVenue |
27
+ InlineQueryResultVideo |
28
+ InlineQueryResultVoice
29
+ )
30
+ # rubocop:enable Naming/ConstantName
31
+ end
32
+ end
33
+ end
@@ -11,6 +11,7 @@ module Telegram
11
11
  attribute? :caption, Types::String
12
12
  attribute? :parse_mode, Types::String
13
13
  attribute? :caption_entities, Types::Array.of(MessageEntity)
14
+ attribute? :show_caption_above_media, Types::Bool
14
15
  attribute? :reply_markup, InlineKeyboardMarkup
15
16
  attribute? :input_message_content, InputMessageContent
16
17
  end
@@ -11,6 +11,7 @@ module Telegram
11
11
  attribute? :caption, Types::String
12
12
  attribute? :parse_mode, Types::String
13
13
  attribute? :caption_entities, Types::Array.of(MessageEntity)
14
+ attribute? :show_caption_above_media, Types::Bool
14
15
  attribute? :reply_markup, InlineKeyboardMarkup
15
16
  attribute? :input_message_content, InputMessageContent
16
17
  end
@@ -12,6 +12,7 @@ module Telegram
12
12
  attribute? :caption, Types::String
13
13
  attribute? :parse_mode, Types::String
14
14
  attribute? :caption_entities, Types::Array.of(MessageEntity)
15
+ attribute? :show_caption_above_media, Types::Bool
15
16
  attribute? :reply_markup, InlineKeyboardMarkup
16
17
  attribute? :input_message_content, InputMessageContent
17
18
  end
@@ -12,6 +12,7 @@ module Telegram
12
12
  attribute? :caption, Types::String
13
13
  attribute? :parse_mode, Types::String
14
14
  attribute? :caption_entities, Types::Array.of(MessageEntity)
15
+ attribute? :show_caption_above_media, Types::Bool
15
16
  attribute? :reply_markup, InlineKeyboardMarkup
16
17
  attribute? :input_message_content, InputMessageContent
17
18
  end
@@ -11,11 +11,12 @@ module Telegram
11
11
  attribute? :gif_height, Types::Integer
12
12
  attribute? :gif_duration, Types::Integer
13
13
  attribute :thumbnail_url, Types::String
14
- attribute? :thumbnail_mime_type, 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
@@ -11,11 +11,12 @@ module Telegram
11
11
  attribute? :mpeg4_height, Types::Integer
12
12
  attribute? :mpeg4_duration, Types::Integer
13
13
  attribute :thumbnail_url, Types::String
14
- attribute? :thumbnail_mime_type, 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
@@ -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
@@ -13,6 +13,7 @@ module Telegram
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
@@ -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,7 +3,7 @@
3
3
  module Telegram
4
4
  module Bot
5
5
  module Types
6
- class InputContactMessageContent < InputMessageContent
6
+ class InputContactMessageContent < Base
7
7
  attribute :phone_number, Types::String
8
8
  attribute :first_name, Types::String
9
9
  attribute? :last_name, Types::String
@@ -3,14 +3,14 @@
3
3
  module Telegram
4
4
  module Bot
5
5
  module Types
6
- class InputInvoiceMessageContent < InputMessageContent
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
@@ -3,7 +3,7 @@
3
3
  module Telegram
4
4
  module Bot
5
5
  module Types
6
- class InputLocationMessageContent < InputMessageContent
6
+ class InputLocationMessageContent < Base
7
7
  attribute :latitude, Types::Float
8
8
  attribute :longitude, Types::Float
9
9
  attribute? :horizontal_accuracy, Types::Float
@@ -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
@@ -10,6 +10,7 @@ module Telegram
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
@@ -9,6 +9,7 @@ module Telegram
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
@@ -10,6 +10,7 @@ module Telegram
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
- class InputMessageContent < Base
7
- end
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,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputPaidMediaPhoto < Base
7
+ attribute :type, Types::String.constrained(eql: 'photo').default('photo')
8
+ attribute :media, Types::String
9
+ end
10
+ end
11
+ end
12
+ 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,8 +3,8 @@
3
3
  module Telegram
4
4
  module Bot
5
5
  module Types
6
- class InputTextMessageContent < InputMessageContent
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
10
  attribute? :link_preview_options, LinkPreviewOptions
@@ -3,7 +3,7 @@
3
3
  module Telegram
4
4
  module Bot
5
5
  module Types
6
- class InputVenueMessageContent < InputMessageContent
6
+ class InputVenueMessageContent < Base
7
7
  attribute :latitude, Types::Float
8
8
  attribute :longitude, Types::Float
9
9
  attribute :title, Types::String
@@ -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
@@ -8,6 +8,9 @@ module Telegram
8
8
  attribute? :user_is_bot, Types::Bool
9
9
  attribute? :user_is_premium, Types::Bool
10
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
11
14
  end
12
15
  end
13
16
  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
@@ -3,10 +3,13 @@
3
3
  module Telegram
4
4
  module Bot
5
5
  module Types
6
- MaybeInaccessibleMessage = ( # rubocop:disable Naming/ConstantName
6
+ ## Just for classes consistency
7
+ # rubocop:disable Naming/ConstantName
8
+ MaybeInaccessibleMessage = (
7
9
  Message |
8
10
  InaccessibleMessage
9
11
  )
12
+ # rubocop:enable Naming/ConstantName
10
13
  end
11
14
  end
12
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
@@ -8,7 +8,10 @@ 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
16
  attribute? :forward_origin, MessageOrigin
14
17
  attribute? :is_topic_message, Types::True
@@ -16,17 +19,21 @@ module Telegram
16
19
  attribute? :reply_to_message, Message
17
20
  attribute? :external_reply, ExternalReplyInfo
18
21
  attribute? :quote, TextQuote
22
+ attribute? :reply_to_story, Story
19
23
  attribute? :via_bot, User
20
24
  attribute? :edit_date, Types::Integer
21
25
  attribute? :has_protected_content, Types::True
26
+ attribute? :is_from_offline, Types::True
22
27
  attribute? :media_group_id, Types::String
23
28
  attribute? :author_signature, Types::String
24
29
  attribute? :text, Types::String
25
30
  attribute? :entities, Types::Array.of(MessageEntity)
26
31
  attribute? :link_preview_options, LinkPreviewOptions
32
+ attribute? :effect_id, Types::String
27
33
  attribute? :animation, Animation
28
34
  attribute? :audio, Audio
29
35
  attribute? :document, Document
36
+ attribute? :paid_media, PaidMediaInfo
30
37
  attribute? :photo, Types::Array.of(PhotoSize)
31
38
  attribute? :sticker, Sticker
32
39
  attribute? :story, Story
@@ -35,6 +42,7 @@ module Telegram
35
42
  attribute? :voice, Voice
36
43
  attribute? :caption, Types::String
37
44
  attribute? :caption_entities, Types::Array.of(MessageEntity)
45
+ attribute? :show_caption_above_media, Types::True
38
46
  attribute? :has_media_spoiler, Types::True
39
47
  attribute? :contact, Contact
40
48
  attribute? :dice, Dice
@@ -56,12 +64,15 @@ module Telegram
56
64
  attribute? :pinned_message, MaybeInaccessibleMessage
57
65
  attribute? :invoice, Invoice
58
66
  attribute? :successful_payment, SuccessfulPayment
67
+ attribute? :refunded_payment, RefundedPayment
59
68
  attribute? :users_shared, UsersShared
60
69
  attribute? :chat_shared, ChatShared
61
70
  attribute? :connected_website, Types::String
62
71
  attribute? :write_access_allowed, WriteAccessAllowed
63
72
  attribute? :passport_data, PassportData
64
73
  attribute? :proximity_alert_triggered, ProximityAlertTriggered
74
+ attribute? :boost_added, ChatBoostAdded
75
+ attribute? :chat_background_set, ChatBackground
65
76
  attribute? :forum_topic_created, ForumTopicCreated
66
77
  attribute? :forum_topic_edited, ForumTopicEdited
67
78
  attribute? :forum_topic_closed, ForumTopicClosed
@@ -3,12 +3,15 @@
3
3
  module Telegram
4
4
  module Bot
5
5
  module Types
6
- MessageOrigin = ( # rubocop:disable Naming/ConstantName
6
+ ## Just for classes consistency
7
+ # rubocop:disable Naming/ConstantName
8
+ MessageOrigin = (
7
9
  MessageOriginUser |
8
10
  MessageOriginHiddenUser |
9
11
  MessageOriginChat |
10
12
  MessageOriginChannel
11
13
  )
14
+ # rubocop:enable Naming/ConstantName
12
15
  end
13
16
  end
14
17
  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
+ PaidMedia = (
9
+ PaidMediaPreview |
10
+ PaidMediaPhoto |
11
+ PaidMediaVideo
12
+ )
13
+ # rubocop:enable Naming/ConstantName
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class PaidMediaInfo < Base
7
+ attribute :star_count, Types::Integer
8
+ attribute :paid_media, Types::Array.of(PaidMedia)
9
+ end
10
+ end
11
+ end
12
+ end