telegram-bot-ruby 0.23.0 → 1.0.0.rc1

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 (144) 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/api.rb +3 -1
  8. data/lib/telegram/bot/types/animation.rb +9 -9
  9. data/lib/telegram/bot/types/audio.rb +9 -9
  10. data/lib/telegram/bot/types/base.rb +3 -2
  11. data/lib/telegram/bot/types/bot_command.rb +2 -2
  12. data/lib/telegram/bot/types/bot_command_scope_all_chat_administrators.rb +1 -1
  13. data/lib/telegram/bot/types/bot_command_scope_all_group_chats.rb +1 -1
  14. data/lib/telegram/bot/types/bot_command_scope_all_private_chats.rb +1 -1
  15. data/lib/telegram/bot/types/bot_command_scope_chat.rb +2 -2
  16. data/lib/telegram/bot/types/bot_command_scope_chat_administrators.rb +2 -2
  17. data/lib/telegram/bot/types/bot_command_scope_chat_member.rb +3 -3
  18. data/lib/telegram/bot/types/bot_command_scope_default.rb +1 -1
  19. data/lib/telegram/bot/types/callback_query.rb +6 -6
  20. data/lib/telegram/bot/types/chat.rb +29 -28
  21. data/lib/telegram/bot/types/chat_administrator_rights.rb +13 -12
  22. data/lib/telegram/bot/types/chat_invite_link.rb +8 -8
  23. data/lib/telegram/bot/types/chat_join_request.rb +3 -3
  24. data/lib/telegram/bot/types/chat_location.rb +1 -1
  25. data/lib/telegram/bot/types/chat_member.rb +0 -22
  26. data/lib/telegram/bot/types/chat_member_administrator.rb +26 -0
  27. data/lib/telegram/bot/types/chat_member_banned.rb +13 -0
  28. data/lib/telegram/bot/types/chat_member_left.rb +12 -0
  29. data/lib/telegram/bot/types/chat_member_member.rb +12 -0
  30. data/lib/telegram/bot/types/chat_member_owner.rb +14 -0
  31. data/lib/telegram/bot/types/chat_member_restricted.rb +23 -0
  32. data/lib/telegram/bot/types/chat_member_updated.rb +2 -2
  33. data/lib/telegram/bot/types/chat_permissions.rb +9 -8
  34. data/lib/telegram/bot/types/chat_photo.rb +4 -4
  35. data/lib/telegram/bot/types/chosen_inline_result.rb +4 -4
  36. data/lib/telegram/bot/types/contact.rb +5 -5
  37. data/lib/telegram/bot/types/dice.rb +2 -2
  38. data/lib/telegram/bot/types/document.rb +6 -6
  39. data/lib/telegram/bot/types/encrypted_credentials.rb +3 -3
  40. data/lib/telegram/bot/types/encrypted_passport_element.rb +10 -10
  41. data/lib/telegram/bot/types/file.rb +4 -4
  42. data/lib/telegram/bot/types/force_reply.rb +3 -3
  43. data/lib/telegram/bot/types/forum_topic.rb +14 -0
  44. data/lib/telegram/bot/types/forum_topic_closed.rb +10 -0
  45. data/lib/telegram/bot/types/forum_topic_created.rb +13 -0
  46. data/lib/telegram/bot/types/forum_topic_edited.rb +12 -0
  47. data/lib/telegram/bot/types/forum_topic_reopened.rb +10 -0
  48. data/lib/telegram/bot/types/game.rb +6 -6
  49. data/lib/telegram/bot/types/game_high_score.rb +2 -2
  50. data/lib/telegram/bot/types/general_forum_topic_hidden.rb +10 -0
  51. data/lib/telegram/bot/types/general_forum_topic_unhidden.rb +10 -0
  52. data/lib/telegram/bot/types/inline_keyboard_button.rb +9 -9
  53. data/lib/telegram/bot/types/inline_keyboard_markup.rb +1 -1
  54. data/lib/telegram/bot/types/inline_query.rb +5 -5
  55. data/lib/telegram/bot/types/inline_query_result_article.rb +10 -10
  56. data/lib/telegram/bot/types/inline_query_result_audio.rb +11 -10
  57. data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +8 -7
  58. data/lib/telegram/bot/types/inline_query_result_cached_document.rb +10 -9
  59. data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +9 -8
  60. data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +9 -8
  61. data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +10 -9
  62. data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +5 -5
  63. data/lib/telegram/bot/types/inline_query_result_cached_video.rb +10 -9
  64. data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +9 -8
  65. data/lib/telegram/bot/types/inline_query_result_contact.rb +11 -11
  66. data/lib/telegram/bot/types/inline_query_result_document.rb +14 -13
  67. data/lib/telegram/bot/types/inline_query_result_game.rb +4 -4
  68. data/lib/telegram/bot/types/inline_query_result_gif.rb +14 -12
  69. data/lib/telegram/bot/types/inline_query_result_location.rb +14 -14
  70. data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +14 -13
  71. data/lib/telegram/bot/types/inline_query_result_photo.rb +13 -12
  72. data/lib/telegram/bot/types/inline_query_result_venue.rb +15 -15
  73. data/lib/telegram/bot/types/inline_query_result_video.rb +15 -14
  74. data/lib/telegram/bot/types/inline_query_result_voice.rb +10 -9
  75. data/lib/telegram/bot/types/input_contact_message_content.rb +4 -4
  76. data/lib/telegram/bot/types/input_invoice_message_content.rb +20 -20
  77. data/lib/telegram/bot/types/input_location_message_content.rb +6 -6
  78. data/lib/telegram/bot/types/input_media_animation.rb +10 -8
  79. data/lib/telegram/bot/types/input_media_audio.rb +9 -8
  80. data/lib/telegram/bot/types/input_media_document.rb +7 -7
  81. data/lib/telegram/bot/types/input_media_photo.rb +6 -4
  82. data/lib/telegram/bot/types/input_media_video.rb +11 -8
  83. data/lib/telegram/bot/types/input_text_message_content.rb +4 -3
  84. data/lib/telegram/bot/types/input_venue_message_content.rb +8 -8
  85. data/lib/telegram/bot/types/invoice.rb +5 -5
  86. data/lib/telegram/bot/types/keyboard_button.rb +5 -5
  87. data/lib/telegram/bot/types/keyboard_button_poll_type.rb +1 -1
  88. data/lib/telegram/bot/types/labeled_price.rb +2 -2
  89. data/lib/telegram/bot/types/location.rb +6 -6
  90. data/lib/telegram/bot/types/login_url.rb +4 -4
  91. data/lib/telegram/bot/types/mask_position.rb +4 -4
  92. data/lib/telegram/bot/types/menu_button_commands.rb +1 -1
  93. data/lib/telegram/bot/types/menu_button_default.rb +1 -1
  94. data/lib/telegram/bot/types/menu_button_web_app.rb +2 -2
  95. data/lib/telegram/bot/types/message.rb +68 -58
  96. data/lib/telegram/bot/types/message_auto_delete_timer_changed.rb +1 -1
  97. data/lib/telegram/bot/types/message_entity.rb +7 -7
  98. data/lib/telegram/bot/types/order_info.rb +4 -4
  99. data/lib/telegram/bot/types/passport_data.rb +1 -1
  100. data/lib/telegram/bot/types/passport_element_error_data_field.rb +5 -5
  101. data/lib/telegram/bot/types/passport_element_error_file.rb +4 -4
  102. data/lib/telegram/bot/types/passport_element_error_files.rb +4 -4
  103. data/lib/telegram/bot/types/passport_element_error_front_side.rb +4 -4
  104. data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +4 -4
  105. data/lib/telegram/bot/types/passport_element_error_selfie.rb +4 -4
  106. data/lib/telegram/bot/types/passport_element_error_translation_file.rb +4 -4
  107. data/lib/telegram/bot/types/passport_element_error_translation_files.rb +4 -4
  108. data/lib/telegram/bot/types/passport_element_error_unspecified.rb +4 -4
  109. data/lib/telegram/bot/types/passport_file.rb +4 -4
  110. data/lib/telegram/bot/types/photo_size.rb +5 -5
  111. data/lib/telegram/bot/types/poll.rb +13 -13
  112. data/lib/telegram/bot/types/poll_answer.rb +2 -2
  113. data/lib/telegram/bot/types/poll_option.rb +2 -2
  114. data/lib/telegram/bot/types/pre_checkout_query.rb +6 -6
  115. data/lib/telegram/bot/types/proximity_alert_triggered.rb +1 -1
  116. data/lib/telegram/bot/types/reply_keyboard_markup.rb +6 -5
  117. data/lib/telegram/bot/types/reply_keyboard_remove.rb +2 -2
  118. data/lib/telegram/bot/types/sent_web_app_message.rb +1 -1
  119. data/lib/telegram/bot/types/shipping_address.rb +6 -6
  120. data/lib/telegram/bot/types/shipping_option.rb +3 -3
  121. data/lib/telegram/bot/types/shipping_query.rb +2 -2
  122. data/lib/telegram/bot/types/sticker.rb +14 -14
  123. data/lib/telegram/bot/types/sticker_set.rb +7 -8
  124. data/lib/telegram/bot/types/successful_payment.rb +7 -7
  125. data/lib/telegram/bot/types/update.rb +15 -15
  126. data/lib/telegram/bot/types/user.rb +11 -11
  127. data/lib/telegram/bot/types/user_profile_photos.rb +2 -2
  128. data/lib/telegram/bot/types/venue.rb +6 -6
  129. data/lib/telegram/bot/types/video.rb +9 -9
  130. data/lib/telegram/bot/types/video_chat_ended.rb +1 -1
  131. data/lib/telegram/bot/types/video_chat_participants_invited.rb +1 -1
  132. data/lib/telegram/bot/types/video_chat_scheduled.rb +1 -1
  133. data/lib/telegram/bot/types/video_note.rb +6 -6
  134. data/lib/telegram/bot/types/voice.rb +5 -5
  135. data/lib/telegram/bot/types/web_app_data.rb +2 -2
  136. data/lib/telegram/bot/types/web_app_info.rb +1 -1
  137. data/lib/telegram/bot/types/webhook_info.rb +9 -9
  138. data/lib/telegram/bot/types/write_access_allowed.rb +10 -0
  139. data/lib/telegram/bot/types.rb +7 -124
  140. data/lib/telegram/bot/version.rb +1 -1
  141. data/lib/telegram/bot.rb +7 -9
  142. data/telegram-bot-ruby.gemspec +4 -2
  143. metadata +56 -14
  144. data/lib/telegram/bot/exceptions.rb +0 -4
@@ -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
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class MenuButtonCommands < Base
7
- attribute :type, String, default: 'commands'
7
+ attribute :type, Types::String.default('commands')
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class MenuButtonDefault < Base
7
- attribute :type, String, default: 'default'
7
+ attribute :type, Types::String.default('default')
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 MenuButtonWebApp < Base
7
- attribute :type, String, default: 'web_app'
8
- attribute :text, String
7
+ attribute :type, Types::String.default('web_app')
8
+ attribute :text, Types::String
9
9
  attribute :web_app, WebAppInfo
10
10
  end
11
11
  end
@@ -4,65 +4,75 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class Message < Base
7
- attribute :message_id, Integer
8
- attribute :from, User
9
- attribute :sender_chat, Chat
10
- attribute :date, Integer
7
+ attribute :message_id, Types::Integer
8
+ attribute? :message_thread_id, Types::Integer
9
+ attribute? :from, User
10
+ attribute? :sender_chat, Chat
11
+ attribute :date, Types::Integer
11
12
  attribute :chat, Chat
12
- attribute :forward_from, User
13
- attribute :forward_from_chat, Chat
14
- attribute :forward_from_message_id, Integer
15
- attribute :forward_signature, String
16
- attribute :forward_sender_name, String
17
- attribute :forward_date, Integer
18
- attribute :is_automatic_forward, Boolean
19
- attribute :reply_to_message, Message
20
- attribute :via_bot, User
21
- attribute :edit_date, Integer
22
- attribute :has_protected_content, Boolean
23
- attribute :media_group_id, String
24
- attribute :author_signature, String
25
- attribute :text, String
26
- attribute :entities, Array[MessageEntity]
27
- attribute :animation, Animation
28
- attribute :audio, Audio
29
- attribute :document, Document
30
- attribute :photo, Array[PhotoSize]
31
- attribute :sticker, Sticker
32
- attribute :video, Video
33
- attribute :video_note, VideoNote
34
- attribute :voice, Voice
35
- attribute :caption, String
36
- attribute :caption_entities, Array[MessageEntity]
37
- attribute :contact, Contact
38
- attribute :dice, Dice
39
- attribute :game, Game
40
- attribute :poll, Poll
41
- attribute :venue, Venue
42
- attribute :location, Location
43
- attribute :new_chat_members, Array[User]
44
- attribute :left_chat_member, User
45
- attribute :new_chat_title, String
46
- attribute :new_chat_photo, Array[PhotoSize]
47
- attribute :delete_chat_photo, Boolean
48
- attribute :group_chat_created, Boolean
49
- attribute :supergroup_chat_created, Boolean
50
- attribute :channel_chat_created, Boolean
51
- attribute :message_auto_delete_timer_changed, MessageAutoDeleteTimerChanged
52
- attribute :migrate_to_chat_id, Integer
53
- attribute :migrate_from_chat_id, Integer
54
- attribute :pinned_message, Message
55
- attribute :invoice, Invoice
56
- attribute :successful_payment, SuccessfulPayment
57
- attribute :connected_website, String
58
- attribute :passport_data, PassportData
59
- attribute :proximity_alert_triggered, ProximityAlertTriggered
60
- attribute :video_chat_scheduled, VideoChatScheduled
61
- attribute :video_chat_started, VideoChatStarted
62
- attribute :video_chat_ended, VideoChatEnded
63
- attribute :video_chat_participants_invited, VideoChatParticipantsInvited
64
- attribute :web_app_data, WebAppData
65
- attribute :reply_markup, InlineKeyboardMarkup
13
+ attribute? :forward_from, User
14
+ attribute? :forward_from_chat, Chat
15
+ attribute? :forward_from_message_id, Types::Integer
16
+ attribute? :forward_signature, Types::String
17
+ attribute? :forward_sender_name, Types::String
18
+ attribute? :forward_date, Types::Integer
19
+ attribute? :is_topic_message, Types::Bool
20
+ attribute? :is_automatic_forward, Types::Bool
21
+ attribute? :reply_to_message, Message
22
+ attribute? :via_bot, User
23
+ attribute? :edit_date, Types::Integer
24
+ attribute? :has_protected_content, Types::Bool
25
+ attribute? :media_group_id, Types::String
26
+ attribute? :author_signature, Types::String
27
+ attribute? :text, Types::String
28
+ attribute? :entities, Types::Array.of(MessageEntity)
29
+ attribute? :animation, Animation
30
+ attribute? :audio, Audio
31
+ attribute? :document, Document
32
+ attribute? :photo, Types::Array.of(PhotoSize)
33
+ attribute? :sticker, Sticker
34
+ attribute? :video, Video
35
+ attribute? :video_note, VideoNote
36
+ attribute? :voice, Voice
37
+ attribute? :caption, Types::String
38
+ attribute? :caption_entities, Types::Array.of(MessageEntity)
39
+ attribute? :has_media_spoiler, Types::Bool
40
+ attribute? :contact, Contact
41
+ attribute? :dice, Dice
42
+ attribute? :game, Game
43
+ attribute? :poll, Poll
44
+ attribute? :venue, Venue
45
+ attribute? :location, Location
46
+ attribute? :new_chat_members, Types::Array.of(User)
47
+ attribute? :left_chat_member, User
48
+ attribute? :new_chat_title, Types::String
49
+ attribute? :new_chat_photo, Types::Array.of(PhotoSize)
50
+ attribute? :delete_chat_photo, Types::Bool
51
+ attribute? :group_chat_created, Types::Bool
52
+ attribute? :supergroup_chat_created, Types::Bool
53
+ attribute? :channel_chat_created, Types::Bool
54
+ attribute? :message_auto_delete_timer_changed, MessageAutoDeleteTimerChanged
55
+ attribute? :migrate_to_chat_id, Types::Integer
56
+ attribute? :migrate_from_chat_id, Types::Integer
57
+ attribute? :pinned_message, Message
58
+ attribute? :invoice, Invoice
59
+ attribute? :successful_payment, SuccessfulPayment
60
+ attribute? :connected_website, Types::String
61
+ attribute? :write_access_allowed, WriteAccessAllowed
62
+ attribute? :passport_data, PassportData
63
+ attribute? :proximity_alert_triggered, ProximityAlertTriggered
64
+ attribute? :forum_topic_created, ForumTopicCreated
65
+ attribute? :forum_topic_edited, ForumTopicEdited
66
+ attribute? :forum_topic_closed, ForumTopicClosed
67
+ attribute? :forum_topic_reopened, ForumTopicReopened
68
+ attribute? :general_forum_topic_hidden, GeneralForumTopicHidden
69
+ attribute? :general_forum_topic_unhidden, GeneralForumTopicUnhidden
70
+ attribute? :video_chat_scheduled, VideoChatScheduled
71
+ attribute? :video_chat_started, VideoChatStarted
72
+ attribute? :video_chat_ended, VideoChatEnded
73
+ attribute? :video_chat_participants_invited, VideoChatParticipantsInvited
74
+ attribute? :web_app_data, WebAppData
75
+ attribute? :reply_markup, InlineKeyboardMarkup
66
76
 
67
77
  alias to_s text
68
78
  end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class MessageAutoDeleteTimerChanged < Base
7
- attribute :message_auto_delete_time, Integer
7
+ attribute :message_auto_delete_time, Types::Integer
8
8
  end
9
9
  end
10
10
  end
@@ -4,13 +4,13 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class MessageEntity < Base
7
- attribute :type, String
8
- attribute :offset, Integer
9
- attribute :length, Integer
10
- attribute :url, String
11
- attribute :user, User
12
- attribute :language, String
13
- attribute :custom_emoji_id, String
7
+ attribute :type, Types::String
8
+ attribute :offset, Types::Integer
9
+ attribute :length, Types::Integer
10
+ attribute? :url, Types::String
11
+ attribute? :user, User
12
+ attribute? :language, Types::String
13
+ attribute? :custom_emoji_id, Types::String
14
14
  end
15
15
  end
16
16
  end
@@ -4,10 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class OrderInfo < Base
7
- attribute :name, String
8
- attribute :phone_number, String
9
- attribute :email, String
10
- attribute :shipping_address, ShippingAddress
7
+ attribute? :name, Types::String
8
+ attribute? :phone_number, Types::String
9
+ attribute? :email, Types::String
10
+ attribute? :shipping_address, ShippingAddress
11
11
  end
12
12
  end
13
13
  end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportData < Base
7
- attribute :data, Array[EncryptedPassportElement]
7
+ attribute :data, Types::Array.of(EncryptedPassportElement)
8
8
  attribute :credentials, EncryptedCredentials
9
9
  end
10
10
  end
@@ -4,11 +4,11 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorDataField < Base
7
- attribute :source, String, default: 'data'
8
- attribute :type, String
9
- attribute :field_name, String
10
- attribute :data_hash, String
11
- attribute :message, String
7
+ attribute :source, Types::String.default('data')
8
+ attribute :type, Types::String
9
+ attribute :field_name, Types::String
10
+ attribute :data_hash, Types::String
11
+ attribute :message, Types::String
12
12
  end
13
13
  end
14
14
  end
@@ -4,10 +4,10 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PassportElementErrorFile < Base
7
- attribute :source, String, default: 'file'
8
- attribute :type, String
9
- attribute :file_hash, String
10
- attribute :message, String
7
+ attribute :source, Types::String.default('file')
8
+ attribute :type, Types::String
9
+ attribute :file_hash, Types::String
10
+ attribute :message, Types::String
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 PassportElementErrorFiles < Base
7
- attribute :source, String, default: 'files'
8
- attribute :type, String
9
- attribute :file_hashes, Array[String]
10
- attribute :message, String
7
+ attribute :source, Types::String.default('files')
8
+ attribute :type, Types::String
9
+ attribute :file_hashes, Types::Array.of(String)
10
+ attribute :message, Types::String
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 PassportElementErrorFrontSide < Base
7
- attribute :source, String, default: 'front_side'
8
- attribute :type, String
9
- attribute :file_hash, String
10
- attribute :message, String
7
+ attribute :source, Types::String.default('front_side')
8
+ attribute :type, Types::String
9
+ attribute :file_hash, Types::String
10
+ attribute :message, Types::String
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 PassportElementErrorReverseSide < Base
7
- attribute :source, String, default: 'reverse_side'
8
- attribute :type, String
9
- attribute :file_hash, String
10
- attribute :message, String
7
+ attribute :source, Types::String.default('reverse_side')
8
+ attribute :type, Types::String
9
+ attribute :file_hash, Types::String
10
+ attribute :message, Types::String
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 PassportElementErrorSelfie < Base
7
- attribute :source, String, default: 'selfie'
8
- attribute :type, String
9
- attribute :file_hash, String
10
- attribute :message, String
7
+ attribute :source, Types::String.default('selfie')
8
+ attribute :type, Types::String
9
+ attribute :file_hash, Types::String
10
+ attribute :message, Types::String
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 PassportElementErrorTranslationFile < Base
7
- attribute :source, String, default: 'translation_file'
8
- attribute :type, String
9
- attribute :file_hash, String
10
- attribute :message, String
7
+ attribute :source, Types::String.default('translation_file')
8
+ attribute :type, Types::String
9
+ attribute :file_hash, Types::String
10
+ attribute :message, Types::String
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 PassportElementErrorTranslationFiles < Base
7
- attribute :source, String, default: 'translation_files'
8
- attribute :type, String
9
- attribute :file_hashes, Array[String]
10
- attribute :message, String
7
+ attribute :source, Types::String.default('translation_files')
8
+ attribute :type, Types::String
9
+ attribute :file_hashes, Types::Array.of(String)
10
+ attribute :message, Types::String
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 PassportElementErrorUnspecified < Base
7
- attribute :source, String, default: 'unspecified'
8
- attribute :type, String
9
- attribute :element_hash, String
10
- attribute :message, String
7
+ attribute :source, Types::String.default('unspecified')
8
+ attribute :type, Types::String
9
+ attribute :element_hash, Types::String
10
+ attribute :message, Types::String
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 PassportFile < Base
7
- attribute :file_id, String
8
- attribute :file_unique_id, String
9
- attribute :file_size, Integer
10
- attribute :file_date, Integer
7
+ attribute :file_id, Types::String
8
+ attribute :file_unique_id, Types::String
9
+ attribute :file_size, Types::Integer
10
+ attribute :file_date, Types::Integer
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 PhotoSize < Base
7
- attribute :file_id, String
8
- attribute :file_unique_id, String
9
- attribute :width, Integer
10
- attribute :height, Integer
11
- attribute :file_size, Integer
7
+ attribute :file_id, Types::String
8
+ attribute :file_unique_id, Types::String
9
+ attribute :width, Types::Integer
10
+ attribute :height, Types::Integer
11
+ attribute? :file_size, Types::Integer
12
12
  end
13
13
  end
14
14
  end
@@ -4,19 +4,19 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class Poll < Base
7
- attribute :id, String
8
- attribute :question, String
9
- attribute :options, Array[PollOption]
10
- attribute :total_voter_count, Integer
11
- attribute :is_closed, Boolean
12
- attribute :is_anonymous, Boolean
13
- attribute :type, String
14
- attribute :allows_multiple_answers, Boolean
15
- attribute :correct_option_id, Integer
16
- attribute :explanation, String
17
- attribute :explanation_entities, Array[MessageEntity]
18
- attribute :open_period, Integer
19
- attribute :close_date, Integer
7
+ attribute :id, Types::String
8
+ attribute :question, Types::String
9
+ attribute :options, Types::Array.of(PollOption)
10
+ attribute :total_voter_count, Types::Integer
11
+ attribute :is_closed, Types::Bool
12
+ attribute :is_anonymous, Types::Bool
13
+ attribute :type, Types::String
14
+ attribute :allows_multiple_answers, Types::Bool
15
+ attribute? :correct_option_id, Types::Integer
16
+ attribute? :explanation, Types::String
17
+ attribute? :explanation_entities, Types::Array.of(MessageEntity)
18
+ attribute? :open_period, Types::Integer
19
+ attribute? :close_date, Types::Integer
20
20
  end
21
21
  end
22
22
  end
@@ -4,9 +4,9 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PollAnswer < Base
7
- attribute :poll_id, String
7
+ attribute :poll_id, Types::String
8
8
  attribute :user, User
9
- attribute :option_ids, Array[Integer]
9
+ attribute :option_ids, Types::Array.of(Types::Integer)
10
10
  end
11
11
  end
12
12
  end
@@ -4,8 +4,8 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PollOption < Base
7
- attribute :text, String
8
- attribute :voter_count, Integer
7
+ attribute :text, Types::String
8
+ attribute :voter_count, Types::Integer
9
9
  end
10
10
  end
11
11
  end
@@ -4,13 +4,13 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class PreCheckoutQuery < Base
7
- attribute :id, String
7
+ attribute :id, Types::String
8
8
  attribute :from, User
9
- attribute :currency, String
10
- attribute :total_amount, Integer
11
- attribute :invoice_payload, String
12
- attribute :shipping_option_id, String
13
- attribute :order_info, OrderInfo
9
+ attribute :currency, Types::String
10
+ attribute :total_amount, Types::Integer
11
+ attribute :invoice_payload, Types::String
12
+ attribute? :shipping_option_id, Types::String
13
+ attribute? :order_info, OrderInfo
14
14
  end
15
15
  end
16
16
  end
@@ -6,7 +6,7 @@ module Telegram
6
6
  class ProximityAlertTriggered < Base
7
7
  attribute :traveler, User
8
8
  attribute :watcher, User
9
- attribute :distance, Integer
9
+ attribute :distance, Types::Integer
10
10
  end
11
11
  end
12
12
  end
@@ -4,11 +4,12 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ReplyKeyboardMarkup < Base
7
- attribute :keyboard, Array[Array[KeyboardButton]]
8
- attribute :resize_keyboard, Boolean, default: false
9
- attribute :one_time_keyboard, Boolean, default: false
10
- attribute :input_field_placeholder, String
11
- attribute :selective, Boolean, default: false
7
+ attribute :keyboard, Types::Array.of(Types::Array.of(KeyboardButton))
8
+ attribute? :is_persistent, Types::Bool.default(false)
9
+ attribute? :resize_keyboard, Types::Bool.default(false)
10
+ attribute? :one_time_keyboard, Types::Bool.default(false)
11
+ attribute? :input_field_placeholder, Types::String
12
+ attribute? :selective, Types::Bool.default(false)
12
13
 
13
14
  def to_compact_hash
14
15
  hsh = super
@@ -4,8 +4,8 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ReplyKeyboardRemove < Base
7
- attribute :remove_keyboard, Boolean
8
- attribute :selective, Boolean, default: false
7
+ attribute :remove_keyboard, Types::Bool
8
+ attribute? :selective, Types::Bool.default(false)
9
9
  end
10
10
  end
11
11
  end
@@ -4,7 +4,7 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class SentWebAppMessage < Base
7
- attribute :inline_message_id, String
7
+ attribute? :inline_message_id, Types::String
8
8
  end
9
9
  end
10
10
  end
@@ -4,12 +4,12 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ShippingAddress < Base
7
- attribute :country_code, String
8
- attribute :state, String
9
- attribute :city, String
10
- attribute :street_line1, String
11
- attribute :street_line2, String
12
- attribute :post_code, String
7
+ attribute :country_code, Types::String
8
+ attribute :state, Types::String
9
+ attribute :city, Types::String
10
+ attribute :street_line1, Types::String
11
+ attribute :street_line2, Types::String
12
+ attribute :post_code, Types::String
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 ShippingOption < Base
7
- attribute :id, String
8
- attribute :title, String
9
- attribute :prices, Array[LabeledPrice]
7
+ attribute :id, Types::String
8
+ attribute :title, Types::String
9
+ attribute :prices, Types::Array.of(LabeledPrice)
10
10
  end
11
11
  end
12
12
  end