telegram-bot-ruby 0.23.0 → 1.0.0.pre

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -4,19 +4,20 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultDocument < Base
7
- attribute :type, String, default: 'document'
8
- attribute :id, String
9
- attribute :title, String
10
- attribute :caption, String
11
- attribute :parse_mode, String
12
- attribute :document_url, String
13
- attribute :mime_type, String
14
- attribute :description, String
15
- attribute :reply_markup, InlineKeyboardMarkup
16
- attribute :input_message_content, InputMessageContent
17
- attribute :thumb_url, String
18
- attribute :thumb_width, Integer
19
- attribute :thumb_height, Integer
7
+ attribute :type, Types::String.default('document')
8
+ attribute :id, Types::String
9
+ attribute :title, Types::String
10
+ attribute? :caption, Types::String
11
+ attribute? :parse_mode, Types::String
12
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
13
+ attribute :document_url, Types::String
14
+ attribute :mime_type, Types::String
15
+ attribute? :description, Types::String
16
+ attribute? :reply_markup, InlineKeyboardMarkup
17
+ attribute? :input_message_content, InputMessageContent
18
+ attribute? :thumb_url, Types::String
19
+ attribute? :thumb_width, Types::Integer
20
+ attribute? :thumb_height, Types::Integer
20
21
  end
21
22
  end
22
23
  end
@@ -4,10 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultGame < Base
7
- attribute :type, String, default: 'game'
8
- attribute :id, String
9
- attribute :game_short_name, String
10
- attribute :reply_markup, InlineKeyboardMarkup
7
+ attribute :type, Types::String.default('game')
8
+ attribute :id, Types::String
9
+ attribute :game_short_name, Types::String
10
+ attribute? :reply_markup, InlineKeyboardMarkup
11
11
  end
12
12
  end
13
13
  end
@@ -4,18 +4,20 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultGif < Base
7
- attribute :type, String, default: 'gif'
8
- attribute :id, String
9
- attribute :gif_url, String
10
- attribute :gif_width, Integer
11
- attribute :gif_height, Integer
12
- attribute :gif_duration, Integer
13
- attribute :thumb_url, String
14
- attribute :thumb_mime_type, String
15
- attribute :title, String
16
- attribute :caption, String
17
- attribute :reply_markup, InlineKeyboardMarkup
18
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('gif')
8
+ attribute :id, Types::String
9
+ attribute :gif_url, Types::String
10
+ attribute? :gif_width, Types::Integer
11
+ attribute? :gif_height, Types::Integer
12
+ attribute? :gif_duration, Types::Integer
13
+ attribute :thumb_url, Types::String
14
+ attribute? :thumb_mime_type, Types::String
15
+ attribute? :title, Types::String
16
+ attribute? :caption, Types::String
17
+ attribute? :parse_mode, Types::String
18
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
19
+ attribute? :reply_markup, InlineKeyboardMarkup
20
+ attribute? :input_message_content, InputMessageContent
19
21
  end
20
22
  end
21
23
  end
@@ -4,20 +4,20 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultLocation < Base
7
- attribute :type, String, default: 'location'
8
- attribute :id, String
9
- attribute :latitude, Float
10
- attribute :longitude, Float
11
- attribute :title, String
12
- attribute :horizontal_accuracy, Float
13
- attribute :live_period, Integer
14
- attribute :heading, Integer
15
- attribute :proximity_alert_radius, Integer
16
- attribute :reply_markup, InlineKeyboardMarkup
17
- attribute :input_message_content, InputMessageContent
18
- attribute :thumb_url, String
19
- attribute :thumb_width, Integer
20
- attribute :thumb_height, Integer
7
+ attribute :type, Types::String.default('location')
8
+ attribute :id, Types::String
9
+ attribute :latitude, Types::Float
10
+ attribute :longitude, Types::Float
11
+ attribute :title, Types::String
12
+ attribute? :horizontal_accuracy, Types::Float
13
+ attribute? :live_period, Types::Integer
14
+ attribute? :heading, Types::Integer
15
+ attribute? :proximity_alert_radius, Types::Integer
16
+ attribute? :reply_markup, InlineKeyboardMarkup
17
+ attribute? :input_message_content, InputMessageContent
18
+ attribute? :thumb_url, Types::String
19
+ attribute? :thumb_width, Types::Integer
20
+ attribute? :thumb_height, Types::Integer
21
21
  end
22
22
  end
23
23
  end
@@ -4,19 +4,20 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultMpeg4Gif < Base
7
- attribute :type, String, default: 'mpeg4_gif'
8
- attribute :id, String
9
- attribute :mpeg4_url, String
10
- attribute :mpeg4_width, Integer
11
- attribute :mpeg4_height, Integer
12
- attribute :mpeg4_duration, Integer
13
- attribute :thumb_url, String
14
- attribute :thumb_mime_type, String
15
- attribute :title, String
16
- attribute :caption, String
17
- attribute :parse_mode, String
18
- attribute :reply_markup, InlineKeyboardMarkup
19
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('mpeg4_gif')
8
+ attribute :id, Types::String
9
+ attribute :mpeg4_url, Types::String
10
+ attribute? :mpeg4_width, Types::Integer
11
+ attribute? :mpeg4_height, Types::Integer
12
+ attribute? :mpeg4_duration, Types::Integer
13
+ attribute :thumb_url, Types::String
14
+ attribute? :thumb_mime_type, Types::String
15
+ attribute? :title, Types::String
16
+ attribute? :caption, Types::String
17
+ attribute? :parse_mode, Types::String
18
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
19
+ attribute? :reply_markup, InlineKeyboardMarkup
20
+ attribute? :input_message_content, InputMessageContent
20
21
  end
21
22
  end
22
23
  end
@@ -4,18 +4,19 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultPhoto < Base
7
- attribute :type, String, default: 'photo'
8
- attribute :id, String
9
- attribute :photo_url, String
10
- attribute :thumb_url, String
11
- attribute :photo_width, Integer
12
- attribute :photo_height, Integer
13
- attribute :title, String
14
- attribute :description, String
15
- attribute :caption, String
16
- attribute :parse_mode, String
17
- attribute :reply_markup, InlineKeyboardMarkup
18
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('photo')
8
+ attribute :id, Types::String
9
+ attribute :photo_url, Types::String
10
+ attribute :thumb_url, Types::String
11
+ attribute? :photo_width, Types::Integer
12
+ attribute? :photo_height, Types::Integer
13
+ attribute? :title, Types::String
14
+ attribute? :description, Types::String
15
+ attribute? :caption, Types::String
16
+ attribute? :parse_mode, Types::String
17
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
18
+ attribute? :reply_markup, InlineKeyboardMarkup
19
+ attribute? :input_message_content, InputMessageContent
19
20
  end
20
21
  end
21
22
  end
@@ -4,21 +4,21 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultVenue < Base
7
- attribute :type, String, default: 'venue'
8
- attribute :id, String
9
- attribute :latitude, Float
10
- attribute :longitude, Float
11
- attribute :title, String
12
- attribute :address, String
13
- attribute :foursquare_id, String
14
- attribute :foursquare_type, String
15
- attribute :google_place_id, String
16
- attribute :google_place_type, String
17
- attribute :reply_markup, InlineKeyboardMarkup
18
- attribute :input_message_content, InputMessageContent
19
- attribute :thumb_url, String
20
- attribute :thumb_width, Integer
21
- attribute :thumb_height, Integer
7
+ attribute :type, Types::String.default('venue')
8
+ attribute :id, Types::String
9
+ attribute :latitude, Types::Float
10
+ attribute :longitude, Types::Float
11
+ attribute :title, Types::String
12
+ attribute :address, Types::String
13
+ attribute? :foursquare_id, Types::String
14
+ attribute? :foursquare_type, Types::String
15
+ attribute? :google_place_id, Types::String
16
+ attribute? :google_place_type, Types::String
17
+ attribute? :reply_markup, InlineKeyboardMarkup
18
+ attribute? :input_message_content, InputMessageContent
19
+ attribute? :thumb_url, Types::String
20
+ attribute? :thumb_width, Types::Integer
21
+ attribute? :thumb_height, Types::Integer
22
22
  end
23
23
  end
24
24
  end
@@ -4,20 +4,21 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultVideo < Base
7
- attribute :type, String, default: 'video'
8
- attribute :id, String
9
- attribute :video_url, String
10
- attribute :mime_type, String
11
- attribute :thumb_url, String
12
- attribute :title, String
13
- attribute :caption, String
14
- attribute :parse_mode, String
15
- attribute :video_width, Integer
16
- attribute :video_height, Integer
17
- attribute :video_duration, Integer
18
- attribute :description, String
19
- attribute :reply_markup, InlineKeyboardMarkup
20
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('video')
8
+ attribute :id, Types::String
9
+ attribute :video_url, Types::String
10
+ attribute :mime_type, Types::String
11
+ attribute :thumb_url, Types::String
12
+ attribute :title, Types::String
13
+ attribute? :caption, Types::String
14
+ attribute? :parse_mode, Types::String
15
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
16
+ attribute? :video_width, Types::Integer
17
+ attribute? :video_height, Types::Integer
18
+ attribute? :video_duration, Types::Integer
19
+ attribute? :description, Types::String
20
+ attribute? :reply_markup, InlineKeyboardMarkup
21
+ attribute? :input_message_content, InputMessageContent
21
22
  end
22
23
  end
23
24
  end
@@ -4,15 +4,16 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InlineQueryResultVoice < Base
7
- attribute :type, String, default: 'voice'
8
- attribute :id, String
9
- attribute :voice_url, String
10
- attribute :title, String
11
- attribute :caption, String
12
- attribute :parse_mode, String
13
- attribute :voice_duration, Integer
14
- attribute :reply_markup, InlineKeyboardMarkup
15
- attribute :input_message_content, InputMessageContent
7
+ attribute :type, Types::String.default('voice')
8
+ attribute :id, Types::String
9
+ attribute :voice_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? :voice_duration, Types::Integer
15
+ attribute? :reply_markup, InlineKeyboardMarkup
16
+ attribute? :input_message_content, InputMessageContent
16
17
  end
17
18
  end
18
19
  end
@@ -4,10 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InputContactMessageContent < InputMessageContent
7
- attribute :phone_number, String
8
- attribute :first_name, String
9
- attribute :last_name, String
10
- attribute :vcard, String
7
+ attribute :phone_number, Types::String
8
+ attribute :first_name, Types::String
9
+ attribute? :last_name, Types::String
10
+ attribute? :vcard, Types::String
11
11
  end
12
12
  end
13
13
  end
@@ -4,26 +4,26 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InputInvoiceMessageContent < InputMessageContent
7
- attribute :title, String
8
- attribute :description, String
9
- attribute :payload, String
10
- attribute :provider_token, String
11
- attribute :currency, String
12
- attribute :prices, Array[LabeledPrice]
13
- attribute :max_tip_amount, Integer
14
- attribute :suggested_tip_amounts, Array[Integer]
15
- attribute :provider_data, String
16
- attribute :photo_url, String
17
- attribute :photo_size, Integer
18
- attribute :photo_width, Integer
19
- attribute :photo_height, Integer
20
- attribute :need_name, Boolean
21
- attribute :need_phone_number, Boolean
22
- attribute :need_email, Boolean
23
- attribute :need_shipping_address, Boolean
24
- attribute :send_phone_number_to_provider, Boolean
25
- attribute :send_email_to_provider, Boolean
26
- attribute :is_flexible, Boolean
7
+ attribute :title, Types::String
8
+ attribute :description, Types::String
9
+ attribute :payload, Types::String
10
+ attribute :provider_token, Types::String
11
+ attribute :currency, Types::String
12
+ attribute :prices, Types::Array.of(LabeledPrice)
13
+ attribute? :max_tip_amount, Types::Integer
14
+ attribute? :suggested_tip_amounts, Types::Array.of(Types::Integer)
15
+ attribute? :provider_data, Types::String
16
+ attribute? :photo_url, Types::String
17
+ attribute? :photo_size, Types::Integer
18
+ attribute? :photo_width, Types::Integer
19
+ attribute? :photo_height, Types::Integer
20
+ attribute? :need_name, Types::Bool
21
+ attribute? :need_phone_number, Types::Bool
22
+ attribute? :need_email, Types::Bool
23
+ attribute? :need_shipping_address, Types::Bool
24
+ attribute? :send_phone_number_to_provider, Types::Bool
25
+ attribute? :send_email_to_provider, Types::Bool
26
+ attribute? :is_flexible, Types::Bool
27
27
  end
28
28
  end
29
29
  end
@@ -4,12 +4,12 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InputLocationMessageContent < InputMessageContent
7
- attribute :latitude, Float
8
- attribute :longitude, Float
9
- attribute :horizontal_accuracy, Float
10
- attribute :live_period, Integer
11
- attribute :heading, Integer
12
- attribute :proximity_alert_radius, Integer
7
+ attribute :latitude, Types::Float
8
+ attribute :longitude, Types::Float
9
+ attribute? :horizontal_accuracy, Types::Float
10
+ attribute? :live_period, Types::Integer
11
+ attribute? :heading, Types::Integer
12
+ attribute? :proximity_alert_radius, Types::Integer
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 InputMediaAnimation < Base
7
- attribute :type, String, default: 'animation'
8
- attribute :media, String
9
- attribute :thumb, String
10
- attribute :caption, String
11
- attribute :parse_mode, String
12
- attribute :width, Integer
13
- attribute :height, Integer
14
- attribute :duration, Integer
7
+ attribute :type, Types::String.default('animation')
8
+ attribute :media, Types::String
9
+ attribute? :thumb, Types::String
10
+ attribute? :caption, Types::String
11
+ attribute? :parse_mode, Types::String
12
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
13
+ attribute? :width, Types::Integer
14
+ attribute? :height, Types::Integer
15
+ attribute? :duration, Types::Integer
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 InputMediaAudio < Base
7
- attribute :type, String, default: 'audio'
8
- attribute :media, String
9
- attribute :thumb, String
10
- attribute :caption, String
11
- attribute :parse_mode, String
12
- attribute :duration, Integer
13
- attribute :performer, String
14
- attribute :title, String
7
+ attribute :type, Types::String.default('audio')
8
+ attribute :media, Types::String
9
+ attribute? :thumb, Types::String
10
+ attribute? :caption, Types::String
11
+ attribute? :parse_mode, Types::String
12
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
13
+ attribute? :duration, Types::Integer
14
+ attribute? :performer, Types::String
15
+ attribute? :title, Types::String
15
16
  end
16
17
  end
17
18
  end
@@ -4,13 +4,13 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InputMediaDocument < Base
7
- attribute :type, String, default: 'document'
8
- attribute :media, String
9
- attribute :thumb, String
10
- attribute :caption, String
11
- attribute :parse_mode, String
12
- attribute :caption_entities, Array[MessageEntity]
13
- attribute :disable_content_type_detection, Boolean
7
+ attribute :type, Types::String.default('document')
8
+ attribute :media, Types::String
9
+ attribute? :thumb, Types::String
10
+ attribute? :caption, Types::String
11
+ attribute? :parse_mode, Types::String
12
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
13
+ attribute? :disable_content_type_detection, Types::Bool
14
14
  end
15
15
  end
16
16
  end
@@ -4,10 +4,11 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InputMediaPhoto < Base
7
- attribute :type, String, default: 'photo'
8
- attribute :media, String
9
- attribute :caption, String
10
- attribute :parse_mode, String
7
+ attribute :type, Types::String.default('photo')
8
+ attribute :media, Types::String
9
+ attribute? :caption, Types::String
10
+ attribute? :parse_mode, Types::String
11
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
11
12
  end
12
13
  end
13
14
  end
@@ -4,14 +4,16 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InputMediaVideo < Base
7
- attribute :type, String, default: 'video'
8
- attribute :media, String
9
- attribute :caption, String
10
- attribute :parse_mode, String
11
- attribute :width, Integer
12
- attribute :height, Integer
13
- attribute :duration, Integer
14
- attribute :supports_streaming, Boolean
7
+ attribute :type, Types::String.default('video')
8
+ attribute :media, Types::String
9
+ attribute? :thumb, Types::String
10
+ attribute? :caption, Types::String
11
+ attribute? :parse_mode, Types::String
12
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
13
+ attribute? :width, Types::Integer
14
+ attribute? :height, Types::Integer
15
+ attribute? :duration, Types::Integer
16
+ attribute? :supports_streaming, Types::Bool
15
17
  end
16
18
  end
17
19
  end
@@ -4,9 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InputTextMessageContent < InputMessageContent
7
- attribute :message_text, String
8
- attribute :parse_mode, String
9
- attribute :disable_web_page_preview, Boolean
7
+ attribute :message_text, Types::String
8
+ attribute? :parse_mode, Types::String
9
+ attribute? :entities, Types::Array.of(MessageEntity)
10
+ attribute? :disable_web_page_preview, Types::Bool
10
11
  end
11
12
  end
12
13
  end
@@ -4,14 +4,14 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class InputVenueMessageContent < InputMessageContent
7
- attribute :latitude, Float
8
- attribute :longitude, Float
9
- attribute :title, String
10
- attribute :address, String
11
- attribute :foursquare_id, String
12
- attribute :foursquare_type, String
13
- attribute :google_place_id, String
14
- attribute :google_place_type, String
7
+ attribute :latitude, Types::Float
8
+ attribute :longitude, Types::Float
9
+ attribute :title, Types::String
10
+ attribute :address, Types::String
11
+ attribute? :foursquare_id, Types::String
12
+ attribute? :foursquare_type, Types::String
13
+ attribute? :google_place_id, Types::String
14
+ attribute? :google_place_type, Types::String
15
15
  end
16
16
  end
17
17
  end
@@ -4,11 +4,11 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class Invoice < Base
7
- attribute :title, String
8
- attribute :description, String
9
- attribute :start_parameter, String
10
- attribute :currency, String
11
- attribute :total_amount, Integer
7
+ attribute :title, Types::String
8
+ attribute :description, Types::String
9
+ attribute :start_parameter, Types::String
10
+ attribute :currency, Types::String
11
+ attribute :total_amount, Types::Integer
12
12
  end
13
13
  end
14
14
  end
@@ -4,11 +4,11 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class KeyboardButton < Base
7
- attribute :text, String
8
- attribute :request_contact, Boolean
9
- attribute :request_location, Boolean
10
- attribute :request_poll, KeyboardButtonPollType
11
- attribute :web_app, WebAppInfo
7
+ attribute :text, Types::String
8
+ attribute? :request_contact, Types::Bool
9
+ attribute? :request_location, Types::Bool
10
+ attribute? :request_poll, KeyboardButtonPollType
11
+ attribute? :web_app, WebAppInfo
12
12
  end
13
13
  end
14
14
  end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class KeyboardButtonPollType < Base
7
- attribute :type, String
7
+ attribute? :type, Types::String
8
8
  end
9
9
  end
10
10
  end
@@ -4,8 +4,8 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class LabeledPrice < Base
7
- attribute :label, String
8
- attribute :amount, Integer
7
+ attribute :label, Types::String
8
+ attribute :amount, 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 Location < Base
7
- attribute :longitude, Float
8
- attribute :latitude, Float
9
- attribute :horizontal_accuracy, Float
10
- attribute :live_period, Integer
11
- attribute :heading, Integer
12
- attribute :proximity_alert_radius, Integer
7
+ attribute :longitude, Types::Float
8
+ attribute :latitude, Types::Float
9
+ attribute? :horizontal_accuracy, Types::Float
10
+ attribute? :live_period, Types::Integer
11
+ attribute? :heading, Types::Integer
12
+ attribute? :proximity_alert_radius, Types::Integer
13
13
  end
14
14
  end
15
15
  end
@@ -4,10 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class LoginUrl < Base
7
- attribute :url, String
8
- attribute :forward_text, String
9
- attribute :bot_username, String
10
- attribute :request_write_access, Boolean
7
+ attribute :url, Types::String
8
+ attribute? :forward_text, Types::String
9
+ attribute? :bot_username, Types::String
10
+ attribute? :request_write_access, Types::Bool
11
11
  end
12
12
  end
13
13
  end
@@ -4,10 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class MaskPosition < Base
7
- attribute :point, String
8
- attribute :x_shift, Float
9
- attribute :y_shift, Float
10
- attribute :zoom, Float
7
+ attribute :point, Types::String
8
+ attribute :x_shift, Types::Float
9
+ attribute :y_shift, Types::Float
10
+ attribute :scale, Types::Float
11
11
  end
12
12
  end
13
13
  end