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
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichBlockParagraph < 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,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichBlockPhoto < Base
7
+ attribute :type, Types::String.constrained(eql: 'photo').default('photo')
8
+ attribute :photo, Types::Array.of(PhotoSize)
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 RichBlockPreformatted < 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 RichBlockPullQuotation < 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 RichBlockSectionHeading < 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 RichBlockSlideshow < Base
7
+ attribute :type, Types::String.constrained(eql: 'slideshow').default('slideshow')
8
+ attribute :blocks, Types::Array.of(Types.deferred(:RichBlock))
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 RichBlockTable < 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,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichBlockTableCell < Base
7
+ attribute? :text, RichText
8
+ attribute? :is_header, Types::True
9
+ attribute? :colspan, Types::Integer
10
+ attribute? :rowspan, Types::Integer
11
+ attribute :align, Types::String
12
+ attribute :valign, Types::String
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 RichBlockThinking < 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,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichBlockVideo < Base
7
+ attribute :type, Types::String.constrained(eql: 'video').default('video')
8
+ attribute :video, Video
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 RichBlockVoiceNote < Base
7
+ attribute :type, Types::String.constrained(eql: 'voice_note').default('voice_note')
8
+ attribute :voice_note, Voice
9
+ attribute? :caption, RichBlockCaption
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichMessage < Base
7
+ attribute :blocks, Types::Array.of(RichBlock)
8
+ attribute? :is_rtl, Types::Bool
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,38 @@
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
+ RichText = (
9
+ RichTextBold |
10
+ RichTextItalic |
11
+ RichTextUnderline |
12
+ RichTextStrikethrough |
13
+ RichTextSpoiler |
14
+ RichTextDateTime |
15
+ RichTextTextMention |
16
+ RichTextSubscript |
17
+ RichTextSuperscript |
18
+ RichTextMarked |
19
+ RichTextCode |
20
+ RichTextCustomEmoji |
21
+ RichTextMathematicalExpression |
22
+ RichTextUrl |
23
+ RichTextEmailAddress |
24
+ RichTextPhoneNumber |
25
+ RichTextBankCardNumber |
26
+ RichTextMention |
27
+ RichTextHashtag |
28
+ RichTextCashtag |
29
+ RichTextBotCommand |
30
+ RichTextAnchor |
31
+ RichTextAnchorLink |
32
+ RichTextReference |
33
+ RichTextReferenceLink
34
+ )
35
+ # rubocop:enable Naming/ConstantName
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichTextAnchor < 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 RichTextAnchorLink < Base
7
+ attribute :type, Types::String.constrained(eql: 'anchor_link').default('anchor_link')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :anchor_name, 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 RichTextBankCardNumber < Base
7
+ attribute :type, Types::String.constrained(eql: 'bank_card_number').default('bank_card_number')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :bank_card_number, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichTextBold < Base
7
+ attribute :type, Types::String.constrained(eql: 'bold').default('bold')
8
+ attribute :text, Types.deferred(: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 RichTextBotCommand < Base
7
+ attribute :type, Types::String.constrained(eql: 'bot_command').default('bot_command')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :bot_command, 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 RichTextCashtag < Base
7
+ attribute :type, Types::String.constrained(eql: 'cashtag').default('cashtag')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :cashtag, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichTextCode < Base
7
+ attribute :type, Types::String.constrained(eql: 'code').default('code')
8
+ attribute :text, Types.deferred(: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 RichTextCustomEmoji < Base
7
+ attribute :type, Types::String.constrained(eql: 'custom_emoji').default('custom_emoji')
8
+ attribute :custom_emoji_id, Types::String
9
+ attribute :alternative_text, Types::String
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 RichTextDateTime < Base
7
+ attribute :type, Types::String.constrained(eql: 'date_time').default('date_time')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :unix_time, Types::Integer
10
+ attribute :date_time_format, Types::String
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 RichTextEmailAddress < Base
7
+ attribute :type, Types::String.constrained(eql: 'email_address').default('email_address')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :email_address, 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 RichTextHashtag < Base
7
+ attribute :type, Types::String.constrained(eql: 'hashtag').default('hashtag')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :hashtag, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichTextItalic < Base
7
+ attribute :type, Types::String.constrained(eql: 'italic').default('italic')
8
+ attribute :text, Types.deferred(: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 RichTextMarked < Base
7
+ attribute :type, Types::String.constrained(eql: 'marked').default('marked')
8
+ attribute :text, Types.deferred(: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 RichTextMathematicalExpression < 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,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichTextMention < Base
7
+ attribute :type, Types::String.constrained(eql: 'mention').default('mention')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :username, 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 RichTextPhoneNumber < Base
7
+ attribute :type, Types::String.constrained(eql: 'phone_number').default('phone_number')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :phone_number, 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 RichTextReference < Base
7
+ attribute :type, Types::String.constrained(eql: 'reference').default('reference')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :name, 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 RichTextReferenceLink < Base
7
+ attribute :type, Types::String.constrained(eql: 'reference_link').default('reference_link')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :reference_name, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichTextSpoiler < Base
7
+ attribute :type, Types::String.constrained(eql: 'spoiler').default('spoiler')
8
+ attribute :text, Types.deferred(: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 RichTextStrikethrough < Base
7
+ attribute :type, Types::String.constrained(eql: 'strikethrough').default('strikethrough')
8
+ attribute :text, Types.deferred(: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 RichTextSubscript < Base
7
+ attribute :type, Types::String.constrained(eql: 'subscript').default('subscript')
8
+ attribute :text, Types.deferred(: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 RichTextSuperscript < Base
7
+ attribute :type, Types::String.constrained(eql: 'superscript').default('superscript')
8
+ attribute :text, Types.deferred(: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 RichTextTextMention < Base
7
+ attribute :type, Types::String.constrained(eql: 'text_mention').default('text_mention')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :user, User
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class RichTextUnderline < Base
7
+ attribute :type, Types::String.constrained(eql: 'underline').default('underline')
8
+ attribute :text, Types.deferred(: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 RichTextUrl < Base
7
+ attribute :type, Types::String.constrained(eql: 'url').default('url')
8
+ attribute :text, Types.deferred(:RichText)
9
+ attribute :url, 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 SentGuestMessage < Base
7
+ attribute :inline_message_id, Types::String
8
+ end
9
+ end
10
+ end
11
+ end
@@ -13,6 +13,7 @@ module Telegram
13
13
  attribute? :business_message, Message
14
14
  attribute? :edited_business_message, Message
15
15
  attribute? :deleted_business_messages, BusinessMessagesDeleted
16
+ attribute? :guest_message, Message
16
17
  attribute? :message_reaction, MessageReactionUpdated
17
18
  attribute? :message_reaction_count, MessageReactionCountUpdated
18
19
  attribute? :inline_query, InlineQuery
@@ -29,6 +30,7 @@ module Telegram
29
30
  attribute? :chat_boost, ChatBoostUpdated
30
31
  attribute? :removed_chat_boost, ChatBoostRemoved
31
32
  attribute? :managed_bot, ManagedBotUpdated
33
+ attribute? :subscription, BotSubscriptionUpdated
32
34
 
33
35
  def current_message
34
36
  @current_message ||=
@@ -14,12 +14,14 @@ module Telegram
14
14
  attribute? :added_to_attachment_menu, Types::True
15
15
  attribute? :can_join_groups, Types::Bool
16
16
  attribute? :can_read_all_group_messages, Types::Bool
17
+ attribute? :supports_guest_queries, Types::Bool
17
18
  attribute? :supports_inline_queries, Types::Bool
18
19
  attribute? :can_connect_to_business, Types::Bool
19
20
  attribute? :has_main_web_app, Types::Bool
20
21
  attribute? :has_topics_enabled, Types::Bool
21
22
  attribute? :allows_users_to_create_topics, Types::Bool
22
23
  attribute? :can_manage_bots, Types::Bool
24
+ attribute? :supports_join_request_queries, Types::Bool
23
25
  end
24
26
  end
25
27
  end
@@ -4,6 +4,12 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  include Dry.Types()
7
+
8
+ def self.deferred(name)
9
+ Any.constructor do |value, _, &fallback|
10
+ const_get(name, false).call(value, &fallback)
11
+ end
12
+ end
7
13
  end
8
14
  end
9
15
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Telegram
4
4
  module Bot
5
- VERSION = '2.7.0'
5
+ VERSION = '2.8.0'
6
6
  end
7
7
  end