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,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,70 @@ 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? :contact, Contact
40
+ attribute? :dice, Dice
41
+ attribute? :game, Game
42
+ attribute? :poll, Poll
43
+ attribute? :venue, Venue
44
+ attribute? :location, Location
45
+ attribute? :new_chat_members, Types::Array.of(User)
46
+ attribute? :left_chat_member, User
47
+ attribute? :new_chat_title, Types::String
48
+ attribute? :new_chat_photo, Types::Array.of(PhotoSize)
49
+ attribute? :delete_chat_photo, Types::Bool
50
+ attribute? :group_chat_created, Types::Bool
51
+ attribute? :supergroup_chat_created, Types::Bool
52
+ attribute? :channel_chat_created, Types::Bool
53
+ attribute? :message_auto_delete_timer_changed, MessageAutoDeleteTimerChanged
54
+ attribute? :migrate_to_chat_id, Types::Integer
55
+ attribute? :migrate_from_chat_id, Types::Integer
56
+ attribute? :pinned_message, Message
57
+ attribute? :invoice, Invoice
58
+ attribute? :successful_payment, SuccessfulPayment
59
+ attribute? :connected_website, Types::String
60
+ attribute? :passport_data, PassportData
61
+ attribute? :proximity_alert_triggered, ProximityAlertTriggered
62
+ attribute? :forum_topic_created, ForumTopicCreated
63
+ attribute? :forum_topic_closed, ForumTopicClosed
64
+ attribute? :forum_topic_reopened, ForumTopicReopened
65
+ attribute? :video_chat_scheduled, VideoChatScheduled
66
+ attribute? :video_chat_started, VideoChatStarted
67
+ attribute? :video_chat_ended, VideoChatEnded
68
+ attribute? :video_chat_participants_invited, VideoChatParticipantsInvited
69
+ attribute? :web_app_data, WebAppData
70
+ attribute? :reply_markup, InlineKeyboardMarkup
66
71
 
67
72
  alias to_s text
68
73
  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,11 @@ 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? :resize_keyboard, Types::Bool.default(false)
9
+ attribute? :one_time_keyboard, Types::Bool.default(false)
10
+ attribute? :input_field_placeholder, Types::String
11
+ attribute? :selective, Types::Bool.default(false)
12
12
 
13
13
  def to_compact_hash
14
14
  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
@@ -4,9 +4,9 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class ShippingQuery < Base
7
- attribute :id, String
7
+ attribute :id, Types::String
8
8
  attribute :from, User
9
- attribute :invoice_payload, String
9
+ attribute :invoice_payload, Types::String
10
10
  attribute :shipping_address, ShippingAddress
11
11
  end
12
12
  end
@@ -4,20 +4,20 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class Sticker < Base
7
- attribute :file_id, String
8
- attribute :file_unique_id, String
9
- attribute :type, String
10
- attribute :width, Integer
11
- attribute :height, Integer
12
- attribute :is_animated, Boolean
13
- attribute :is_video, Boolean
14
- attribute :thumb, PhotoSize
15
- attribute :emoji, String
16
- attribute :set_name, String
17
- attribute :premium_animation, File
18
- attribute :mask_position, MaskPosition
19
- attribute :custom_emoji_id, String
20
- attribute :file_size, Integer
7
+ attribute :file_id, Types::String
8
+ attribute :file_unique_id, Types::String
9
+ attribute :type, Types::String
10
+ attribute :width, Types::Integer
11
+ attribute :height, Types::Integer
12
+ attribute :is_animated, Types::Bool
13
+ attribute :is_video, Types::Bool
14
+ attribute? :thumb, PhotoSize
15
+ attribute? :emoji, Types::String
16
+ attribute? :set_name, Types::String
17
+ attribute? :premium_animation, File
18
+ attribute? :mask_position, MaskPosition
19
+ attribute? :custom_emoji_id, Types::String
20
+ attribute? :file_size, Types::Integer
21
21
  end
22
22
  end
23
23
  end
@@ -4,14 +4,13 @@ module Telegram
4
4
  module Bot
5
5
  module Types
6
6
  class StickerSet < Base
7
- attribute :name, String
8
- attribute :title, String
9
- attribute :sticker_type, String
10
- attribute :is_animated, Boolean
11
- attribute :is_video, Boolean
12
- attribute :contains_masks, Boolean
13
- attribute :stickers, Array[Sticker]
14
- attribute :thumb, PhotoSize
7
+ attribute :name, Types::String
8
+ attribute :title, Types::String
9
+ attribute :sticker_type, Types::String
10
+ attribute :is_animated, Types::Bool
11
+ attribute :is_video, Types::Bool
12
+ attribute :stickers, Types::Array.of(Sticker)
13
+ attribute? :thumb, PhotoSize
15
14
  end
16
15
  end
17
16
  end