telegram-bot-ruby 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -0
  3. data/README.md +6 -9
  4. data/lib/telegram/bot/api/endpoints.rb +16 -1
  5. data/lib/telegram/bot/types/bot_access_settings.rb +12 -0
  6. data/lib/telegram/bot/types/bot_command.rb +1 -0
  7. data/lib/telegram/bot/types/bot_subscription_updated.rb +13 -0
  8. data/lib/telegram/bot/types/chat_full_info.rb +2 -0
  9. data/lib/telegram/bot/types/chat_join_request.rb +1 -0
  10. data/lib/telegram/bot/types/chat_member_restricted.rb +1 -0
  11. data/lib/telegram/bot/types/chat_permissions.rb +1 -0
  12. data/lib/telegram/bot/types/community.rb +12 -0
  13. data/lib/telegram/bot/types/community_chat_added.rb +11 -0
  14. data/lib/telegram/bot/types/community_chat_removed.rb +10 -0
  15. data/lib/telegram/bot/types/external_reply_info.rb +1 -0
  16. data/lib/telegram/bot/types/inline_query_result_location.rb +1 -1
  17. data/lib/telegram/bot/types/input_location_message_content.rb +1 -1
  18. data/lib/telegram/bot/types/input_media.rb +2 -1
  19. data/lib/telegram/bot/types/input_media_link.rb +12 -0
  20. data/lib/telegram/bot/types/input_media_live_photo.rb +18 -0
  21. data/lib/telegram/bot/types/input_media_location.rb +14 -0
  22. data/lib/telegram/bot/types/input_media_sticker.rb +13 -0
  23. data/lib/telegram/bot/types/input_media_venue.rb +19 -0
  24. data/lib/telegram/bot/types/input_media_voice_note.rb +16 -0
  25. data/lib/telegram/bot/types/input_message_content.rb +1 -0
  26. data/lib/telegram/bot/types/input_paid_media.rb +1 -0
  27. data/lib/telegram/bot/types/input_paid_media_live_photo.rb +13 -0
  28. data/lib/telegram/bot/types/input_poll_media.rb +21 -0
  29. data/lib/telegram/bot/types/input_poll_option.rb +1 -0
  30. data/lib/telegram/bot/types/input_poll_option_media.rb +21 -0
  31. data/lib/telegram/bot/types/input_rich_block.rb +34 -0
  32. data/lib/telegram/bot/types/input_rich_block_anchor.rb +12 -0
  33. data/lib/telegram/bot/types/input_rich_block_animation.rb +13 -0
  34. data/lib/telegram/bot/types/input_rich_block_audio.rb +13 -0
  35. data/lib/telegram/bot/types/input_rich_block_block_quotation.rb +13 -0
  36. data/lib/telegram/bot/types/input_rich_block_collage.rb +13 -0
  37. data/lib/telegram/bot/types/input_rich_block_details.rb +14 -0
  38. data/lib/telegram/bot/types/input_rich_block_divider.rb +11 -0
  39. data/lib/telegram/bot/types/input_rich_block_footer.rb +12 -0
  40. data/lib/telegram/bot/types/input_rich_block_list.rb +12 -0
  41. data/lib/telegram/bot/types/input_rich_block_list_item.rb +15 -0
  42. data/lib/telegram/bot/types/input_rich_block_map.rb +16 -0
  43. data/lib/telegram/bot/types/input_rich_block_mathematical_expression.rb +12 -0
  44. data/lib/telegram/bot/types/input_rich_block_paragraph.rb +12 -0
  45. data/lib/telegram/bot/types/input_rich_block_photo.rb +13 -0
  46. data/lib/telegram/bot/types/input_rich_block_preformatted.rb +13 -0
  47. data/lib/telegram/bot/types/input_rich_block_pull_quotation.rb +13 -0
  48. data/lib/telegram/bot/types/input_rich_block_section_heading.rb +13 -0
  49. data/lib/telegram/bot/types/input_rich_block_slideshow.rb +13 -0
  50. data/lib/telegram/bot/types/input_rich_block_table.rb +15 -0
  51. data/lib/telegram/bot/types/input_rich_block_thinking.rb +12 -0
  52. data/lib/telegram/bot/types/input_rich_block_video.rb +13 -0
  53. data/lib/telegram/bot/types/input_rich_block_voice_note.rb +13 -0
  54. data/lib/telegram/bot/types/input_rich_message.rb +16 -0
  55. data/lib/telegram/bot/types/input_rich_message_content.rb +11 -0
  56. data/lib/telegram/bot/types/input_rich_message_media.rb +13 -0
  57. data/lib/telegram/bot/types/link.rb +11 -0
  58. data/lib/telegram/bot/types/live_photo.rb +18 -0
  59. data/lib/telegram/bot/types/message.rb +10 -1
  60. data/lib/telegram/bot/types/paid_media.rb +2 -1
  61. data/lib/telegram/bot/types/paid_media_live_photo.rb +12 -0
  62. data/lib/telegram/bot/types/poll.rb +4 -0
  63. data/lib/telegram/bot/types/poll_media.rb +20 -0
  64. data/lib/telegram/bot/types/poll_option.rb +1 -0
  65. data/lib/telegram/bot/types/poll_option_added.rb +1 -1
  66. data/lib/telegram/bot/types/poll_option_deleted.rb +1 -1
  67. data/lib/telegram/bot/types/reply_parameters.rb +2 -1
  68. data/lib/telegram/bot/types/rich_block.rb +34 -0
  69. data/lib/telegram/bot/types/rich_block_anchor.rb +12 -0
  70. data/lib/telegram/bot/types/rich_block_animation.rb +14 -0
  71. data/lib/telegram/bot/types/rich_block_audio.rb +13 -0
  72. data/lib/telegram/bot/types/rich_block_block_quotation.rb +13 -0
  73. data/lib/telegram/bot/types/rich_block_caption.rb +12 -0
  74. data/lib/telegram/bot/types/rich_block_collage.rb +13 -0
  75. data/lib/telegram/bot/types/rich_block_details.rb +14 -0
  76. data/lib/telegram/bot/types/rich_block_divider.rb +11 -0
  77. data/lib/telegram/bot/types/rich_block_footer.rb +12 -0
  78. data/lib/telegram/bot/types/rich_block_list.rb +12 -0
  79. data/lib/telegram/bot/types/rich_block_list_item.rb +16 -0
  80. data/lib/telegram/bot/types/rich_block_map.rb +16 -0
  81. data/lib/telegram/bot/types/rich_block_mathematical_expression.rb +12 -0
  82. data/lib/telegram/bot/types/rich_block_paragraph.rb +12 -0
  83. data/lib/telegram/bot/types/rich_block_photo.rb +14 -0
  84. data/lib/telegram/bot/types/rich_block_preformatted.rb +13 -0
  85. data/lib/telegram/bot/types/rich_block_pull_quotation.rb +13 -0
  86. data/lib/telegram/bot/types/rich_block_section_heading.rb +13 -0
  87. data/lib/telegram/bot/types/rich_block_slideshow.rb +13 -0
  88. data/lib/telegram/bot/types/rich_block_table.rb +15 -0
  89. data/lib/telegram/bot/types/rich_block_table_cell.rb +16 -0
  90. data/lib/telegram/bot/types/rich_block_thinking.rb +12 -0
  91. data/lib/telegram/bot/types/rich_block_video.rb +14 -0
  92. data/lib/telegram/bot/types/rich_block_voice_note.rb +13 -0
  93. data/lib/telegram/bot/types/rich_message.rb +12 -0
  94. data/lib/telegram/bot/types/rich_text.rb +38 -0
  95. data/lib/telegram/bot/types/rich_text_anchor.rb +12 -0
  96. data/lib/telegram/bot/types/rich_text_anchor_link.rb +13 -0
  97. data/lib/telegram/bot/types/rich_text_bank_card_number.rb +13 -0
  98. data/lib/telegram/bot/types/rich_text_bold.rb +12 -0
  99. data/lib/telegram/bot/types/rich_text_bot_command.rb +13 -0
  100. data/lib/telegram/bot/types/rich_text_cashtag.rb +13 -0
  101. data/lib/telegram/bot/types/rich_text_code.rb +12 -0
  102. data/lib/telegram/bot/types/rich_text_custom_emoji.rb +13 -0
  103. data/lib/telegram/bot/types/rich_text_date_time.rb +14 -0
  104. data/lib/telegram/bot/types/rich_text_email_address.rb +13 -0
  105. data/lib/telegram/bot/types/rich_text_hashtag.rb +13 -0
  106. data/lib/telegram/bot/types/rich_text_italic.rb +12 -0
  107. data/lib/telegram/bot/types/rich_text_marked.rb +12 -0
  108. data/lib/telegram/bot/types/rich_text_mathematical_expression.rb +12 -0
  109. data/lib/telegram/bot/types/rich_text_mention.rb +13 -0
  110. data/lib/telegram/bot/types/rich_text_phone_number.rb +13 -0
  111. data/lib/telegram/bot/types/rich_text_reference.rb +13 -0
  112. data/lib/telegram/bot/types/rich_text_reference_link.rb +13 -0
  113. data/lib/telegram/bot/types/rich_text_spoiler.rb +12 -0
  114. data/lib/telegram/bot/types/rich_text_strikethrough.rb +12 -0
  115. data/lib/telegram/bot/types/rich_text_subscript.rb +12 -0
  116. data/lib/telegram/bot/types/rich_text_superscript.rb +12 -0
  117. data/lib/telegram/bot/types/rich_text_text_mention.rb +13 -0
  118. data/lib/telegram/bot/types/rich_text_underline.rb +12 -0
  119. data/lib/telegram/bot/types/rich_text_url.rb +13 -0
  120. data/lib/telegram/bot/types/sent_guest_message.rb +11 -0
  121. data/lib/telegram/bot/types/update.rb +2 -0
  122. data/lib/telegram/bot/types/user.rb +2 -0
  123. data/lib/telegram/bot/types.rb +6 -0
  124. data/lib/telegram/bot/version.rb +1 -1
  125. data/rakelib/builders/type_builder.rb +5 -2
  126. data/rakelib/builders/type_dependencies.rb +45 -0
  127. data/rakelib/rebuild.rake +4 -1
  128. metadata +100 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 147ce110bf7814bf274a349a690e50c3c765d21465de7a705e828751f8467f23
4
- data.tar.gz: beaf1f9e171e3da2e57ec678a39732a715938542401369ab879d3ee4f6c0c310
3
+ metadata.gz: 305b7281c7f2f3d51656d5556d9435d3b6267ae4f275fc9a04b430cb275eabb2
4
+ data.tar.gz: cc6af3a9f74e56a9eb70d4b32cceeaddffb5a4c20cb0e8577b2abdb3ba5ccfb0
5
5
  SHA512:
6
- metadata.gz: c877eedeec06700c6691d569ba6ec01891274b661e6a3d40455c16492ef3486c26b3abe3c44de1857fb444c64aad651d792c6de1f2dda3c3299c77b11cd64955
7
- data.tar.gz: cccdc34911f698b2069d6e0a6221d2e80cbecc5df947b19b7f204670bdfd59b6e6870dd52b5695a53f2baa916eca3b3719251db7c3812a8521f2512e2b1ee40b
6
+ metadata.gz: b72f319422e8943a43fb2128e0553a4bf8518c28ed01489724b2a277797cceb60122302d1127aa14f55938f6d063e10226dd3d72e1fade237975e2648925d7a3
7
+ data.tar.gz: 17365086472228247b0e51cfba2d5f3661df32264267c9a2643f7372c39d315255626360dc5cc59341619ded5cf1c6e7528a0e368049b9b8740f9973eb5c8ba0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.8.0
4
+
5
+ ### Added
6
+
7
+ - [Bot API 10.0](https://core.telegram.org/bots/api-changelog#may-8-2026) + [Bot API 10.1](https://core.telegram.org/bots/api-changelog#june-11-2026) + [Bot API 10.2](https://core.telegram.org/bots/api-changelog#july-14-2026) [#336](https://github.com/atipugin/telegram-bot-ruby/pull/336)
8
+
3
9
  ## 2.7.0
4
10
 
5
11
  ### Added
data/README.md CHANGED
@@ -5,14 +5,13 @@ Ruby wrapper for [Telegram's Bot API](https://core.telegram.org/bots/api).
5
5
  [![Gem Version](https://badge.fury.io/rb/telegram-bot-ruby.svg)](http://badge.fury.io/rb/telegram-bot-ruby)
6
6
  [![Build Status](https://github.com/atipugin/telegram-bot-ruby/actions/workflows/ci.yml/badge.svg)](https://github.com/atipugin/telegram-bot-ruby/actions)
7
7
  [![Maintainability](https://api.codeclimate.com/v1/badges/7e61fbf5bec86e118fb1/maintainability)](https://codeclimate.com/github/atipugin/telegram-bot-ruby/maintainability)
8
- [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks!-🦉-1EAEDB.svg)](https://saythanks.io/to/atipugin)
9
8
 
10
9
  ## Installation
11
10
 
12
11
  Add following line to your Gemfile:
13
12
 
14
13
  ```ruby
15
- gem 'telegram-bot-ruby', '~> 2.5'
14
+ gem 'telegram-bot-ruby', '~> 2.7'
16
15
  ```
17
16
 
18
17
  And then execute:
@@ -200,11 +199,9 @@ bot.listen do |message|
200
199
  end
201
200
  ```
202
201
 
203
- Now, with `inline` mode enabled, your `message` object can be an instance of
204
- [Message](https://core.telegram.org/bots/api#message),
205
- [InlineQuery](https://core.telegram.org/bots/api#inlinequery) or
206
- [ChosenInlineResult](https://core.telegram.org/bots/api#choseninlineresult).
207
- That's why you need to check type of each message and decide how to handle it.
202
+ Now, with `inline` mode enabled, your `message` object can be an instance of any
203
+ [update type](https://core.telegram.org/bots/api#update) supported by the Bot API.
204
+ That's why you need to check the type of each message and decide how to handle it.
208
205
 
209
206
  Using `answer_inline_query` you can send query results to user.
210
207
  `results` field must be an array of [query result objects](https://core.telegram.org/bots/api#inlinequeryresult).
@@ -225,7 +222,7 @@ bot.listen do |message|
225
222
  case message.text
226
223
  when '/photo'
227
224
  path_to_photo = File.expand_path('~/Desktop/jennifer.jpg')
228
- bot.api.send_photo(chat_id: message.chat.id, photo: Faraday::UploadIO.new(path_to_photo, 'image/jpeg'))
225
+ bot.api.send_photo(chat_id: message.chat.id, photo: Faraday::Multipart::FilePart.new(path_to_photo, 'image/jpeg'))
229
226
  end
230
227
  end
231
228
  ```
@@ -247,7 +244,7 @@ end
247
244
 
248
245
  ## Connection adapters
249
246
 
250
- Since version `0.5.0` we rely on [faraday](https://github.com/lostisland/faraday) under the hood.
247
+ We rely on [faraday](https://github.com/lostisland/faraday) under the hood.
251
248
  You can use any of supported adapters (for example, `net/http/persistent`):
252
249
 
253
250
  ```ruby
@@ -17,6 +17,7 @@ module Telegram
17
17
  'copyMessage' => Types::MessageId,
18
18
  'copyMessages' => Types::Array.of(Types::MessageId),
19
19
  'sendPhoto' => Types::Message,
20
+ 'sendLivePhoto' => Types::Message,
20
21
  'sendAudio' => Types::Message,
21
22
  'sendDocument' => Types::Message,
22
23
  'sendVideo' => Types::Message,
@@ -55,6 +56,8 @@ module Telegram
55
56
  'revokeChatInviteLink' => Types::ChatInviteLink,
56
57
  'approveChatJoinRequest' => Types::Bool,
57
58
  'declineChatJoinRequest' => Types::Bool,
59
+ 'answerChatJoinRequestQuery' => Types::Bool,
60
+ 'sendChatJoinRequestWebApp' => Types::Bool,
58
61
  'setChatPhoto' => Types::Bool,
59
62
  'deleteChatPhoto' => Types::Bool,
60
63
  'setChatTitle' => Types::Bool,
@@ -65,8 +68,8 @@ module Telegram
65
68
  'leaveChat' => Types::Bool,
66
69
  'getChat' => Types::ChatFullInfo,
67
70
  'getChatAdministrators' => Types::Array.of(Types::ChatMember),
68
- 'getChatMemberCount' => Types::Integer,
69
71
  'getChatMember' => Types::ChatMember,
72
+ 'getUserPersonalChatMessages' => Types::Array.of(Types::Message),
70
73
  'setChatStickerSet' => Types::Bool,
71
74
  'deleteChatStickerSet' => Types::Bool,
72
75
  'getForumTopicIconStickers' => Types::Array.of(Types::Sticker),
@@ -83,10 +86,13 @@ module Telegram
83
86
  'unhideGeneralForumTopic' => Types::Bool,
84
87
  'unpinAllGeneralForumTopicMessages' => Types::Bool,
85
88
  'answerCallbackQuery' => Types::Bool,
89
+ 'answerGuestQuery' => Types::SentGuestMessage,
86
90
  'getUserChatBoosts' => Types::UserChatBoosts,
87
91
  'getBusinessConnection' => Types::BusinessConnection,
88
92
  'getManagedBotToken' => Types::String,
89
93
  'replaceManagedBotToken' => Types::String,
94
+ 'getManagedBotAccessSettings' => Types::BotAccessSettings,
95
+ 'setManagedBotAccessSettings' => Types::Bool,
90
96
  'setMyCommands' => Types::Bool,
91
97
  'deleteMyCommands' => Types::Bool,
92
98
  'getMyCommands' => Types::Array.of(Types::BotCommand),
@@ -140,10 +146,17 @@ module Telegram
140
146
  'editMessageChecklist' => Types::Message,
141
147
  'editMessageReplyMarkup' => Types::Message | Types::Bool,
142
148
  'stopPoll' => Types::Poll,
149
+ 'editEphemeralMessageText' => Types::Bool,
150
+ 'editEphemeralMessageMedia' => Types::Bool,
151
+ 'editEphemeralMessageCaption' => Types::Bool,
152
+ 'editEphemeralMessageReplyMarkup' => Types::Bool,
143
153
  'approveSuggestedPost' => Types::Bool,
144
154
  'declineSuggestedPost' => Types::Bool,
145
155
  'deleteMessage' => Types::Bool,
146
156
  'deleteMessages' => Types::Bool,
157
+ 'deleteEphemeralMessage' => Types::Bool,
158
+ 'deleteMessageReaction' => Types::Bool,
159
+ 'deleteAllMessageReactions' => Types::Bool,
147
160
  'sendSticker' => Types::Message,
148
161
  'getStickerSet' => Types::StickerSet,
149
162
  'getCustomEmojiStickers' => Types::Array.of(Types::Sticker),
@@ -160,6 +173,8 @@ module Telegram
160
173
  'setStickerSetThumbnail' => Types::Bool,
161
174
  'setCustomEmojiStickerSetThumbnail' => Types::Bool,
162
175
  'deleteStickerSet' => Types::Bool,
176
+ 'sendRichMessage' => Types::Message,
177
+ 'sendRichMessageDraft' => Types::Bool,
163
178
  'answerInlineQuery' => Types::Bool,
164
179
  'sendInvoice' => Types::Message,
165
180
  'createInvoiceLink' => Types::String,
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class BotAccessSettings < Base
7
+ attribute :is_access_restricted, Types::Bool
8
+ attribute? :added_users, Types::Array.of(User)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -6,6 +6,7 @@ module Telegram
6
6
  class BotCommand < Base
7
7
  attribute :command, Types::String.constrained(min_size: 1, max_size: 32)
8
8
  attribute :description, Types::String.constrained(min_size: 1, max_size: 256)
9
+ attribute? :is_ephemeral, Types::Bool
9
10
  end
10
11
  end
11
12
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class BotSubscriptionUpdated < Base
7
+ attribute :user, User
8
+ attribute :invoice_payload, Types::String
9
+ attribute :state, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -55,6 +55,8 @@ module Telegram
55
55
  attribute? :first_profile_audio, Audio
56
56
  attribute? :unique_gift_colors, UniqueGiftColors
57
57
  attribute? :paid_message_star_count, Types::Integer
58
+ attribute? :guard_bot, User
59
+ attribute? :community, Community
58
60
  end
59
61
  end
60
62
  end
@@ -10,6 +10,7 @@ module Telegram
10
10
  attribute :date, Types::Integer
11
11
  attribute? :bio, Types::String
12
12
  attribute? :invite_link, ChatInviteLink
13
+ attribute? :query_id, Types::String
13
14
  end
14
15
  end
15
16
  end
@@ -18,6 +18,7 @@ module Telegram
18
18
  attribute :can_send_polls, Types::Bool
19
19
  attribute :can_send_other_messages, Types::Bool
20
20
  attribute :can_add_web_page_previews, Types::Bool
21
+ attribute :can_react_to_messages, Types::Bool
21
22
  attribute :can_edit_tag, Types::Bool
22
23
  attribute :can_change_info, Types::Bool
23
24
  attribute :can_invite_users, Types::Bool
@@ -14,6 +14,7 @@ module Telegram
14
14
  attribute? :can_send_polls, Types::Bool
15
15
  attribute? :can_send_other_messages, Types::Bool
16
16
  attribute? :can_add_web_page_previews, Types::Bool
17
+ attribute? :can_react_to_messages, Types::Bool
17
18
  attribute? :can_edit_tag, Types::Bool
18
19
  attribute? :can_change_info, Types::Bool
19
20
  attribute? :can_invite_users, Types::Bool
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class Community < Base
7
+ attribute :id, Types::Integer
8
+ attribute :name, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class CommunityChatAdded < Base
7
+ attribute :community, Community
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class CommunityChatRemoved < Base
7
+ end
8
+ end
9
+ end
10
+ end
@@ -11,6 +11,7 @@ module Telegram
11
11
  attribute? :animation, Animation
12
12
  attribute? :audio, Audio
13
13
  attribute? :document, Document
14
+ attribute? :live_photo, LivePhoto
14
15
  attribute? :paid_media, PaidMediaInfo
15
16
  attribute? :photo, Types::Array.of(PhotoSize)
16
17
  attribute? :sticker, Sticker
@@ -10,7 +10,7 @@ module Telegram
10
10
  attribute :longitude, Types::Float
11
11
  attribute :title, Types::String
12
12
  attribute? :horizontal_accuracy, Types::Float
13
- attribute? :live_period, Types::Integer
13
+ attribute? :live_period, Types::Integer.constrained(min_size: 60, max_size: 86_400)
14
14
  attribute? :heading, Types::Integer
15
15
  attribute? :proximity_alert_radius, Types::Integer
16
16
  attribute? :reply_markup, InlineKeyboardMarkup
@@ -7,7 +7,7 @@ module Telegram
7
7
  attribute :latitude, Types::Float
8
8
  attribute :longitude, Types::Float
9
9
  attribute? :horizontal_accuracy, Types::Float
10
- attribute? :live_period, Types::Integer
10
+ attribute? :live_period, Types::Integer.constrained(min_size: 60, max_size: 86_400)
11
11
  attribute? :heading, Types::Integer
12
12
  attribute? :proximity_alert_radius, Types::Integer
13
13
  end
@@ -7,8 +7,9 @@ module Telegram
7
7
  # rubocop:disable Naming/ConstantName
8
8
  InputMedia = (
9
9
  InputMediaAnimation |
10
- InputMediaDocument |
11
10
  InputMediaAudio |
11
+ InputMediaDocument |
12
+ InputMediaLivePhoto |
12
13
  InputMediaPhoto |
13
14
  InputMediaVideo
14
15
  )
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputMediaLink < Base
7
+ attribute :type, Types::String.constrained(eql: 'link').default('link')
8
+ attribute :url, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputMediaLivePhoto < Base
7
+ attribute :type, Types::String.constrained(eql: 'live_photo').default('live_photo')
8
+ attribute :media, Types::String
9
+ attribute :photo, Types::String
10
+ attribute? :caption, Types::String
11
+ attribute? :parse_mode, Types::String
12
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
13
+ attribute? :show_caption_above_media, Types::Bool
14
+ attribute? :has_spoiler, Types::Bool
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputMediaLocation < Base
7
+ attribute :type, Types::String.constrained(eql: 'location').default('location')
8
+ attribute :latitude, Types::Float
9
+ attribute :longitude, Types::Float
10
+ attribute? :horizontal_accuracy, Types::Float
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputMediaSticker < Base
7
+ attribute :type, Types::String.constrained(eql: 'sticker').default('sticker')
8
+ attribute :media, Types::String
9
+ attribute? :emoji, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputMediaVenue < Base
7
+ attribute :type, Types::String.constrained(eql: 'venue').default('venue')
8
+ attribute :latitude, Types::Float
9
+ attribute :longitude, Types::Float
10
+ attribute :title, Types::String
11
+ attribute :address, Types::String
12
+ attribute? :foursquare_id, Types::String
13
+ attribute? :foursquare_type, Types::String
14
+ attribute? :google_place_id, Types::String
15
+ attribute? :google_place_type, Types::String
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputMediaVoiceNote < Base
7
+ attribute :type, Types::String.constrained(eql: 'voice_note').default('voice_note')
8
+ attribute :media, Types::String
9
+ attribute? :caption, Types::String
10
+ attribute? :parse_mode, Types::String
11
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
12
+ attribute? :duration, Types::Integer
13
+ end
14
+ end
15
+ end
16
+ end
@@ -7,6 +7,7 @@ module Telegram
7
7
  # rubocop:disable Naming/ConstantName
8
8
  InputMessageContent = (
9
9
  InputTextMessageContent |
10
+ InputRichMessageContent |
10
11
  InputLocationMessageContent |
11
12
  InputVenueMessageContent |
12
13
  InputContactMessageContent |
@@ -6,6 +6,7 @@ module Telegram
6
6
  ## Just for classes consistency
7
7
  # rubocop:disable Naming/ConstantName
8
8
  InputPaidMedia = (
9
+ InputPaidMediaLivePhoto |
9
10
  InputPaidMediaPhoto |
10
11
  InputPaidMediaVideo
11
12
  )
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputPaidMediaLivePhoto < Base
7
+ attribute :type, Types::String.constrained(eql: 'live_photo').default('live_photo')
8
+ attribute :media, Types::String
9
+ attribute :photo, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,21 @@
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
+ InputPollMedia = (
9
+ InputMediaAnimation |
10
+ InputMediaAudio |
11
+ InputMediaDocument |
12
+ InputMediaLivePhoto |
13
+ InputMediaLocation |
14
+ InputMediaPhoto |
15
+ InputMediaVenue |
16
+ InputMediaVideo
17
+ )
18
+ # rubocop:enable Naming/ConstantName
19
+ end
20
+ end
21
+ end
@@ -7,6 +7,7 @@ module Telegram
7
7
  attribute :text, Types::String.constrained(min_size: 1, max_size: 100)
8
8
  attribute? :text_parse_mode, Types::String
9
9
  attribute? :text_entities, Types::Array.of(MessageEntity)
10
+ attribute? :media, InputPollOptionMedia
10
11
  end
11
12
  end
12
13
  end
@@ -0,0 +1,21 @@
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
+ InputPollOptionMedia = (
9
+ InputMediaAnimation |
10
+ InputMediaLink |
11
+ InputMediaLivePhoto |
12
+ InputMediaLocation |
13
+ InputMediaPhoto |
14
+ InputMediaSticker |
15
+ InputMediaVenue |
16
+ InputMediaVideo
17
+ )
18
+ # rubocop:enable Naming/ConstantName
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,34 @@
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
+ InputRichBlock = (
9
+ InputRichBlockParagraph |
10
+ InputRichBlockSectionHeading |
11
+ InputRichBlockPreformatted |
12
+ InputRichBlockFooter |
13
+ InputRichBlockDivider |
14
+ InputRichBlockMathematicalExpression |
15
+ InputRichBlockAnchor |
16
+ InputRichBlockList |
17
+ InputRichBlockBlockQuotation |
18
+ InputRichBlockPullQuotation |
19
+ InputRichBlockCollage |
20
+ InputRichBlockSlideshow |
21
+ InputRichBlockTable |
22
+ InputRichBlockDetails |
23
+ InputRichBlockMap |
24
+ InputRichBlockAnimation |
25
+ InputRichBlockAudio |
26
+ InputRichBlockPhoto |
27
+ InputRichBlockVideo |
28
+ InputRichBlockVoiceNote |
29
+ InputRichBlockThinking
30
+ )
31
+ # rubocop:enable Naming/ConstantName
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockAnchor < Base
7
+ attribute :type, Types::String.constrained(eql: 'anchor').default('anchor')
8
+ attribute :name, Types::String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockAnimation < Base
7
+ attribute :type, Types::String.constrained(eql: 'animation').default('animation')
8
+ attribute :animation, InputMediaAnimation
9
+ attribute? :caption, RichBlockCaption
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockAudio < Base
7
+ attribute :type, Types::String.constrained(eql: 'audio').default('audio')
8
+ attribute :audio, InputMediaAudio
9
+ attribute? :caption, RichBlockCaption
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockBlockQuotation < Base
7
+ attribute :type, Types::String.constrained(eql: 'blockquote').default('blockquote')
8
+ attribute :blocks, Types::Array.of(Types.deferred(:InputRichBlock))
9
+ attribute? :credit, RichText
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockCollage < Base
7
+ attribute :type, Types::String.constrained(eql: 'collage').default('collage')
8
+ attribute :blocks, Types::Array.of(Types.deferred(:InputRichBlock))
9
+ attribute? :caption, RichBlockCaption
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockDetails < Base
7
+ attribute :type, Types::String.constrained(eql: 'details').default('details')
8
+ attribute :summary, RichText
9
+ attribute :blocks, Types::Array.of(Types.deferred(:InputRichBlock))
10
+ attribute? :is_open, Types::True
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockDivider < Base
7
+ attribute :type, Types::String.constrained(eql: 'divider').default('divider')
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockFooter < Base
7
+ attribute :type, Types::String.constrained(eql: 'footer').default('footer')
8
+ attribute :text, RichText
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockList < Base
7
+ attribute :type, Types::String.constrained(eql: 'list').default('list')
8
+ attribute :items, Types::Array.of(InputRichBlockListItem)
9
+ end
10
+ end
11
+ end
12
+ end