telegram-bot-ruby 2.6.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 (137) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +4 -2
  3. data/CHANGELOG.md +12 -0
  4. data/Gemfile +1 -1
  5. data/README.md +6 -9
  6. data/lib/telegram/bot/api/endpoints.rb +21 -3
  7. data/lib/telegram/bot/types/bot_access_settings.rb +12 -0
  8. data/lib/telegram/bot/types/bot_command.rb +1 -0
  9. data/lib/telegram/bot/types/bot_subscription_updated.rb +13 -0
  10. data/lib/telegram/bot/types/chat_full_info.rb +2 -0
  11. data/lib/telegram/bot/types/chat_join_request.rb +1 -0
  12. data/lib/telegram/bot/types/chat_member_restricted.rb +1 -0
  13. data/lib/telegram/bot/types/chat_permissions.rb +1 -0
  14. data/lib/telegram/bot/types/community.rb +12 -0
  15. data/lib/telegram/bot/types/community_chat_added.rb +11 -0
  16. data/lib/telegram/bot/types/community_chat_removed.rb +10 -0
  17. data/lib/telegram/bot/types/external_reply_info.rb +1 -0
  18. data/lib/telegram/bot/types/inline_query_result_location.rb +1 -1
  19. data/lib/telegram/bot/types/input_location_message_content.rb +1 -1
  20. data/lib/telegram/bot/types/input_media.rb +2 -1
  21. data/lib/telegram/bot/types/input_media_link.rb +12 -0
  22. data/lib/telegram/bot/types/input_media_live_photo.rb +18 -0
  23. data/lib/telegram/bot/types/input_media_location.rb +14 -0
  24. data/lib/telegram/bot/types/input_media_sticker.rb +13 -0
  25. data/lib/telegram/bot/types/input_media_venue.rb +19 -0
  26. data/lib/telegram/bot/types/input_media_voice_note.rb +16 -0
  27. data/lib/telegram/bot/types/input_message_content.rb +1 -0
  28. data/lib/telegram/bot/types/input_paid_media.rb +1 -0
  29. data/lib/telegram/bot/types/input_paid_media_live_photo.rb +13 -0
  30. data/lib/telegram/bot/types/input_poll_media.rb +21 -0
  31. data/lib/telegram/bot/types/input_poll_option.rb +1 -0
  32. data/lib/telegram/bot/types/input_poll_option_media.rb +21 -0
  33. data/lib/telegram/bot/types/input_rich_block.rb +34 -0
  34. data/lib/telegram/bot/types/input_rich_block_anchor.rb +12 -0
  35. data/lib/telegram/bot/types/input_rich_block_animation.rb +13 -0
  36. data/lib/telegram/bot/types/input_rich_block_audio.rb +13 -0
  37. data/lib/telegram/bot/types/input_rich_block_block_quotation.rb +13 -0
  38. data/lib/telegram/bot/types/input_rich_block_collage.rb +13 -0
  39. data/lib/telegram/bot/types/input_rich_block_details.rb +14 -0
  40. data/lib/telegram/bot/types/input_rich_block_divider.rb +11 -0
  41. data/lib/telegram/bot/types/input_rich_block_footer.rb +12 -0
  42. data/lib/telegram/bot/types/input_rich_block_list.rb +12 -0
  43. data/lib/telegram/bot/types/input_rich_block_list_item.rb +15 -0
  44. data/lib/telegram/bot/types/input_rich_block_map.rb +16 -0
  45. data/lib/telegram/bot/types/input_rich_block_mathematical_expression.rb +12 -0
  46. data/lib/telegram/bot/types/input_rich_block_paragraph.rb +12 -0
  47. data/lib/telegram/bot/types/input_rich_block_photo.rb +13 -0
  48. data/lib/telegram/bot/types/input_rich_block_preformatted.rb +13 -0
  49. data/lib/telegram/bot/types/input_rich_block_pull_quotation.rb +13 -0
  50. data/lib/telegram/bot/types/input_rich_block_section_heading.rb +13 -0
  51. data/lib/telegram/bot/types/input_rich_block_slideshow.rb +13 -0
  52. data/lib/telegram/bot/types/input_rich_block_table.rb +15 -0
  53. data/lib/telegram/bot/types/input_rich_block_thinking.rb +12 -0
  54. data/lib/telegram/bot/types/input_rich_block_video.rb +13 -0
  55. data/lib/telegram/bot/types/input_rich_block_voice_note.rb +13 -0
  56. data/lib/telegram/bot/types/input_rich_message.rb +16 -0
  57. data/lib/telegram/bot/types/input_rich_message_content.rb +11 -0
  58. data/lib/telegram/bot/types/input_rich_message_media.rb +13 -0
  59. data/lib/telegram/bot/types/keyboard_button.rb +1 -0
  60. data/lib/telegram/bot/types/keyboard_button_request_managed_bot.rb +13 -0
  61. data/lib/telegram/bot/types/link.rb +11 -0
  62. data/lib/telegram/bot/types/live_photo.rb +18 -0
  63. data/lib/telegram/bot/types/managed_bot_created.rb +11 -0
  64. data/lib/telegram/bot/types/managed_bot_updated.rb +12 -0
  65. data/lib/telegram/bot/types/message.rb +14 -1
  66. data/lib/telegram/bot/types/paid_media.rb +2 -1
  67. data/lib/telegram/bot/types/paid_media_live_photo.rb +12 -0
  68. data/lib/telegram/bot/types/poll.rb +8 -1
  69. data/lib/telegram/bot/types/poll_answer.rb +1 -0
  70. data/lib/telegram/bot/types/poll_media.rb +20 -0
  71. data/lib/telegram/bot/types/poll_option.rb +5 -0
  72. data/lib/telegram/bot/types/poll_option_added.rb +14 -0
  73. data/lib/telegram/bot/types/poll_option_deleted.rb +14 -0
  74. data/lib/telegram/bot/types/prepared_keyboard_button.rb +11 -0
  75. data/lib/telegram/bot/types/reply_parameters.rb +3 -1
  76. data/lib/telegram/bot/types/rich_block.rb +34 -0
  77. data/lib/telegram/bot/types/rich_block_anchor.rb +12 -0
  78. data/lib/telegram/bot/types/rich_block_animation.rb +14 -0
  79. data/lib/telegram/bot/types/rich_block_audio.rb +13 -0
  80. data/lib/telegram/bot/types/rich_block_block_quotation.rb +13 -0
  81. data/lib/telegram/bot/types/rich_block_caption.rb +12 -0
  82. data/lib/telegram/bot/types/rich_block_collage.rb +13 -0
  83. data/lib/telegram/bot/types/rich_block_details.rb +14 -0
  84. data/lib/telegram/bot/types/rich_block_divider.rb +11 -0
  85. data/lib/telegram/bot/types/rich_block_footer.rb +12 -0
  86. data/lib/telegram/bot/types/rich_block_list.rb +12 -0
  87. data/lib/telegram/bot/types/rich_block_list_item.rb +16 -0
  88. data/lib/telegram/bot/types/rich_block_map.rb +16 -0
  89. data/lib/telegram/bot/types/rich_block_mathematical_expression.rb +12 -0
  90. data/lib/telegram/bot/types/rich_block_paragraph.rb +12 -0
  91. data/lib/telegram/bot/types/rich_block_photo.rb +14 -0
  92. data/lib/telegram/bot/types/rich_block_preformatted.rb +13 -0
  93. data/lib/telegram/bot/types/rich_block_pull_quotation.rb +13 -0
  94. data/lib/telegram/bot/types/rich_block_section_heading.rb +13 -0
  95. data/lib/telegram/bot/types/rich_block_slideshow.rb +13 -0
  96. data/lib/telegram/bot/types/rich_block_table.rb +15 -0
  97. data/lib/telegram/bot/types/rich_block_table_cell.rb +16 -0
  98. data/lib/telegram/bot/types/rich_block_thinking.rb +12 -0
  99. data/lib/telegram/bot/types/rich_block_video.rb +14 -0
  100. data/lib/telegram/bot/types/rich_block_voice_note.rb +13 -0
  101. data/lib/telegram/bot/types/rich_message.rb +12 -0
  102. data/lib/telegram/bot/types/rich_text.rb +38 -0
  103. data/lib/telegram/bot/types/rich_text_anchor.rb +12 -0
  104. data/lib/telegram/bot/types/rich_text_anchor_link.rb +13 -0
  105. data/lib/telegram/bot/types/rich_text_bank_card_number.rb +13 -0
  106. data/lib/telegram/bot/types/rich_text_bold.rb +12 -0
  107. data/lib/telegram/bot/types/rich_text_bot_command.rb +13 -0
  108. data/lib/telegram/bot/types/rich_text_cashtag.rb +13 -0
  109. data/lib/telegram/bot/types/rich_text_code.rb +12 -0
  110. data/lib/telegram/bot/types/rich_text_custom_emoji.rb +13 -0
  111. data/lib/telegram/bot/types/rich_text_date_time.rb +14 -0
  112. data/lib/telegram/bot/types/rich_text_email_address.rb +13 -0
  113. data/lib/telegram/bot/types/rich_text_hashtag.rb +13 -0
  114. data/lib/telegram/bot/types/rich_text_italic.rb +12 -0
  115. data/lib/telegram/bot/types/rich_text_marked.rb +12 -0
  116. data/lib/telegram/bot/types/rich_text_mathematical_expression.rb +12 -0
  117. data/lib/telegram/bot/types/rich_text_mention.rb +13 -0
  118. data/lib/telegram/bot/types/rich_text_phone_number.rb +13 -0
  119. data/lib/telegram/bot/types/rich_text_reference.rb +13 -0
  120. data/lib/telegram/bot/types/rich_text_reference_link.rb +13 -0
  121. data/lib/telegram/bot/types/rich_text_spoiler.rb +12 -0
  122. data/lib/telegram/bot/types/rich_text_strikethrough.rb +12 -0
  123. data/lib/telegram/bot/types/rich_text_subscript.rb +12 -0
  124. data/lib/telegram/bot/types/rich_text_superscript.rb +12 -0
  125. data/lib/telegram/bot/types/rich_text_text_mention.rb +13 -0
  126. data/lib/telegram/bot/types/rich_text_underline.rb +12 -0
  127. data/lib/telegram/bot/types/rich_text_url.rb +13 -0
  128. data/lib/telegram/bot/types/sent_guest_message.rb +11 -0
  129. data/lib/telegram/bot/types/update.rb +3 -0
  130. data/lib/telegram/bot/types/user.rb +3 -0
  131. data/lib/telegram/bot/types.rb +6 -0
  132. data/lib/telegram/bot/version.rb +1 -1
  133. data/mise.toml +2 -0
  134. data/rakelib/builders/type_builder.rb +5 -2
  135. data/rakelib/builders/type_dependencies.rb +45 -0
  136. data/rakelib/rebuild.rake +4 -1
  137. metadata +107 -2
@@ -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
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichBlockListItem < Base
7
+ attribute :blocks, Types::Array.of(Types.deferred(:InputRichBlock))
8
+ attribute? :has_checkbox, Types::True
9
+ attribute? :is_checked, Types::True
10
+ attribute? :value, Types::Integer
11
+ attribute? :type, Types::String
12
+ end
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
+ class InputRichBlockMap < Base
7
+ attribute :type, Types::String.constrained(eql: 'map').default('map')
8
+ attribute :location, Location
9
+ attribute :zoom, Types::Integer
10
+ attribute :width, Types::Integer
11
+ attribute :height, Types::Integer
12
+ attribute? :caption, RichBlockCaption
13
+ end
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 InputRichBlockMathematicalExpression < Base
7
+ attribute :type, Types::String.constrained(eql: 'mathematical_expression').default('mathematical_expression')
8
+ attribute :expression, Types::String
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 InputRichBlockParagraph < Base
7
+ attribute :type, Types::String.constrained(eql: 'paragraph').default('paragraph')
8
+ attribute :text, RichText
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 InputRichBlockPhoto < Base
7
+ attribute :type, Types::String.constrained(eql: 'photo').default('photo')
8
+ attribute :photo, InputMediaPhoto
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 InputRichBlockPreformatted < Base
7
+ attribute :type, Types::String.constrained(eql: 'pre').default('pre')
8
+ attribute :text, RichText
9
+ attribute? :language, Types::String
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 InputRichBlockPullQuotation < Base
7
+ attribute :type, Types::String.constrained(eql: 'pullquote').default('pullquote')
8
+ attribute :text, RichText
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 InputRichBlockSectionHeading < Base
7
+ attribute :type, Types::String.constrained(eql: 'heading').default('heading')
8
+ attribute :text, RichText
9
+ attribute :size, Types::Integer
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 InputRichBlockSlideshow < Base
7
+ attribute :type, Types::String.constrained(eql: 'slideshow').default('slideshow')
8
+ attribute :blocks, Types::Array.of(Types.deferred(:InputRichBlock))
9
+ attribute? :caption, RichBlockCaption
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 InputRichBlockTable < Base
7
+ attribute :type, Types::String.constrained(eql: 'table').default('table')
8
+ attribute :cells, Types::Array.of(Types::Array.of(RichBlockTableCell))
9
+ attribute? :is_bordered, Types::True
10
+ attribute? :is_striped, Types::True
11
+ attribute? :caption, RichText
12
+ end
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 InputRichBlockThinking < Base
7
+ attribute :type, Types::String.constrained(eql: 'thinking').default('thinking')
8
+ attribute :text, RichText
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 InputRichBlockVideo < Base
7
+ attribute :type, Types::String.constrained(eql: 'video').default('video')
8
+ attribute :video, InputMediaVideo
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 InputRichBlockVoiceNote < Base
7
+ attribute :type, Types::String.constrained(eql: 'voice_note').default('voice_note')
8
+ attribute :voice_note, InputMediaVoiceNote
9
+ attribute? :caption, RichBlockCaption
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichMessage < Base
7
+ attribute? :blocks, Types::Array.of(InputRichBlock)
8
+ attribute? :html, Types::String
9
+ attribute? :markdown, Types::String
10
+ attribute? :media, Types::Array.of(InputRichMessageMedia)
11
+ attribute? :is_rtl, Types::Bool
12
+ attribute? :skip_entity_detection, Types::Bool
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichMessageContent < Base
7
+ attribute :rich_message, InputRichMessage
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class InputRichMessageMedia < Base
7
+ attribute :id, Types::String.constrained(min_size: 1, max_size: 64)
8
+ attribute :media,
9
+ InputMediaAnimation | InputMediaAudio | InputMediaPhoto | InputMediaVideo | InputMediaVoiceNote
10
+ end
11
+ end
12
+ end
13
+ end
@@ -9,6 +9,7 @@ module Telegram
9
9
  attribute? :style, Types::String
10
10
  attribute? :request_users, KeyboardButtonRequestUsers
11
11
  attribute? :request_chat, KeyboardButtonRequestChat
12
+ attribute? :request_managed_bot, KeyboardButtonRequestManagedBot
12
13
  attribute? :request_contact, Types::Bool
13
14
  attribute? :request_location, Types::Bool
14
15
  attribute? :request_poll, KeyboardButtonPollType
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class KeyboardButtonRequestManagedBot < Base
7
+ attribute :request_id, Types::Integer
8
+ attribute? :suggested_name, Types::String
9
+ attribute? :suggested_username, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class Link < Base
7
+ attribute :url, Types::String
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class LivePhoto < Base
7
+ attribute? :photo, Types::Array.of(PhotoSize)
8
+ attribute :file_id, Types::String
9
+ attribute :file_unique_id, Types::String
10
+ attribute :width, Types::Integer
11
+ attribute :height, Types::Integer
12
+ attribute :duration, Types::Integer
13
+ attribute? :mime_type, Types::String
14
+ attribute? :file_size, Types::Integer
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ManagedBotCreated < Base
7
+ attribute :bot, User
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 ManagedBotUpdated < Base
7
+ attribute :user, User
8
+ attribute :bot, User
9
+ end
10
+ end
11
+ end
12
+ end
@@ -12,7 +12,10 @@ module Telegram
12
12
  attribute? :sender_boost_count, Types::Integer
13
13
  attribute? :sender_business_bot, User
14
14
  attribute? :sender_tag, Types::String
15
+ attribute? :receiver_user, User
16
+ attribute? :ephemeral_message_id, Types::Integer
15
17
  attribute :date, Types::Integer
18
+ attribute? :guest_query_id, Types::String
16
19
  attribute? :business_connection_id, Types::String
17
20
  attribute :chat, Chat
18
21
  attribute? :forward_origin, MessageOrigin
@@ -23,7 +26,10 @@ module Telegram
23
26
  attribute? :quote, TextQuote
24
27
  attribute? :reply_to_story, Story
25
28
  attribute? :reply_to_checklist_task_id, Types::Integer
29
+ attribute? :reply_to_poll_option_id, Types::String
26
30
  attribute? :via_bot, User
31
+ attribute? :guest_bot_caller_user, User
32
+ attribute? :guest_bot_caller_chat, Chat
27
33
  attribute? :edit_date, Types::Integer
28
34
  attribute? :has_protected_content, Types::True
29
35
  attribute? :is_from_offline, Types::True
@@ -36,9 +42,11 @@ module Telegram
36
42
  attribute? :link_preview_options, LinkPreviewOptions
37
43
  attribute? :suggested_post_info, SuggestedPostInfo
38
44
  attribute? :effect_id, Types::String
45
+ attribute? :rich_message, RichMessage
39
46
  attribute? :animation, Animation
40
47
  attribute? :audio, Audio
41
48
  attribute? :document, Document
49
+ attribute? :live_photo, LivePhoto
42
50
  attribute? :paid_media, PaidMediaInfo
43
51
  attribute? :photo, Types::Array.of(PhotoSize)
44
52
  attribute? :sticker, Sticker
@@ -70,7 +78,7 @@ module Telegram
70
78
  attribute? :message_auto_delete_timer_changed, MessageAutoDeleteTimerChanged
71
79
  attribute? :migrate_to_chat_id, Types::Integer
72
80
  attribute? :migrate_from_chat_id, Types::Integer
73
- attribute? :pinned_message, MaybeInaccessibleMessage
81
+ attribute? :pinned_message, Types.deferred(:MaybeInaccessibleMessage)
74
82
  attribute? :invoice, Invoice
75
83
  attribute? :successful_payment, SuccessfulPayment
76
84
  attribute? :refunded_payment, RefundedPayment
@@ -87,6 +95,8 @@ module Telegram
87
95
  attribute? :chat_background_set, ChatBackground
88
96
  attribute? :checklist_tasks_done, ChecklistTasksDone
89
97
  attribute? :checklist_tasks_added, ChecklistTasksAdded
98
+ attribute? :community_chat_added, CommunityChatAdded
99
+ attribute? :community_chat_removed, CommunityChatRemoved
90
100
  attribute? :direct_message_price_changed, DirectMessagePriceChanged
91
101
  attribute? :forum_topic_created, ForumTopicCreated
92
102
  attribute? :forum_topic_edited, ForumTopicEdited
@@ -98,7 +108,10 @@ module Telegram
98
108
  attribute? :giveaway, Giveaway
99
109
  attribute? :giveaway_winners, GiveawayWinners
100
110
  attribute? :giveaway_completed, GiveawayCompleted
111
+ attribute? :managed_bot_created, ManagedBotCreated
101
112
  attribute? :paid_message_price_changed, PaidMessagePriceChanged
113
+ attribute? :poll_option_added, PollOptionAdded
114
+ attribute? :poll_option_deleted, PollOptionDeleted
102
115
  attribute? :suggested_post_approved, SuggestedPostApproved
103
116
  attribute? :suggested_post_approval_failed, SuggestedPostApprovalFailed
104
117
  attribute? :suggested_post_declined, SuggestedPostDeclined
@@ -6,8 +6,9 @@ module Telegram
6
6
  ## Just for classes consistency
7
7
  # rubocop:disable Naming/ConstantName
8
8
  PaidMedia = (
9
- PaidMediaPreview |
9
+ PaidMediaLivePhoto |
10
10
  PaidMediaPhoto |
11
+ PaidMediaPreview |
11
12
  PaidMediaVideo
12
13
  )
13
14
  # rubocop:enable Naming/ConstantName
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class PaidMediaLivePhoto < Base
7
+ attribute :type, Types::String.constrained(eql: 'live_photo').default('live_photo')
8
+ attribute :live_photo, LivePhoto
9
+ end
10
+ end
11
+ end
12
+ end
@@ -13,11 +13,18 @@ module Telegram
13
13
  attribute :is_anonymous, Types::Bool
14
14
  attribute :type, Types::String
15
15
  attribute :allows_multiple_answers, Types::Bool
16
- attribute? :correct_option_id, Types::Integer
16
+ attribute :allows_revoting, Types::Bool
17
+ attribute :members_only, Types::Bool
18
+ attribute? :country_codes, Types::Array.of(Types::String)
19
+ attribute? :correct_option_ids, Types::Array.of(Types::Integer)
17
20
  attribute? :explanation, Types::String
18
21
  attribute? :explanation_entities, Types::Array.of(MessageEntity)
22
+ attribute? :explanation_media, PollMedia
19
23
  attribute? :open_period, Types::Integer
20
24
  attribute? :close_date, Types::Integer
25
+ attribute? :description, Types::String
26
+ attribute? :description_entities, Types::Array.of(MessageEntity)
27
+ attribute? :media, PollMedia
21
28
  end
22
29
  end
23
30
  end
@@ -8,6 +8,7 @@ module Telegram
8
8
  attribute? :voter_chat, Chat
9
9
  attribute? :user, User
10
10
  attribute :option_ids, Types::Array.of(Types::Integer)
11
+ attribute :option_persistent_ids, Types::Array.of(Types::String)
11
12
  end
12
13
  end
13
14
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class PollMedia < Base
7
+ attribute? :animation, Animation
8
+ attribute? :audio, Audio
9
+ attribute? :document, Document
10
+ attribute? :link, Link
11
+ attribute? :live_photo, LivePhoto
12
+ attribute? :location, Location
13
+ attribute? :photo, Types::Array.of(PhotoSize)
14
+ attribute? :sticker, Sticker
15
+ attribute? :venue, Venue
16
+ attribute? :video, Video
17
+ end
18
+ end
19
+ end
20
+ end
@@ -4,9 +4,14 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PollOption < Base
7
+ attribute :persistent_id, Types::String
7
8
  attribute :text, Types::String.constrained(min_size: 1, max_size: 100)
8
9
  attribute? :text_entities, Types::Array.of(MessageEntity)
10
+ attribute? :media, PollMedia
9
11
  attribute :voter_count, Types::Integer
12
+ attribute? :added_by_user, User
13
+ attribute? :added_by_chat, Chat
14
+ attribute? :addition_date, Types::Integer
10
15
  end
11
16
  end
12
17
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class PollOptionAdded < Base
7
+ attribute? :poll_message, Types.deferred(:MaybeInaccessibleMessage)
8
+ attribute :option_persistent_id, Types::String
9
+ attribute :option_text, Types::String
10
+ attribute? :option_text_entities, Types::Array.of(MessageEntity)
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class PollOptionDeleted < Base
7
+ attribute? :poll_message, Types.deferred(:MaybeInaccessibleMessage)
8
+ attribute :option_persistent_id, Types::String
9
+ attribute :option_text, Types::String
10
+ attribute? :option_text_entities, Types::Array.of(MessageEntity)
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 PreparedKeyboardButton < Base
7
+ attribute :id, Types::String
8
+ end
9
+ end
10
+ end
11
+ end
@@ -4,14 +4,16 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ReplyParameters < Base
7
- attribute :message_id, Types::Integer
7
+ attribute? :message_id, Types::Integer
8
8
  attribute? :chat_id, Types::Integer | Types::String
9
+ attribute? :ephemeral_message_id, Types::Integer
9
10
  attribute? :allow_sending_without_reply, Types::Bool
10
11
  attribute? :quote, Types::String
11
12
  attribute? :quote_parse_mode, Types::String
12
13
  attribute? :quote_entities, Types::Array.of(MessageEntity)
13
14
  attribute? :quote_position, Types::Integer
14
15
  attribute? :checklist_task_id, Types::Integer
16
+ attribute? :poll_option_id, Types::String
15
17
  end
16
18
  end
17
19
  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
+ RichBlock = (
9
+ RichBlockParagraph |
10
+ RichBlockSectionHeading |
11
+ RichBlockPreformatted |
12
+ RichBlockFooter |
13
+ RichBlockDivider |
14
+ RichBlockMathematicalExpression |
15
+ RichBlockAnchor |
16
+ RichBlockList |
17
+ RichBlockBlockQuotation |
18
+ RichBlockPullQuotation |
19
+ RichBlockCollage |
20
+ RichBlockSlideshow |
21
+ RichBlockTable |
22
+ RichBlockDetails |
23
+ RichBlockMap |
24
+ RichBlockAnimation |
25
+ RichBlockAudio |
26
+ RichBlockPhoto |
27
+ RichBlockVideo |
28
+ RichBlockVoiceNote |
29
+ RichBlockThinking
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 RichBlockAnchor < 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,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichBlockAnimation < Base
7
+ attribute :type, Types::String.constrained(eql: 'animation').default('animation')
8
+ attribute :animation, Animation
9
+ attribute? :has_spoiler, Types::True
10
+ attribute? :caption, RichBlockCaption
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 RichBlockAudio < Base
7
+ attribute :type, Types::String.constrained(eql: 'audio').default('audio')
8
+ attribute :audio, Audio
9
+ attribute? :caption, RichBlockCaption
10
+ end
11
+ end
12
+ end
13
+ end