telegram-bot-types 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +14 -1
  3. data/.travis.yml +1 -1
  4. data/CHANGELOG.md +12 -0
  5. data/Gemfile +2 -0
  6. data/README.md +1 -1
  7. data/Rakefile +2 -0
  8. data/bin/console +1 -0
  9. data/bin/install_git_hooks +2 -1
  10. data/lib/telegram/bot/types/animation.rb +6 -0
  11. data/lib/telegram/bot/types/audio.rb +5 -0
  12. data/lib/telegram/bot/types/base.rb +31 -5
  13. data/lib/telegram/bot/types/callback_game.rb +2 -0
  14. data/lib/telegram/bot/types/callback_query.rb +2 -0
  15. data/lib/telegram/bot/types/chat.rb +6 -0
  16. data/lib/telegram/bot/types/chat_invite_link.rb +16 -0
  17. data/lib/telegram/bot/types/chat_location.rb +12 -0
  18. data/lib/telegram/bot/types/chat_member.rb +12 -4
  19. data/lib/telegram/bot/types/chat_member_updated.rb +16 -0
  20. data/lib/telegram/bot/types/chat_permissions.rb +18 -0
  21. data/lib/telegram/bot/types/chat_photo.rb +4 -0
  22. data/lib/telegram/bot/types/chosen_inline_result.rb +2 -0
  23. data/lib/telegram/bot/types/contact.rb +3 -0
  24. data/lib/telegram/bot/types/dice.rb +12 -0
  25. data/lib/telegram/bot/types/document.rb +3 -0
  26. data/lib/telegram/bot/types/encrypted_credentials.rb +13 -0
  27. data/lib/telegram/bot/types/encrypted_passport_element.rb +20 -0
  28. data/lib/telegram/bot/types/file.rb +3 -0
  29. data/lib/telegram/bot/types/force_reply.rb +3 -1
  30. data/lib/telegram/bot/types/game.rb +4 -2
  31. data/lib/telegram/bot/types/game_high_score.rb +2 -0
  32. data/lib/telegram/bot/types/inline_keyboard_button.rb +3 -0
  33. data/lib/telegram/bot/types/inline_keyboard_markup.rb +3 -1
  34. data/lib/telegram/bot/types/inline_query.rb +2 -0
  35. data/lib/telegram/bot/types/inline_query_result_article.rb +3 -1
  36. data/lib/telegram/bot/types/inline_query_result_audio.rb +4 -1
  37. data/lib/telegram/bot/types/inline_query_result_cached_audio.rb +4 -1
  38. data/lib/telegram/bot/types/inline_query_result_cached_document.rb +4 -1
  39. data/lib/telegram/bot/types/inline_query_result_cached_gif.rb +4 -1
  40. data/lib/telegram/bot/types/inline_query_result_cached_mpeg4_gif.rb +4 -1
  41. data/lib/telegram/bot/types/inline_query_result_cached_photo.rb +4 -1
  42. data/lib/telegram/bot/types/inline_query_result_cached_sticker.rb +3 -1
  43. data/lib/telegram/bot/types/inline_query_result_cached_video.rb +4 -1
  44. data/lib/telegram/bot/types/inline_query_result_cached_voice.rb +4 -1
  45. data/lib/telegram/bot/types/inline_query_result_contact.rb +4 -1
  46. data/lib/telegram/bot/types/inline_query_result_document.rb +4 -1
  47. data/lib/telegram/bot/types/inline_query_result_game.rb +3 -1
  48. data/lib/telegram/bot/types/inline_query_result_gif.rb +4 -1
  49. data/lib/telegram/bot/types/inline_query_result_location.rb +7 -1
  50. data/lib/telegram/bot/types/inline_query_result_mpeg4_gif.rb +5 -1
  51. data/lib/telegram/bot/types/inline_query_result_photo.rb +4 -1
  52. data/lib/telegram/bot/types/inline_query_result_venue.rb +6 -1
  53. data/lib/telegram/bot/types/inline_query_result_video.rb +4 -1
  54. data/lib/telegram/bot/types/inline_query_result_voice.rb +4 -1
  55. data/lib/telegram/bot/types/input_contact_message_content.rb +3 -0
  56. data/lib/telegram/bot/types/input_location_message_content.rb +6 -0
  57. data/lib/telegram/bot/types/input_media_animation.rb +18 -0
  58. data/lib/telegram/bot/types/input_media_audio.rb +18 -0
  59. data/lib/telegram/bot/types/input_media_document.rb +17 -0
  60. data/lib/telegram/bot/types/input_media_photo.rb +14 -0
  61. data/lib/telegram/bot/types/input_media_video.rb +18 -0
  62. data/lib/telegram/bot/types/input_message_content.rb +2 -0
  63. data/lib/telegram/bot/types/input_text_message_content.rb +2 -0
  64. data/lib/telegram/bot/types/input_venue_message_content.rb +5 -0
  65. data/lib/telegram/bot/types/invoice.rb +2 -0
  66. data/lib/telegram/bot/types/keyboard_button.rb +3 -0
  67. data/lib/telegram/bot/types/keyboard_button_poll_type.rb +11 -0
  68. data/lib/telegram/bot/types/labeled_price.rb +2 -0
  69. data/lib/telegram/bot/types/location.rb +6 -0
  70. data/lib/telegram/bot/types/login_url.rb +14 -0
  71. data/lib/telegram/bot/types/mask_position.rb +2 -0
  72. data/lib/telegram/bot/types/message.rb +22 -4
  73. data/lib/telegram/bot/types/message_auto_delete_timer_changed.rb +11 -0
  74. data/lib/telegram/bot/types/message_entity.rb +3 -0
  75. data/lib/telegram/bot/types/order_info.rb +2 -0
  76. data/lib/telegram/bot/types/passport_data.rb +12 -0
  77. data/lib/telegram/bot/types/passport_element_error_data_field.rb +15 -0
  78. data/lib/telegram/bot/types/passport_element_error_file.rb +14 -0
  79. data/lib/telegram/bot/types/passport_element_error_files.rb +14 -0
  80. data/lib/telegram/bot/types/passport_element_error_front_side.rb +14 -0
  81. data/lib/telegram/bot/types/passport_element_error_reverse_side.rb +14 -0
  82. data/lib/telegram/bot/types/passport_element_error_selfie.rb +14 -0
  83. data/lib/telegram/bot/types/passport_element_error_translation_file.rb +14 -0
  84. data/lib/telegram/bot/types/passport_element_error_translation_files.rb +14 -0
  85. data/lib/telegram/bot/types/passport_element_error_unspecified.rb +14 -0
  86. data/lib/telegram/bot/types/passport_file.rb +14 -0
  87. data/lib/telegram/bot/types/photo_size.rb +3 -0
  88. data/lib/telegram/bot/types/poll.rb +23 -0
  89. data/lib/telegram/bot/types/poll_answer.rb +13 -0
  90. data/lib/telegram/bot/types/poll_option.rb +12 -0
  91. data/lib/telegram/bot/types/pre_checkout_query.rb +2 -0
  92. data/lib/telegram/bot/types/proximity_alert_triggered.rb +13 -0
  93. data/lib/telegram/bot/types/reply_keyboard_markup.rb +6 -4
  94. data/lib/telegram/bot/types/reply_keyboard_remove.rb +3 -1
  95. data/lib/telegram/bot/types/response.rb +3 -1
  96. data/lib/telegram/bot/types/shipping_address.rb +2 -0
  97. data/lib/telegram/bot/types/shipping_option.rb +3 -1
  98. data/lib/telegram/bot/types/shipping_query.rb +2 -0
  99. data/lib/telegram/bot/types/sticker.rb +4 -0
  100. data/lib/telegram/bot/types/sticker_set.rb +5 -1
  101. data/lib/telegram/bot/types/successful_payment.rb +2 -0
  102. data/lib/telegram/bot/types/update.rb +6 -0
  103. data/lib/telegram/bot/types/user.rb +5 -0
  104. data/lib/telegram/bot/types/user_profile_photos.rb +3 -1
  105. data/lib/telegram/bot/types/venue.rb +5 -0
  106. data/lib/telegram/bot/types/version.rb +3 -1
  107. data/lib/telegram/bot/types/video.rb +4 -0
  108. data/lib/telegram/bot/types/video_note.rb +3 -0
  109. data/lib/telegram/bot/types/voice.rb +3 -0
  110. data/lib/telegram/bot/types/voice_chat_ended.rb +11 -0
  111. data/lib/telegram/bot/types/voice_chat_participants_invited.rb +11 -0
  112. data/lib/telegram/bot/types/voice_chat_started.rb +10 -0
  113. data/lib/telegram/bot/types/webhook_info.rb +6 -3
  114. data/lib/telegram/bot/types.rb +12 -72
  115. data/telegram-bot-types.gemspec +7 -5
  116. metadata +49 -17
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aab05294b56f06de9bef9d3db9e0df79676647e70317c7b0c06aae5f2239ce20
4
- data.tar.gz: 9cfcffd92a427841811599ed25754507b95312b37b27defd502553bcd12e3090
3
+ metadata.gz: 0d4df9be660382c7bee82232c59643d7ab50be12b85a26d552192a6d99888b26
4
+ data.tar.gz: ba50f17387c975027d9ecf851761db6a2cab9bb1cbf829d8e4534c6d6e679cca
5
5
  SHA512:
6
- metadata.gz: c14eaea7b52b4316e0afb339d4518e9c49aef2c308e9aa256627fa4c88983b6d0fad2c2da4c0b6a06c00dea019a6e07d7ca98de3fd55472907944a72e0d296e0
7
- data.tar.gz: 919d81aae912d75412d515e5618d9aaf2541c7b34f120496e7c2f54c3fdf67adc2a2d6c39e4ec7985c308dad2e377c65a159b8e4d3ff978fb309c37ffd499a0b
6
+ metadata.gz: '01487ea354a9775fb6cb3888309bb7a138612b27cf01c2f3085a23622e3dacb48ebe15b10640ff89140ef7839552598aaf174a097bc9d4a066c7ea6c06dd3859'
7
+ data.tar.gz: 42d3966817d6fb83548c2bd0f3f8deacf9b8fa4c3af7bede415713d752509d1ecff87732263bed01d07005af44eaf4315520d2194ae8788d6c9bb7b84d8bdac4
data/.rubocop.yml CHANGED
@@ -1,4 +1,17 @@
1
+ Layout/EmptyLineAfterGuardClause: {Enabled: false}
2
+ Layout/SpaceInsideHashLiteralBraces: {EnforcedStyle: no_space}
1
3
  Metrics/LineLength: {Max: 100}
2
4
  Style/Alias: {EnforcedStyle: prefer_alias_method}
3
5
  Style/Documentation: {Enabled: false}
4
- Style/TrailingCommaInLiteral: {EnforcedStyleForMultiline: comma}
6
+ Style/TrailingCommaInArrayLiteral: {EnforcedStyleForMultiline: comma}
7
+ Style/TrailingCommaInHashLiteral: {EnforcedStyleForMultiline: comma}
8
+
9
+ # New cops. Need to be explicitly enabled to prevent warning.
10
+ Lint/RaiseException: {Enabled: true}
11
+ Lint/StructNewOverride: {Enabled: true}
12
+ Style/HashEachMethods: {Enabled: true}
13
+ Style/HashTransformKeys: {Enabled: true}
14
+ Style/HashTransformValues: {Enabled: true}
15
+
16
+ # This one offences all specs, routes and some initializers.
17
+ Metrics/BlockLength: {Enabled: false}
data/.travis.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.2.3
4
+ - 2.6
5
5
  notifications:
6
6
  email: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.7.0
4
+
5
+ - Use dry-types instead of virtus.
6
+
7
+ # 0.6.3
8
+
9
+ - Bunch of new types from Bot API 5.3.
10
+
11
+ # 0.6.2
12
+
13
+ - Bunch of new types.
14
+
3
15
  # 0.6.1
4
16
 
5
17
  - Strip empty values from `#to_hash`.
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Virtus types for Telegram Bot API.
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/telegram-bot-types.svg)](http://badge.fury.io/rb/telegram-bot-types)
6
- [![Build Status](https://travis-ci.org/telegram-bot-rb/telegram-bot-types.svg)](https://travis-ci.org/telegram-bot-rb/telegram-bot-types)
6
+ [![Build Status](https://app.travis-ci.com/telegram-bot-rb/telegram-bot-types.svg)](https://app.travis-ci.com/github/telegram-bot-rb/telegram-bot-types)
7
7
 
8
8
  ## Installation
9
9
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'telegram/bot/types'
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- root = File.expand_path('../../', __FILE__)
4
+ root = File.expand_path('..', __dir__)
4
5
  hooks_dir = "#{root}/bin/git-hooks"
5
6
 
6
7
  `ls -1 #{hooks_dir}`.each_line.map(&:strip).each do |file|
@@ -1,8 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class Animation < Base
5
7
  attribute :file_id, String
8
+ attribute :file_unique_id, String
9
+ attribute :width, Integer
10
+ attribute :height, Integer
11
+ attribute :duration, Integer
6
12
  attribute :thumb, PhotoSize
7
13
  attribute :file_name, String
8
14
  attribute :mime_type, String
@@ -1,13 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class Audio < Base
5
7
  attribute :file_id, String
8
+ attribute :file_unique_id, String
6
9
  attribute :duration, Integer
7
10
  attribute :performer, String
8
11
  attribute :title, String
12
+ attribute :file_name, String
9
13
  attribute :mime_type, String
10
14
  attribute :file_size, Integer
15
+ attribute :thumb, PhotoSize
11
16
  end
12
17
  end
13
18
  end
@@ -1,13 +1,39 @@
1
- require 'virtus'
1
+ # frozen_string_literal: true
2
+
3
+ require 'dry/struct'
2
4
 
3
5
  module Telegram
4
6
  module Bot
5
7
  module Types
6
- class Base
7
- include Virtus.model
8
+ include Dry.Types()
9
+
10
+ # Collection of default types. They are also available without
11
+ # `Types::` prefix in nested classes in opposite to other built-in types.
12
+ Boolean = self::Bool
13
+ Integer = Coercible::Integer
14
+ Float = Coercible::Float
15
+ String = Coercible::String
16
+ Array = self::Array
17
+
18
+ class Base < Dry::Struct
19
+ transform_keys(&:to_sym)
20
+
21
+ class << self
22
+ # Make all attributes optional.
23
+ # Copied from #attribute?
24
+ def attribute(name, *args, &block)
25
+ super(:"#{name}?", build_type(name, *args, &block))
26
+ end
27
+ end
8
28
 
9
- def to_hash(*)
10
- super.reject { |_k, v| v.nil? }
29
+ # Access fields by string values for backward compatibility.
30
+ # Don't raise errors when accessing missing attributes.
31
+ # https://github.com/dry-rb/dry-struct/pull/177
32
+ def [](name)
33
+ name = name.to_sym
34
+ super(name)
35
+ rescue MissingAttributeError
36
+ raise unless self.class.attribute_names.include?(name)
11
37
  end
12
38
  end
13
39
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
@@ -13,6 +15,10 @@ module Telegram
13
15
  attribute :description, String
14
16
  attribute :invite_link, String
15
17
  attribute :pinned_message, Message
18
+ attribute :permissions, ChatPermissions
19
+ attribute :slow_mode_delay, Integer
20
+ attribute :sticker_set_name, String
21
+ attribute :can_set_sticker_set, Boolean
16
22
  end
17
23
  end
18
24
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChatInviteLink < Base
7
+ attribute :invite_link, String
8
+ attribute :creator, User
9
+ attribute :is_primary, Boolean
10
+ attribute :is_revoked, Boolean
11
+ attribute :expire_date, Integer
12
+ attribute :member_limit, Integer
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChatLocation < Base
7
+ attribute :location, Location
8
+ attribute :address, String
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,23 +1,31 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class ChatMember < Base
5
7
  attribute :user, User
6
8
  attribute :status, String
7
- attribute :until_date, Integer
9
+ attribute :custom_title, String
10
+ attribute :is_anonymous, Boolean
8
11
  attribute :can_be_edited, Boolean
9
- attribute :can_change_info, Boolean
12
+ attribute :can_manage_chat, Boolean
10
13
  attribute :can_post_messages, Boolean
11
14
  attribute :can_edit_messages, Boolean
12
15
  attribute :can_delete_messages, Boolean
13
- attribute :can_invite_users, Boolean
16
+ attribute :can_manage_voice_chats, Boolean
14
17
  attribute :can_restrict_members, Boolean
15
- attribute :can_pin_messages, Boolean
16
18
  attribute :can_promote_members, Boolean
19
+ attribute :can_change_info, Boolean
20
+ attribute :can_invite_users, Boolean
21
+ attribute :can_pin_messages, Boolean
22
+ attribute :is_member, Boolean
17
23
  attribute :can_send_messages, Boolean
18
24
  attribute :can_send_media_messages, Boolean
25
+ attribute :can_send_polls, Boolean
19
26
  attribute :can_send_other_messages, Boolean
20
27
  attribute :can_add_web_page_previews, Boolean
28
+ attribute :until_date, Integer
21
29
  end
22
30
  end
23
31
  end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class ChatMemberUpdated < Base
7
+ attribute :chat, Chat
8
+ attribute :from, User
9
+ attribute :date, Integer
10
+ attribute :old_chat_member, ChatMember
11
+ attribute :new_chat_member, ChatMember
12
+ attribute :invite_link, ChatInviteLink
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
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
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,9 +1,13 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class ChatPhoto < Base
5
7
  attribute :small_file_id, String
8
+ attribute :small_file_unique_id, String
6
9
  attribute :big_file_id, String
10
+ attribute :big_file_unique_id, String
7
11
  end
8
12
  end
9
13
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
@@ -6,6 +8,7 @@ module Telegram
6
8
  attribute :first_name, String
7
9
  attribute :last_name, String
8
10
  attribute :user_id, Integer
11
+ attribute :vcard, String
9
12
  end
10
13
  end
11
14
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class Dice < Base
7
+ attribute :emoji, String
8
+ attribute :value, Integer
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class Document < Base
5
7
  attribute :file_id, String
8
+ attribute :file_unique_id, String
6
9
  attribute :thumb, PhotoSize
7
10
  attribute :file_name, String
8
11
  attribute :mime_type, String
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
6
+ class EncryptedCredentials < Base
7
+ attribute :data, String
8
+ attribute :hash, String
9
+ attribute :secret, String
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Telegram
4
+ module Bot
5
+ module Types
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.of(PassportFile)
12
+ attribute :front_side, PassportFile
13
+ attribute :reverse_side, PassportFile
14
+ attribute :selfie, PassportFile
15
+ attribute :translation, Array.of(PassportFile)
16
+ attribute :hash, String
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,8 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class File < Base
5
7
  attribute :file_id, String
8
+ attribute :file_unique_id, String
6
9
  attribute :file_size, Integer
7
10
  attribute :file_path, String
8
11
  end
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class ForceReply < Base
5
7
  attribute :force_reply, Boolean
6
- attribute :selective, Boolean, default: false
8
+ attribute :selective, Boolean.default(false)
7
9
  end
8
10
  end
9
11
  end
@@ -1,12 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class Game < Base
5
7
  attribute :title, String
6
8
  attribute :description, String
7
- attribute :photo, [PhotoSize]
9
+ attribute :photo, Array.of(PhotoSize)
8
10
  attribute :text, String
9
- attribute :text_entities, [MessageEntity]
11
+ attribute :text_entities, Array.of(MessageEntity)
10
12
  attribute :animation, Animation
11
13
  end
12
14
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
@@ -1,9 +1,12 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineKeyboardButton < Base
5
7
  attribute :text, String
6
8
  attribute :url, String
9
+ attribute :login_url, LoginUrl
7
10
  attribute :callback_data, String
8
11
  attribute :switch_inline_query, String
9
12
  attribute :switch_inline_query_current_chat, String
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineKeyboardMarkup < Base
5
- attribute :inline_keyboard, [[InlineKeyboardButton]]
7
+ attribute :inline_keyboard, Array.of(Array.of(InlineKeyboardButton))
6
8
  end
7
9
  end
8
10
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultArticle < Base
5
- attribute :type, String, default: 'article'
7
+ attribute :type, String.default('article')
6
8
  attribute :id, String
7
9
  attribute :title, String
8
10
  attribute :input_message_content, InputMessageContent
@@ -1,12 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultAudio < Base
5
- attribute :type, String, default: 'audio'
7
+ attribute :type, String.default('audio')
6
8
  attribute :id, String
7
9
  attribute :audio_url, String
8
10
  attribute :title, String
9
11
  attribute :caption, String
12
+ attribute :parse_mode, String
10
13
  attribute :performer, String
11
14
  attribute :audio_duration, Integer
12
15
  attribute :reply_markup, InlineKeyboardMarkup
@@ -1,11 +1,14 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultCachedAudio < Base
5
- attribute :type, String, default: 'audio'
7
+ attribute :type, String.default('audio')
6
8
  attribute :id, String
7
9
  attribute :audio_file_id, String
8
10
  attribute :caption, String
11
+ attribute :parse_mode, String
9
12
  attribute :reply_markup, InlineKeyboardMarkup
10
13
  attribute :input_message_content, InputMessageContent
11
14
  end
@@ -1,13 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultCachedDocument < Base
5
- attribute :type, String, default: 'document'
7
+ attribute :type, String.default('document')
6
8
  attribute :id, String
7
9
  attribute :title, String
8
10
  attribute :document_file_id, String
9
11
  attribute :description, String
10
12
  attribute :caption, String
13
+ attribute :parse_mode, String
11
14
  attribute :reply_markup, InlineKeyboardMarkup
12
15
  attribute :input_message_content, InputMessageContent
13
16
  end
@@ -1,12 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultCachedGif < Base
5
- attribute :type, String, default: 'gif'
7
+ attribute :type, String.default('gif')
6
8
  attribute :id, String
7
9
  attribute :gif_file_id, String
8
10
  attribute :title, String
9
11
  attribute :caption, String
12
+ attribute :parse_mode, String
10
13
  attribute :reply_markup, InlineKeyboardMarkup
11
14
  attribute :input_message_content, InputMessageContent
12
15
  end
@@ -1,12 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultCachedMpeg4Gif < Base
5
- attribute :type, String, default: 'mpeg4_gif'
7
+ attribute :type, String.default('mpeg4_gif')
6
8
  attribute :id, String
7
9
  attribute :mpeg4_file_id, String
8
10
  attribute :title, String
9
11
  attribute :caption, String
12
+ attribute :parse_mode, String
10
13
  attribute :reply_markup, InlineKeyboardMarkup
11
14
  attribute :input_message_content, InputMessageContent
12
15
  end
@@ -1,13 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultCachedPhoto < Base
5
- attribute :type, String, default: 'photo'
7
+ attribute :type, String.default('photo')
6
8
  attribute :id, String
7
9
  attribute :photo_file_id, String
8
10
  attribute :title, String
9
11
  attribute :description, String
10
12
  attribute :caption, String
13
+ attribute :parse_mode, String
11
14
  attribute :reply_markup, InlineKeyboardMarkup
12
15
  attribute :input_message_content, InputMessageContent
13
16
  end
@@ -1,8 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultCachedSticker < Base
5
- attribute :type, String, default: 'sticker'
7
+ attribute :type, String.default('sticker')
6
8
  attribute :id, String
7
9
  attribute :sticker_file_id, String
8
10
  attribute :reply_markup, InlineKeyboardMarkup
@@ -1,13 +1,16 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Telegram
2
4
  module Bot
3
5
  module Types
4
6
  class InlineQueryResultCachedVideo < Base
5
- attribute :type, String, default: 'video'
7
+ attribute :type, String.default('video')
6
8
  attribute :id, String
7
9
  attribute :video_file_id, String
8
10
  attribute :title, String
9
11
  attribute :description, String
10
12
  attribute :caption, String
13
+ attribute :parse_mode, String
11
14
  attribute :reply_markup, InlineKeyboardMarkup
12
15
  attribute :input_message_content, InputMessageContent
13
16
  end