telegram-bot-ruby 0.23.0 → 1.0.0.pre

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 (139) hide show
  1. checksums.yaml +4 -4
  2. data/.env.sample +2 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +2 -1
  5. data/README.md +25 -13
  6. data/Rakefile +43 -0
  7. data/lib/telegram/bot/types/animation.rb +9 -9
  8. data/lib/telegram/bot/types/audio.rb +9 -9
  9. data/lib/telegram/bot/types/base.rb +3 -2
  10. data/lib/telegram/bot/types/bot_command.rb +2 -2
  11. data/lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb +1 -1
  12. data/lib/telegram/bot/types/bot_command_scope_all_group_chats.rb +1 -1
  13. data/lib/telegram/bot/types/bot_command_scope_all_private_chats.rb +1 -1
  14. data/lib/telegram/bot/types/bot_command_scope_chat.rb +2 -2
  15. data/lib/telegram/bot/types/bot_command_scope_chat_administrators.rb +2 -2
  16. data/lib/telegram/bot/types/bot_command_scope_chat_member.rb +3 -3
  17. data/lib/telegram/bot/types/bot_command_scope_default.rb +1 -1
  18. data/lib/telegram/bot/types/callback_query.rb +6 -6
  19. data/lib/telegram/bot/types/chat.rb +27 -28
  20. data/lib/telegram/bot/types/chat_administrator_rights.rb +13 -12
  21. data/lib/telegram/bot/types/chat_invite_link.rb +8 -8
  22. data/lib/telegram/bot/types/chat_join_request.rb +3 -3
  23. data/lib/telegram/bot/types/chat_location.rb +1 -1
  24. data/lib/telegram/bot/types/chat_member.rb +0 -22
  25. data/lib/telegram/bot/types/chat_member_administrator.rb +26 -0
  26. data/lib/telegram/bot/types/chat_member_banned.rb +13 -0
  27. data/lib/telegram/bot/types/chat_member_left.rb +12 -0
  28. data/lib/telegram/bot/types/chat_member_member.rb +12 -0
  29. data/lib/telegram/bot/types/chat_member_owner.rb +14 -0
  30. data/lib/telegram/bot/types/chat_member_restricted.rb +23 -0
  31. data/lib/telegram/bot/types/chat_member_updated.rb +2 -2
  32. data/lib/telegram/bot/types/chat_permissions.rb +9 -8
  33. data/lib/telegram/bot/types/chat_photo.rb +4 -4
  34. data/lib/telegram/bot/types/chosen_inline_result.rb +4 -4
  35. data/lib/telegram/bot/types/contact.rb +5 -5
  36. data/lib/telegram/bot/types/dice.rb +2 -2
  37. data/lib/telegram/bot/types/document.rb +6 -6
  38. data/lib/telegram/bot/types/encrypted_credentials.rb +3 -3
  39. data/lib/telegram/bot/types/encrypted_passport_element.rb +10 -10
  40. data/lib/telegram/bot/types/file.rb +4 -4
  41. data/lib/telegram/bot/types/force_reply.rb +3 -3
  42. data/lib/telegram/bot/types/forum_topic.rb +14 -0
  43. data/lib/telegram/bot/types/forum_topic_closed.rb +10 -0
  44. data/lib/telegram/bot/types/forum_topic_created.rb +13 -0
  45. data/lib/telegram/bot/types/forum_topic_reopened.rb +10 -0
  46. data/lib/telegram/bot/types/game.rb +6 -6
  47. data/lib/telegram/bot/types/game_high_score.rb +2 -2
  48. data/lib/telegram/bot/types/inline_keyboard_button.rb +9 -9
  49. data/lib/telegram/bot/types/inline_keyboard_markup.rb +1 -1
  50. data/lib/telegram/bot/types/inline_query.rb +5 -5
  51. data/lib/telegram/bot/types/inline_query_result_article.rb +10 -10
  52. data/lib/telegram/bot/types/inline_query_result_audio.rb +11 -10
  53. data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +8 -7
  54. data/lib/telegram/bot/types/inline_query_result_cached_document.rb +10 -9
  55. data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +9 -8
  56. data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +9 -8
  57. data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +10 -9
  58. data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +5 -5
  59. data/lib/telegram/bot/types/inline_query_result_cached_video.rb +10 -9
  60. data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +9 -8
  61. data/lib/telegram/bot/types/inline_query_result_contact.rb +11 -11
  62. data/lib/telegram/bot/types/inline_query_result_document.rb +14 -13
  63. data/lib/telegram/bot/types/inline_query_result_game.rb +4 -4
  64. data/lib/telegram/bot/types/inline_query_result_gif.rb +14 -12
  65. data/lib/telegram/bot/types/inline_query_result_location.rb +14 -14
  66. data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +14 -13
  67. data/lib/telegram/bot/types/inline_query_result_photo.rb +13 -12
  68. data/lib/telegram/bot/types/inline_query_result_venue.rb +15 -15
  69. data/lib/telegram/bot/types/inline_query_result_video.rb +15 -14
  70. data/lib/telegram/bot/types/inline_query_result_voice.rb +10 -9
  71. data/lib/telegram/bot/types/input_contact_message_content.rb +4 -4
  72. data/lib/telegram/bot/types/input_invoice_message_content.rb +20 -20
  73. data/lib/telegram/bot/types/input_location_message_content.rb +6 -6
  74. data/lib/telegram/bot/types/input_media_animation.rb +9 -8
  75. data/lib/telegram/bot/types/input_media_audio.rb +9 -8
  76. data/lib/telegram/bot/types/input_media_document.rb +7 -7
  77. data/lib/telegram/bot/types/input_media_photo.rb +5 -4
  78. data/lib/telegram/bot/types/input_media_video.rb +10 -8
  79. data/lib/telegram/bot/types/input_text_message_content.rb +4 -3
  80. data/lib/telegram/bot/types/input_venue_message_content.rb +8 -8
  81. data/lib/telegram/bot/types/invoice.rb +5 -5
  82. data/lib/telegram/bot/types/keyboard_button.rb +5 -5
  83. data/lib/telegram/bot/types/keyboard_button_poll_type.rb +1 -1
  84. data/lib/telegram/bot/types/labeled_price.rb +2 -2
  85. data/lib/telegram/bot/types/location.rb +6 -6
  86. data/lib/telegram/bot/types/login_url.rb +4 -4
  87. data/lib/telegram/bot/types/mask_position.rb +4 -4
  88. data/lib/telegram/bot/types/menu_button_commands.rb +1 -1
  89. data/lib/telegram/bot/types/menu_button_default.rb +1 -1
  90. data/lib/telegram/bot/types/menu_button_web_app.rb +2 -2
  91. data/lib/telegram/bot/types/message.rb +63 -58
  92. data/lib/telegram/bot/types/message_auto_delete_timer_changed.rb +1 -1
  93. data/lib/telegram/bot/types/message_entity.rb +7 -7
  94. data/lib/telegram/bot/types/order_info.rb +4 -4
  95. data/lib/telegram/bot/types/passport_data.rb +1 -1
  96. data/lib/telegram/bot/types/passport_element_error_data_field.rb +5 -5
  97. data/lib/telegram/bot/types/passport_element_error_file.rb +4 -4
  98. data/lib/telegram/bot/types/passport_element_error_files.rb +4 -4
  99. data/lib/telegram/bot/types/passport_element_error_front_side.rb +4 -4
  100. data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +4 -4
  101. data/lib/telegram/bot/types/passport_element_error_selfie.rb +4 -4
  102. data/lib/telegram/bot/types/passport_element_error_translation_file.rb +4 -4
  103. data/lib/telegram/bot/types/passport_element_error_translation_files.rb +4 -4
  104. data/lib/telegram/bot/types/passport_element_error_unspecified.rb +4 -4
  105. data/lib/telegram/bot/types/passport_file.rb +4 -4
  106. data/lib/telegram/bot/types/photo_size.rb +5 -5
  107. data/lib/telegram/bot/types/poll.rb +13 -13
  108. data/lib/telegram/bot/types/poll_answer.rb +2 -2
  109. data/lib/telegram/bot/types/poll_option.rb +2 -2
  110. data/lib/telegram/bot/types/pre_checkout_query.rb +6 -6
  111. data/lib/telegram/bot/types/proximity_alert_triggered.rb +1 -1
  112. data/lib/telegram/bot/types/reply_keyboard_markup.rb +5 -5
  113. data/lib/telegram/bot/types/reply_keyboard_remove.rb +2 -2
  114. data/lib/telegram/bot/types/sent_web_app_message.rb +1 -1
  115. data/lib/telegram/bot/types/shipping_address.rb +6 -6
  116. data/lib/telegram/bot/types/shipping_option.rb +3 -3
  117. data/lib/telegram/bot/types/shipping_query.rb +2 -2
  118. data/lib/telegram/bot/types/sticker.rb +14 -14
  119. data/lib/telegram/bot/types/sticker_set.rb +7 -8
  120. data/lib/telegram/bot/types/successful_payment.rb +7 -7
  121. data/lib/telegram/bot/types/update.rb +15 -15
  122. data/lib/telegram/bot/types/user.rb +11 -11
  123. data/lib/telegram/bot/types/user_profile_photos.rb +2 -2
  124. data/lib/telegram/bot/types/venue.rb +6 -6
  125. data/lib/telegram/bot/types/video.rb +9 -9
  126. data/lib/telegram/bot/types/video_chat_ended.rb +1 -1
  127. data/lib/telegram/bot/types/video_chat_participants_invited.rb +1 -1
  128. data/lib/telegram/bot/types/video_chat_scheduled.rb +1 -1
  129. data/lib/telegram/bot/types/video_note.rb +6 -6
  130. data/lib/telegram/bot/types/voice.rb +5 -5
  131. data/lib/telegram/bot/types/web_app_data.rb +2 -2
  132. data/lib/telegram/bot/types/web_app_info.rb +1 -1
  133. data/lib/telegram/bot/types/webhook_info.rb +9 -9
  134. data/lib/telegram/bot/types.rb +7 -124
  135. data/lib/telegram/bot/version.rb +1 -1
  136. data/lib/telegram/bot.rb +7 -9
  137. data/telegram-bot-ruby.gemspec +4 -2
  138. metadata +51 -13
  139. data/lib/telegram/bot/exceptions.rb +0 -4
@@ -6,10 +6,10 @@ module Telegram
6
6
  class ChatMemberUpdated < Base
7
7
  attribute :chat, Chat
8
8
  attribute :from, User
9
- attribute :date, Integer
9
+ attribute :date, Types::Integer
10
10
  attribute :old_chat_member, ChatMember
11
11
  attribute :new_chat_member, ChatMember
12
- attribute :invite_link, ChatInviteLink
12
+ attribute? :invite_link, ChatInviteLink
13
13
  end
14
14
  end
15
15
  end
@@ -4,14 +4,15 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ChatPermissions < Base
7
- attribute :can_send_messages, Boolean
8
- attribute :can_send_media_messages, Boolean
9
- attribute :can_send_polls, Boolean
10
- attribute :can_send_other_messages, Boolean
11
- attribute :can_add_web_page_previews, Boolean
12
- attribute :can_change_info, Boolean
13
- attribute :can_invite_users, Boolean
14
- attribute :can_pin_messages, Boolean
7
+ attribute? :can_send_messages, Types::Bool
8
+ attribute? :can_send_media_messages, Types::Bool
9
+ attribute? :can_send_polls, Types::Bool
10
+ attribute? :can_send_other_messages, Types::Bool
11
+ attribute? :can_add_web_page_previews, Types::Bool
12
+ attribute? :can_change_info, Types::Bool
13
+ attribute? :can_invite_users, Types::Bool
14
+ attribute? :can_pin_messages, Types::Bool
15
+ attribute? :can_manage_topics, Types::Bool
15
16
  end
16
17
  end
17
18
  end
@@ -4,10 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ChatPhoto < Base
7
- attribute :small_file_id, String
8
- attribute :small_file_unique_id, String
9
- attribute :big_file_id, String
10
- attribute :big_file_unique_id, String
7
+ attribute :small_file_id, Types::String
8
+ attribute :small_file_unique_id, Types::String
9
+ attribute :big_file_id, Types::String
10
+ attribute :big_file_unique_id, Types::String
11
11
  end
12
12
  end
13
13
  end
@@ -4,11 +4,11 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ChosenInlineResult < Base
7
- attribute :result_id, String
7
+ attribute :result_id, Types::String
8
8
  attribute :from, User
9
- attribute :location, Location
10
- attribute :inline_message_id, String
11
- attribute :query, String
9
+ attribute? :location, Location
10
+ attribute? :inline_message_id, Types::String
11
+ attribute :query, Types::String
12
12
 
13
13
  alias to_s query
14
14
  end
@@ -4,11 +4,11 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class Contact < Base
7
- attribute :phone_number, String
8
- attribute :first_name, String
9
- attribute :last_name, String
10
- attribute :user_id, Integer
11
- attribute :vcard, String
7
+ attribute :phone_number, Types::String
8
+ attribute :first_name, Types::String
9
+ attribute? :last_name, Types::String
10
+ attribute? :user_id, Types::Integer
11
+ attribute? :vcard, Types::String
12
12
  end
13
13
  end
14
14
  end
@@ -4,8 +4,8 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class Dice < Base
7
- attribute :emoji, String
8
- attribute :value, Integer
7
+ attribute :emoji, Types::String
8
+ attribute :value, Types::Integer
9
9
  end
10
10
  end
11
11
  end
@@ -4,12 +4,12 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class Document < Base
7
- attribute :file_id, String
8
- attribute :file_unique_id, String
9
- attribute :thumb, PhotoSize
10
- attribute :file_name, String
11
- attribute :mime_type, String
12
- attribute :file_size, Integer
7
+ attribute :file_id, Types::String
8
+ attribute :file_unique_id, Types::String
9
+ attribute? :thumb, PhotoSize
10
+ attribute? :file_name, Types::String
11
+ attribute? :mime_type, Types::String
12
+ attribute? :file_size, Types::Integer
13
13
  end
14
14
  end
15
15
  end
@@ -4,9 +4,9 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class EncryptedCredentials < Base
7
- attribute :data, String
8
- attribute :hash, String
9
- attribute :secret, String
7
+ attribute :data, Types::String
8
+ attribute :hash, Types::String
9
+ attribute :secret, Types::String
10
10
  end
11
11
  end
12
12
  end
@@ -4,16 +4,16 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class EncryptedPassportElement < Base
7
- attribute :type, String
8
- attribute :data, String
9
- attribute :phone_number, String
10
- attribute :email, String
11
- attribute :files, Array[PassportFile]
12
- attribute :front_side, PassportFile
13
- attribute :reverse_side, PassportFile
14
- attribute :selfie, PassportFile
15
- attribute :translation, Array[PassportFile]
16
- attribute :hash, String
7
+ attribute :type, Types::String
8
+ attribute? :data, Types::String
9
+ attribute? :phone_number, Types::String
10
+ attribute? :email, Types::String
11
+ attribute? :files, Types::Array.of(PassportFile)
12
+ attribute? :front_side, PassportFile
13
+ attribute? :reverse_side, PassportFile
14
+ attribute? :selfie, PassportFile
15
+ attribute? :translation, Types::Array.of(PassportFile)
16
+ attribute :hash, Types::String
17
17
  end
18
18
  end
19
19
  end
@@ -4,10 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class File < Base
7
- attribute :file_id, String
8
- attribute :file_unique_id, String
9
- attribute :file_size, Integer
10
- attribute :file_path, String
7
+ attribute :file_id, Types::String
8
+ attribute :file_unique_id, Types::String
9
+ attribute? :file_size, Types::Integer
10
+ attribute? :file_path, Types::String
11
11
  end
12
12
  end
13
13
  end
@@ -4,9 +4,9 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ForceReply < Base
7
- attribute :force_reply, Boolean
8
- attribute :input_field_placeholder, String
9
- attribute :selective, Boolean, default: false
7
+ attribute :force_reply, Types::Bool
8
+ attribute? :input_field_placeholder, Types::String
9
+ attribute? :selective, Types::Bool.default(false)
10
10
  end
11
11
  end
12
12
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ForumTopic < Base
7
+ attribute :message_thread_id, Types::Integer
8
+ attribute :name, Types::String
9
+ attribute :icon_color, Types::Integer
10
+ attribute? :icon_custom_emoji_id, Types::String
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ForumTopicClosed < Base
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ForumTopicCreated < Base
7
+ attribute :name, Types::String
8
+ attribute :icon_color, Types::Integer
9
+ attribute? :icon_custom_emoji_id, Types::String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ForumTopicReopened < Base
7
+ end
8
+ end
9
+ end
10
+ end
@@ -4,12 +4,12 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class Game < Base
7
- attribute :title, String
8
- attribute :description, String
9
- attribute :photo, Array[PhotoSize]
10
- attribute :text, String
11
- attribute :text_entities, Array[MessageEntity]
12
- attribute :animation, Animation
7
+ attribute :title, Types::String
8
+ attribute :description, Types::String
9
+ attribute :photo, Types::Array.of(PhotoSize)
10
+ attribute? :text, Types::String
11
+ attribute? :text_entities, Types::Array.of(MessageEntity)
12
+ attribute? :animation, Animation
13
13
  end
14
14
  end
15
15
  end
@@ -4,9 +4,9 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class GameHighScore < Base
7
- attribute :position, Integer
7
+ attribute :position, Types::Integer
8
8
  attribute :user, User
9
- attribute :score, Integer
9
+ attribute :score, Types::Integer
10
10
  end
11
11
  end
12
12
  end
@@ -4,15 +4,15 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineKeyboardButton < Base
7
- attribute :text, String
8
- attribute :url, String
9
- attribute :callback_data, String
10
- attribute :web_app, WebAppInfo
11
- attribute :login_url, LoginUrl
12
- attribute :switch_inline_query, String
13
- attribute :switch_inline_query_current_chat, String
14
- attribute :callback_game, CallbackGame
15
- attribute :pay, Boolean
7
+ attribute :text, Types::String
8
+ attribute? :url, Types::String
9
+ attribute? :callback_data, Types::String
10
+ attribute? :web_app, WebAppInfo
11
+ attribute? :login_url, LoginUrl
12
+ attribute? :switch_inline_query, Types::String
13
+ attribute? :switch_inline_query_current_chat, Types::String
14
+ attribute? :callback_game, CallbackGame
15
+ attribute? :pay, Types::Bool
16
16
  end
17
17
  end
18
18
  end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineKeyboardMarkup < Base
7
- attribute :inline_keyboard, Array[Array[InlineKeyboardButton]]
7
+ attribute :inline_keyboard, Types::Array.of(Types::Array.of(InlineKeyboardButton))
8
8
 
9
9
  def to_compact_hash
10
10
  hsh = super
@@ -4,12 +4,12 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQuery < Base
7
- attribute :id, String
7
+ attribute :id, Types::String
8
8
  attribute :from, User
9
- attribute :query, String
10
- attribute :offset, String
11
- attribute :chat_type, String
12
- attribute :location, Location
9
+ attribute :query, Types::String
10
+ attribute :offset, Types::String
11
+ attribute? :chat_type, Types::String
12
+ attribute? :location, Location
13
13
 
14
14
  alias to_s query
15
15
  end
@@ -4,17 +4,17 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultArticle < Base
7
- attribute :type, String, default: 'article'
8
- attribute :id, String
9
- attribute :title, String
7
+ attribute :type, Types::String.default('article')
8
+ attribute :id, Types::String
9
+ attribute :title, Types::String
10
10
  attribute :input_message_content, InputMessageContent
11
- attribute :reply_markup, InlineKeyboardMarkup
12
- attribute :url, String
13
- attribute :hide_url, Boolean
14
- attribute :description, String
15
- attribute :thumb_url, String
16
- attribute :thumb_width, Integer
17
- attribute :thumb_height, Integer
11
+ attribute? :reply_markup, InlineKeyboardMarkup
12
+ attribute? :url, Types::String
13
+ attribute? :hide_url, Types::Bool
14
+ attribute? :description, Types::String
15
+ attribute? :thumb_url, Types::String
16
+ attribute? :thumb_width, Types::Integer
17
+ attribute? :thumb_height, Types::Integer
18
18
  end
19
19
  end
20
20
  end
@@ -4,16 +4,17 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultAudio < Base
7
- attribute :type, String, default: 'audio'
8
- attribute :id, String
9
- attribute :audio_url, String
10
- attribute :title, String
11
- attribute :caption, String
12
- attribute :parse_mode, String
13
- attribute :performer, String
14
- attribute :audio_duration, Integer
15
- attribute :reply_markup, InlineKeyboardMarkup
16
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('audio')
8
+ attribute :id, Types::String
9
+ attribute :audio_url, Types::String
10
+ attribute :title, Types::String
11
+ attribute? :caption, Types::String
12
+ attribute? :parse_mode, Types::String
13
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
14
+ attribute? :performer, Types::String
15
+ attribute? :audio_duration, Types::Integer
16
+ attribute? :reply_markup, InlineKeyboardMarkup
17
+ attribute? :input_message_content, InputMessageContent
17
18
  end
18
19
  end
19
20
  end
@@ -4,13 +4,14 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultCachedAudio < Base
7
- attribute :type, String, default: 'audio'
8
- attribute :id, String
9
- attribute :audio_file_id, String
10
- attribute :caption, String
11
- attribute :parse_mode, String
12
- attribute :reply_markup, InlineKeyboardMarkup
13
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('audio')
8
+ attribute :id, Types::String
9
+ attribute :audio_file_id, Types::String
10
+ attribute? :caption, Types::String
11
+ attribute? :parse_mode, Types::String
12
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
13
+ attribute? :reply_markup, InlineKeyboardMarkup
14
+ attribute? :input_message_content, InputMessageContent
14
15
  end
15
16
  end
16
17
  end
@@ -4,15 +4,16 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultCachedDocument < Base
7
- attribute :type, String, default: 'document'
8
- attribute :id, String
9
- attribute :title, String
10
- attribute :document_file_id, String
11
- attribute :description, String
12
- attribute :caption, String
13
- attribute :parse_mode, String
14
- attribute :reply_markup, InlineKeyboardMarkup
15
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('document')
8
+ attribute :id, Types::String
9
+ attribute :title, Types::String
10
+ attribute :document_file_id, Types::String
11
+ attribute? :description, Types::String
12
+ attribute? :caption, Types::String
13
+ attribute? :parse_mode, Types::String
14
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
15
+ attribute? :reply_markup, InlineKeyboardMarkup
16
+ attribute? :input_message_content, InputMessageContent
16
17
  end
17
18
  end
18
19
  end
@@ -4,14 +4,15 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultCachedGif < Base
7
- attribute :type, String, default: 'gif'
8
- attribute :id, String
9
- attribute :gif_file_id, String
10
- attribute :title, String
11
- attribute :caption, String
12
- attribute :parse_mode, String
13
- attribute :reply_markup, InlineKeyboardMarkup
14
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('gif')
8
+ attribute :id, Types::String
9
+ attribute :gif_file_id, Types::String
10
+ attribute? :title, Types::String
11
+ attribute? :caption, Types::String
12
+ attribute? :parse_mode, Types::String
13
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
14
+ attribute? :reply_markup, InlineKeyboardMarkup
15
+ attribute? :input_message_content, InputMessageContent
15
16
  end
16
17
  end
17
18
  end
@@ -4,14 +4,15 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultCachedMpeg4Gif < Base
7
- attribute :type, String, default: 'mpeg4_gif'
8
- attribute :id, String
9
- attribute :mpeg4_file_id, String
10
- attribute :title, String
11
- attribute :caption, String
12
- attribute :parse_mode, String
13
- attribute :reply_markup, InlineKeyboardMarkup
14
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('mpeg4_gif')
8
+ attribute :id, Types::String
9
+ attribute :mpeg4_file_id, Types::String
10
+ attribute? :title, Types::String
11
+ attribute? :caption, Types::String
12
+ attribute? :parse_mode, Types::String
13
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
14
+ attribute? :reply_markup, InlineKeyboardMarkup
15
+ attribute? :input_message_content, InputMessageContent
15
16
  end
16
17
  end
17
18
  end
@@ -4,15 +4,16 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultCachedPhoto < Base
7
- attribute :type, String, default: 'photo'
8
- attribute :id, String
9
- attribute :photo_file_id, String
10
- attribute :title, String
11
- attribute :description, String
12
- attribute :caption, String
13
- attribute :parse_mode, String
14
- attribute :reply_markup, InlineKeyboardMarkup
15
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('photo')
8
+ attribute :id, Types::String
9
+ attribute :photo_file_id, Types::String
10
+ attribute? :title, Types::String
11
+ attribute? :description, Types::String
12
+ attribute? :caption, Types::String
13
+ attribute? :parse_mode, Types::String
14
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
15
+ attribute? :reply_markup, InlineKeyboardMarkup
16
+ attribute? :input_message_content, InputMessageContent
16
17
  end
17
18
  end
18
19
  end
@@ -4,11 +4,11 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultCachedSticker < Base
7
- attribute :type, String, default: 'sticker'
8
- attribute :id, String
9
- attribute :sticker_file_id, String
10
- attribute :reply_markup, InlineKeyboardMarkup
11
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('sticker')
8
+ attribute :id, Types::String
9
+ attribute :sticker_file_id, Types::String
10
+ attribute? :reply_markup, InlineKeyboardMarkup
11
+ attribute? :input_message_content, InputMessageContent
12
12
  end
13
13
  end
14
14
  end
@@ -4,15 +4,16 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultCachedVideo < Base
7
- attribute :type, String, default: 'video'
8
- attribute :id, String
9
- attribute :video_file_id, String
10
- attribute :title, String
11
- attribute :description, String
12
- attribute :caption, String
13
- attribute :parse_mode, String
14
- attribute :reply_markup, InlineKeyboardMarkup
15
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('video')
8
+ attribute :id, Types::String
9
+ attribute :video_file_id, Types::String
10
+ attribute :title, Types::String
11
+ attribute? :description, Types::String
12
+ attribute? :caption, Types::String
13
+ attribute? :parse_mode, Types::String
14
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
15
+ attribute? :reply_markup, InlineKeyboardMarkup
16
+ attribute? :input_message_content, InputMessageContent
16
17
  end
17
18
  end
18
19
  end
@@ -4,14 +4,15 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultCachedVoice < Base
7
- attribute :type, String, default: 'voice'
8
- attribute :id, String
9
- attribute :voice_file_id, String
10
- attribute :title, String
11
- attribute :caption, String
12
- attribute :parse_mode, String
13
- attribute :reply_markup, InlineKeyboardMarkup
14
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('voice')
8
+ attribute :id, Types::String
9
+ attribute :voice_file_id, Types::String
10
+ attribute :title, Types::String
11
+ attribute? :caption, Types::String
12
+ attribute? :parse_mode, Types::String
13
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
14
+ attribute? :reply_markup, InlineKeyboardMarkup
15
+ attribute? :input_message_content, InputMessageContent
15
16
  end
16
17
  end
17
18
  end
@@ -4,17 +4,17 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultContact < Base
7
- attribute :type, String, default: 'contact'
8
- attribute :id, String
9
- attribute :phone_number, String
10
- attribute :first_name, String
11
- attribute :last_name, String
12
- attribute :vcard, String
13
- attribute :reply_markup, InlineKeyboardMarkup
14
- attribute :input_message_content, InputMessageContent
15
- attribute :thumb_url, String
16
- attribute :thumb_width, Integer
17
- attribute :thumb_height, Integer
7
+ attribute :type, Types::String.default('contact')
8
+ attribute :id, Types::String
9
+ attribute :phone_number, Types::String
10
+ attribute :first_name, Types::String
11
+ attribute? :last_name, Types::String
12
+ attribute? :vcard, Types::String
13
+ attribute? :reply_markup, InlineKeyboardMarkup
14
+ attribute? :input_message_content, InputMessageContent
15
+ attribute? :thumb_url, Types::String
16
+ attribute? :thumb_width, Types::Integer
17
+ attribute? :thumb_height, Types::Integer
18
18
  end
19
19
  end
20
20
  end