tdlib-ruby 2.0.0 → 2.1.0

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 (257) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/ChangeLog.md +5 -0
  4. data/README.md +9 -2
  5. data/bin/parser +32 -11
  6. data/lib/tdlib/client.rb +10 -5
  7. data/lib/tdlib/client_methods.rb +923 -386
  8. data/lib/tdlib/types.rb +176 -11
  9. data/lib/tdlib/types/animation.rb +2 -0
  10. data/lib/tdlib/types/audio.rb +2 -0
  11. data/lib/tdlib/types/authorization_state.rb +1 -0
  12. data/lib/tdlib/types/authorization_state/wait_code.rb +1 -6
  13. data/lib/tdlib/types/authorization_state/wait_password.rb +2 -2
  14. data/lib/tdlib/types/authorization_state/wait_registration.rb +9 -0
  15. data/lib/tdlib/types/auto_download_settings.rb +21 -0
  16. data/lib/tdlib/types/auto_download_settings_presets.rb +15 -0
  17. data/lib/tdlib/types/background.rb +19 -0
  18. data/lib/tdlib/types/background_type.rb +12 -0
  19. data/lib/tdlib/types/background_type/pattern.rb +12 -0
  20. data/lib/tdlib/types/background_type/solid.rb +8 -0
  21. data/lib/tdlib/types/background_type/wallpaper.rb +11 -0
  22. data/lib/tdlib/types/backgrounds.rb +8 -0
  23. data/lib/tdlib/types/basic_group.rb +0 -2
  24. data/lib/tdlib/types/basic_group_full_info.rb +2 -0
  25. data/lib/tdlib/types/call_problem.rb +16 -0
  26. data/lib/tdlib/types/call_problem/distorted_speech.rb +5 -0
  27. data/lib/tdlib/types/call_problem/dropped.rb +5 -0
  28. data/lib/tdlib/types/call_problem/echo.rb +5 -0
  29. data/lib/tdlib/types/call_problem/interruptions.rb +5 -0
  30. data/lib/tdlib/types/call_problem/noise.rb +5 -0
  31. data/lib/tdlib/types/call_problem/silent_local.rb +5 -0
  32. data/lib/tdlib/types/call_problem/silent_remote.rb +5 -0
  33. data/lib/tdlib/types/call_state/ready.rb +2 -0
  34. data/lib/tdlib/types/chat.rb +10 -0
  35. data/lib/tdlib/types/chat_event_action.rb +2 -0
  36. data/lib/tdlib/types/chat_event_action/invites_toggled.rb +3 -3
  37. data/lib/tdlib/types/chat_event_action/permissions_changed.rb +10 -0
  38. data/lib/tdlib/types/chat_event_action/photo_changed.rb +4 -4
  39. data/lib/tdlib/types/chat_event_action/poll_stopped.rb +8 -0
  40. data/lib/tdlib/types/chat_invite_link_info.rb +1 -1
  41. data/lib/tdlib/types/chat_member_status/administrator.rb +3 -3
  42. data/lib/tdlib/types/chat_member_status/restricted.rb +2 -13
  43. data/lib/tdlib/types/chat_members_filter.rb +1 -0
  44. data/lib/tdlib/types/chat_members_filter/contacts.rb +5 -0
  45. data/lib/tdlib/types/chat_notification_settings.rb +12 -0
  46. data/lib/tdlib/types/chat_permissions.rb +28 -0
  47. data/lib/tdlib/types/chat_photo.rb +2 -0
  48. data/lib/tdlib/types/chat_report_reason.rb +1 -0
  49. data/lib/tdlib/types/chat_report_reason/child_abuse.rb +5 -0
  50. data/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb +1 -1
  51. data/lib/tdlib/types/connection_state/waiting_for_network.rb +1 -1
  52. data/lib/tdlib/types/database_statistics.rb +8 -0
  53. data/lib/tdlib/types/device_token.rb +2 -2
  54. data/lib/tdlib/types/device_token/apple_push_vo_ip.rb +2 -0
  55. data/lib/tdlib/types/device_token/firebase_cloud_messaging.rb +10 -0
  56. data/lib/tdlib/types/document.rb +4 -1
  57. data/lib/tdlib/types/emojis.rb +8 -0
  58. data/lib/tdlib/types/file_part.rb +8 -0
  59. data/lib/tdlib/types/file_type/wallpaper.rb +1 -1
  60. data/lib/tdlib/types/http_url.rb +8 -0
  61. data/lib/tdlib/types/inline_keyboard_button_type.rb +1 -0
  62. data/lib/tdlib/types/inline_keyboard_button_type/login_url.rb +12 -0
  63. data/lib/tdlib/types/input_background.rb +11 -0
  64. data/lib/tdlib/types/input_background/local.rb +10 -0
  65. data/lib/tdlib/types/input_background/remote.rb +8 -0
  66. data/lib/tdlib/types/input_file/generated.rb +1 -0
  67. data/lib/tdlib/types/input_inline_query_result/animated_gif.rb +5 -4
  68. data/lib/tdlib/types/input_inline_query_result/animated_mpeg4.rb +5 -4
  69. data/lib/tdlib/types/input_inline_query_result/article.rb +5 -4
  70. data/lib/tdlib/types/input_inline_query_result/audio.rb +5 -4
  71. data/lib/tdlib/types/input_inline_query_result/contact.rb +5 -4
  72. data/lib/tdlib/types/input_inline_query_result/document.rb +5 -4
  73. data/lib/tdlib/types/input_inline_query_result/game.rb +2 -1
  74. data/lib/tdlib/types/input_inline_query_result/location.rb +5 -4
  75. data/lib/tdlib/types/input_inline_query_result/photo.rb +5 -3
  76. data/lib/tdlib/types/input_inline_query_result/sticker.rb +7 -6
  77. data/lib/tdlib/types/input_inline_query_result/venue.rb +5 -4
  78. data/lib/tdlib/types/input_inline_query_result/video.rb +5 -4
  79. data/lib/tdlib/types/input_inline_query_result/voice_note.rb +5 -4
  80. data/lib/tdlib/types/input_message_content.rb +1 -0
  81. data/lib/tdlib/types/input_message_content/forwarded.rb +7 -0
  82. data/lib/tdlib/types/input_message_content/poll.rb +11 -0
  83. data/lib/tdlib/types/input_thumbnail.rb +2 -2
  84. data/lib/tdlib/types/json_object_member.rb +10 -0
  85. data/lib/tdlib/types/json_value.rb +15 -0
  86. data/lib/tdlib/types/json_value/array.rb +8 -0
  87. data/lib/tdlib/types/json_value/boolean.rb +8 -0
  88. data/lib/tdlib/types/json_value/null.rb +5 -0
  89. data/lib/tdlib/types/json_value/number.rb +8 -0
  90. data/lib/tdlib/types/json_value/object.rb +8 -0
  91. data/lib/tdlib/types/json_value/string.rb +8 -0
  92. data/lib/tdlib/types/language_pack_info.rb +21 -0
  93. data/lib/tdlib/types/language_pack_string_value/pluralized.rb +1 -0
  94. data/lib/tdlib/types/link_state/is_contact.rb +1 -1
  95. data/lib/tdlib/types/link_state/knows_phone_number.rb +1 -1
  96. data/lib/tdlib/types/local_file.rb +5 -2
  97. data/lib/tdlib/types/log_stream.rb +12 -0
  98. data/lib/tdlib/types/log_stream/default.rb +5 -0
  99. data/lib/tdlib/types/log_stream/empty.rb +5 -0
  100. data/lib/tdlib/types/log_stream/file.rb +11 -0
  101. data/lib/tdlib/types/log_tags.rb +8 -0
  102. data/lib/tdlib/types/log_verbosity_level.rb +8 -0
  103. data/lib/tdlib/types/message.rb +3 -1
  104. data/lib/tdlib/types/message_content.rb +1 -0
  105. data/lib/tdlib/types/message_content/game_score.rb +1 -1
  106. data/lib/tdlib/types/message_content/pin_message.rb +1 -1
  107. data/lib/tdlib/types/message_content/poll.rb +8 -0
  108. data/lib/tdlib/types/message_forward_info.rb +13 -7
  109. data/lib/tdlib/types/message_forward_origin.rb +12 -0
  110. data/lib/tdlib/types/message_forward_origin/channel.rb +12 -0
  111. data/lib/tdlib/types/message_forward_origin/hidden_user.rb +8 -0
  112. data/lib/tdlib/types/message_forward_origin/user.rb +8 -0
  113. data/lib/tdlib/types/message_link_info.rb +14 -0
  114. data/lib/tdlib/types/message_sending_state/failed.rb +10 -0
  115. data/lib/tdlib/types/minithumbnail.rb +12 -0
  116. data/lib/tdlib/types/notification.rb +12 -0
  117. data/lib/tdlib/types/notification_group.rb +16 -0
  118. data/lib/tdlib/types/notification_group_type.rb +13 -0
  119. data/lib/tdlib/types/notification_group_type/calls.rb +5 -0
  120. data/lib/tdlib/types/notification_group_type/mentions.rb +6 -0
  121. data/lib/tdlib/types/notification_group_type/messages.rb +6 -0
  122. data/lib/tdlib/types/notification_group_type/secret_chat.rb +5 -0
  123. data/lib/tdlib/types/notification_settings_scope.rb +1 -0
  124. data/lib/tdlib/types/notification_settings_scope/channel_chats.rb +5 -0
  125. data/lib/tdlib/types/notification_settings_scope/group_chats.rb +2 -2
  126. data/lib/tdlib/types/notification_type.rb +13 -0
  127. data/lib/tdlib/types/notification_type/new_call.rb +8 -0
  128. data/lib/tdlib/types/notification_type/new_message.rb +8 -0
  129. data/lib/tdlib/types/notification_type/new_push_message.rb +15 -0
  130. data/lib/tdlib/types/notification_type/new_secret_chat.rb +5 -0
  131. data/lib/tdlib/types/option_value/boolean.rb +1 -1
  132. data/lib/tdlib/types/option_value/empty.rb +1 -1
  133. data/lib/tdlib/types/option_value/integer.rb +1 -1
  134. data/lib/tdlib/types/option_value/string.rb +1 -1
  135. data/lib/tdlib/types/page_block.rb +5 -0
  136. data/lib/tdlib/types/page_block/animation.rb +2 -2
  137. data/lib/tdlib/types/page_block/audio.rb +2 -2
  138. data/lib/tdlib/types/page_block/block_quote.rb +2 -2
  139. data/lib/tdlib/types/page_block/collage.rb +2 -2
  140. data/lib/tdlib/types/page_block/details.rb +12 -0
  141. data/lib/tdlib/types/page_block/embedded.rb +4 -4
  142. data/lib/tdlib/types/page_block/embedded_post.rb +4 -4
  143. data/lib/tdlib/types/page_block/kicker.rb +8 -0
  144. data/lib/tdlib/types/page_block/list.rb +3 -5
  145. data/lib/tdlib/types/page_block/map.rb +16 -0
  146. data/lib/tdlib/types/page_block/photo.rb +4 -2
  147. data/lib/tdlib/types/page_block/pull_quote.rb +2 -2
  148. data/lib/tdlib/types/page_block/related_articles.rb +10 -0
  149. data/lib/tdlib/types/page_block/slideshow.rb +2 -2
  150. data/lib/tdlib/types/page_block/table.rb +14 -0
  151. data/lib/tdlib/types/page_block/video.rb +2 -2
  152. data/lib/tdlib/types/page_block_caption.rb +10 -0
  153. data/lib/tdlib/types/page_block_horizontal_alignment.rb +12 -0
  154. data/lib/tdlib/types/page_block_horizontal_alignment/center.rb +5 -0
  155. data/lib/tdlib/types/page_block_horizontal_alignment/left.rb +5 -0
  156. data/lib/tdlib/types/page_block_horizontal_alignment/right.rb +5 -0
  157. data/lib/tdlib/types/page_block_list_item.rb +10 -0
  158. data/lib/tdlib/types/page_block_related_article.rb +18 -0
  159. data/lib/tdlib/types/page_block_table_cell.rb +18 -0
  160. data/lib/tdlib/types/page_block_vertical_alignment.rb +12 -0
  161. data/lib/tdlib/types/page_block_vertical_alignment/bottom.rb +5 -0
  162. data/lib/tdlib/types/page_block_vertical_alignment/middle.rb +5 -0
  163. data/lib/tdlib/types/page_block_vertical_alignment/top.rb +5 -0
  164. data/lib/tdlib/types/passport_authorization_form.rb +1 -5
  165. data/lib/tdlib/types/passport_element_error_source/file.rb +3 -0
  166. data/lib/tdlib/types/passport_element_error_source/translation_file.rb +3 -0
  167. data/lib/tdlib/types/passport_elements_with_errors.rb +10 -0
  168. data/lib/tdlib/types/password_state.rb +7 -7
  169. data/lib/tdlib/types/phone_number_authentication_settings.rb +16 -0
  170. data/lib/tdlib/types/photo.rb +2 -2
  171. data/lib/tdlib/types/poll.rb +16 -0
  172. data/lib/tdlib/types/poll_option.rb +16 -0
  173. data/lib/tdlib/types/profile_photo.rb +2 -0
  174. data/lib/tdlib/types/public_message_link.rb +1 -1
  175. data/lib/tdlib/types/push_message_content.rb +35 -0
  176. data/lib/tdlib/types/push_message_content/animation.rb +12 -0
  177. data/lib/tdlib/types/push_message_content/audio.rb +10 -0
  178. data/lib/tdlib/types/push_message_content/basic_group_chat_create.rb +5 -0
  179. data/lib/tdlib/types/push_message_content/chat_add_members.rb +12 -0
  180. data/lib/tdlib/types/push_message_content/chat_change_photo.rb +5 -0
  181. data/lib/tdlib/types/push_message_content/chat_change_title.rb +8 -0
  182. data/lib/tdlib/types/push_message_content/chat_delete_member.rb +12 -0
  183. data/lib/tdlib/types/push_message_content/chat_join_by_link.rb +5 -0
  184. data/lib/tdlib/types/push_message_content/contact.rb +10 -0
  185. data/lib/tdlib/types/push_message_content/contact_registered.rb +5 -0
  186. data/lib/tdlib/types/push_message_content/document.rb +10 -0
  187. data/lib/tdlib/types/push_message_content/game.rb +10 -0
  188. data/lib/tdlib/types/push_message_content/game_score.rb +12 -0
  189. data/lib/tdlib/types/push_message_content/hidden.rb +8 -0
  190. data/lib/tdlib/types/push_message_content/invoice.rb +10 -0
  191. data/lib/tdlib/types/push_message_content/location.rb +10 -0
  192. data/lib/tdlib/types/push_message_content/media_album.rb +12 -0
  193. data/lib/tdlib/types/push_message_content/message_forwards.rb +8 -0
  194. data/lib/tdlib/types/push_message_content/photo.rb +14 -0
  195. data/lib/tdlib/types/push_message_content/poll.rb +10 -0
  196. data/lib/tdlib/types/push_message_content/screenshot_taken.rb +5 -0
  197. data/lib/tdlib/types/push_message_content/sticker.rb +12 -0
  198. data/lib/tdlib/types/push_message_content/text.rb +10 -0
  199. data/lib/tdlib/types/push_message_content/video.rb +14 -0
  200. data/lib/tdlib/types/push_message_content/video_note.rb +10 -0
  201. data/lib/tdlib/types/push_message_content/voice_note.rb +10 -0
  202. data/lib/tdlib/types/push_receiver_id.rb +9 -0
  203. data/lib/tdlib/types/rich_text.rb +6 -0
  204. data/lib/tdlib/types/rich_text/anchor.rb +10 -0
  205. data/lib/tdlib/types/rich_text/icon.rb +13 -0
  206. data/lib/tdlib/types/rich_text/marked.rb +8 -0
  207. data/lib/tdlib/types/rich_text/phone_number.rb +10 -0
  208. data/lib/tdlib/types/rich_text/subscript.rb +8 -0
  209. data/lib/tdlib/types/rich_text/superscript.rb +8 -0
  210. data/lib/tdlib/types/scope_notification_settings.rb +6 -0
  211. data/lib/tdlib/types/search_messages_filter/unread_mention.rb +1 -1
  212. data/lib/tdlib/types/session.rb +3 -0
  213. data/lib/tdlib/types/sticker.rb +2 -0
  214. data/lib/tdlib/types/sticker_set.rb +10 -2
  215. data/lib/tdlib/types/sticker_set_info.rb +5 -0
  216. data/lib/tdlib/types/storage_statistics_fast.rb +4 -0
  217. data/lib/tdlib/types/supergroup.rb +2 -3
  218. data/lib/tdlib/types/supergroup_full_info.rb +2 -2
  219. data/lib/tdlib/types/supergroup_members_filter.rb +1 -0
  220. data/lib/tdlib/types/supergroup_members_filter/contacts.rb +8 -0
  221. data/lib/tdlib/types/terms_of_service.rb +1 -1
  222. data/lib/tdlib/types/update.rb +9 -0
  223. data/lib/tdlib/types/update/active_notifications.rb +10 -0
  224. data/lib/tdlib/types/update/chat_online_member_count.rb +12 -0
  225. data/lib/tdlib/types/update/chat_order.rb +1 -1
  226. data/lib/tdlib/types/update/chat_permissions.rb +10 -0
  227. data/lib/tdlib/types/update/chat_pinned_message.rb +11 -0
  228. data/lib/tdlib/types/update/delete_messages.rb +1 -1
  229. data/lib/tdlib/types/update/have_pending_notifications.rb +13 -0
  230. data/lib/tdlib/types/update/message_send_failed.rb +1 -1
  231. data/lib/tdlib/types/update/new_message.rb +0 -4
  232. data/lib/tdlib/types/update/notification.rb +10 -0
  233. data/lib/tdlib/types/update/notification_group.rb +26 -0
  234. data/lib/tdlib/types/update/poll.rb +8 -0
  235. data/lib/tdlib/types/update/selected_background.rb +10 -0
  236. data/lib/tdlib/types/updates.rb +8 -0
  237. data/lib/tdlib/types/user.rb +4 -0
  238. data/lib/tdlib/types/user_privacy_setting.rb +3 -0
  239. data/lib/tdlib/types/user_privacy_setting/allow_peer_to_peer_calls.rb +5 -0
  240. data/lib/tdlib/types/user_privacy_setting/show_link_in_forwarded_messages.rb +5 -0
  241. data/lib/tdlib/types/user_privacy_setting/show_profile_photo.rb +5 -0
  242. data/lib/tdlib/types/user_profile_photo.rb +12 -0
  243. data/lib/tdlib/types/user_profile_photos.rb +2 -2
  244. data/lib/tdlib/types/video.rb +2 -0
  245. data/lib/tdlib/types/video_note.rb +2 -0
  246. data/lib/tdlib/types/web_page.rb +3 -2
  247. data/lib/tdlib/types/web_page_instant_view.rb +7 -0
  248. data/lib/tdlib/update_manager.rb +5 -12
  249. data/lib/tdlib/version.rb +1 -1
  250. data/spec/integration/tdlib_spec.rb +8 -0
  251. metadata +139 -9
  252. data/lib/tdlib/types/device_token/google_cloud_messaging.rb +0 -8
  253. data/lib/tdlib/types/message_forward_info/message_forwarded_from_user.rb +0 -16
  254. data/lib/tdlib/types/message_forward_info/message_forwarded_post.rb +0 -21
  255. data/lib/tdlib/types/sticker_emojis.rb +0 -10
  256. data/lib/tdlib/types/wallpaper.rb +0 -14
  257. data/lib/tdlib/types/wallpapers.rb +0 -8
@@ -7,6 +7,7 @@ module TD::Types
7
7
  # @attr height [Integer] Height of the animation.
8
8
  # @attr file_name [String] Original name of the file; as defined by the sender.
9
9
  # @attr mime_type [String] MIME type of the file, usually "image/gif" or "video/mp4".
10
+ # @attr minithumbnail [TD::Types::Minithumbnail, nil] Animation minithumbnail; may be null.
10
11
  # @attr thumbnail [TD::Types::PhotoSize, nil] Animation thumbnail; may be null.
11
12
  # @attr animation [TD::Types::File] File containing the animation.
12
13
  class Animation < Base
@@ -15,6 +16,7 @@ module TD::Types
15
16
  attribute :height, TD::Types::Integer
16
17
  attribute :file_name, TD::Types::String
17
18
  attribute :mime_type, TD::Types::String
19
+ attribute :minithumbnail, TD::Types::Minithumbnail.optional.default(nil)
18
20
  attribute :thumbnail, TD::Types::PhotoSize.optional.default(nil)
19
21
  attribute :animation, TD::Types::File
20
22
  end
@@ -7,6 +7,7 @@ module TD::Types
7
7
  # @attr performer [String] Performer of the audio; as defined by the sender.
8
8
  # @attr file_name [String] Original name of the file; as defined by the sender.
9
9
  # @attr mime_type [String] The MIME type of the file; as defined by the sender.
10
+ # @attr album_cover_minithumbnail [TD::Types::Minithumbnail, nil] The minithumbnail of the album cover; may be null.
10
11
  # @attr album_cover_thumbnail [TD::Types::PhotoSize, nil] The thumbnail of the album cover; as defined by the sender.
11
12
  # The full size thumbnail should be extracted from the downloaded file; may be null.
12
13
  # @attr audio [TD::Types::File] File containing the audio.
@@ -16,6 +17,7 @@ module TD::Types
16
17
  attribute :performer, TD::Types::String
17
18
  attribute :file_name, TD::Types::String
18
19
  attribute :mime_type, TD::Types::String
20
+ attribute :album_cover_minithumbnail, TD::Types::Minithumbnail.optional.default(nil)
19
21
  attribute :album_cover_thumbnail, TD::Types::PhotoSize.optional.default(nil)
20
22
  attribute :audio, TD::Types::File
21
23
  end
@@ -6,6 +6,7 @@ module TD::Types
6
6
  wait_encryption_key
7
7
  wait_phone_number
8
8
  wait_code
9
+ wait_registration
9
10
  wait_password
10
11
  ready
11
12
  logging_out
@@ -1,13 +1,8 @@
1
1
  module TD::Types
2
- # TDLib needs the user's authentication code to finalize authorization.
2
+ # TDLib needs the user's authentication code to authorize.
3
3
  #
4
- # @attr is_registered [Boolean] True, if the user is already registered.
5
- # @attr terms_of_service [TD::Types::TermsOfService, nil] Telegram terms of service, which should be accepted before
6
- # user can continue registration; may be null.
7
4
  # @attr code_info [TD::Types::AuthenticationCodeInfo] Information about the authorization code that was sent.
8
5
  class AuthorizationState::WaitCode < AuthorizationState
9
- attribute :is_registered, TD::Types::Bool
10
- attribute :terms_of_service, TD::Types::TermsOfService.optional.default(nil)
11
6
  attribute :code_info, TD::Types::AuthenticationCodeInfo
12
7
  end
13
8
  end
@@ -1,8 +1,8 @@
1
1
  module TD::Types
2
2
  # The user has been authorized, but needs to enter a password to start using the application.
3
3
  #
4
- # @attr password_hint [String, nil] Hint for the password; can be empty.
5
- # @attr has_recovery_email_address [Boolean] True if a recovery email address has been set up.
4
+ # @attr password_hint [String, nil] Hint for the password; may be empty.
5
+ # @attr has_recovery_email_address [Boolean] True, if a recovery email address has been set up.
6
6
  # @attr recovery_email_address_pattern [String, nil] Pattern of the email address to which the recovery email was
7
7
  # sent; empty until a recovery email has been sent.
8
8
  class AuthorizationState::WaitPassword < AuthorizationState
@@ -0,0 +1,9 @@
1
+ module TD::Types
2
+ # The user is unregistered and need to accept terms of service and enter their first name and last name to finish
3
+ # registration.
4
+ #
5
+ # @attr terms_of_service [TD::Types::TermsOfService] Telegram terms of service.
6
+ class AuthorizationState::WaitRegistration < AuthorizationState
7
+ attribute :terms_of_service, TD::Types::TermsOfService
8
+ end
9
+ end
@@ -0,0 +1,21 @@
1
+ module TD::Types
2
+ # Contains auto-download settings.
3
+ #
4
+ # @attr is_auto_download_enabled [Boolean] True, if the auto-download is enabled.
5
+ # @attr max_photo_file_size [Integer] Maximum size of a photo file to be auto-downloaded.
6
+ # @attr max_video_file_size [Integer] Maximum size of a video file to be auto-downloaded.
7
+ # @attr max_other_file_size [Integer] Maximum size of other file types to be auto-downloaded.
8
+ # @attr preload_large_videos [Boolean] True, if the beginning of videos needs to be preloaded for instant playback.
9
+ # @attr preload_next_audio [Boolean] True, if the next audio track needs to be preloaded while the user is listening
10
+ # to an audio file.
11
+ # @attr use_less_data_for_calls [Boolean] True, if "use less data for calls" option needs to be enabled.
12
+ class AutoDownloadSettings < Base
13
+ attribute :is_auto_download_enabled, TD::Types::Bool
14
+ attribute :max_photo_file_size, TD::Types::Integer
15
+ attribute :max_video_file_size, TD::Types::Integer
16
+ attribute :max_other_file_size, TD::Types::Integer
17
+ attribute :preload_large_videos, TD::Types::Bool
18
+ attribute :preload_next_audio, TD::Types::Bool
19
+ attribute :use_less_data_for_calls, TD::Types::Bool
20
+ end
21
+ end
@@ -0,0 +1,15 @@
1
+ module TD::Types
2
+ # Contains auto-download settings presets for the user.
3
+ #
4
+ # @attr low [TD::Types::AutoDownloadSettings] Preset with lowest settings; supposed to be used by default when
5
+ # roaming.
6
+ # @attr medium [TD::Types::AutoDownloadSettings] Preset with medium settings; supposed to be used by default when
7
+ # using mobile data.
8
+ # @attr high [TD::Types::AutoDownloadSettings] Preset with highest settings; supposed to be used by default when
9
+ # connected on Wi-Fi.
10
+ class AutoDownloadSettingsPresets < Base
11
+ attribute :low, TD::Types::AutoDownloadSettings
12
+ attribute :medium, TD::Types::AutoDownloadSettings
13
+ attribute :high, TD::Types::AutoDownloadSettings
14
+ end
15
+ end
@@ -0,0 +1,19 @@
1
+ module TD::Types
2
+ # Describes a chat background.
3
+ #
4
+ # @attr id [Integer] Unique background identifier.
5
+ # @attr is_default [Boolean] True, if this is one of default backgrounds.
6
+ # @attr is_dark [Boolean] True, if the background is dark and is recommended to be used with dark theme.
7
+ # @attr name [String] Unique background name.
8
+ # @attr document [TD::Types::Document, nil] Document with the background; may be null.
9
+ # Null only for solid backgrounds.
10
+ # @attr type [TD::Types::BackgroundType] Type of the background.
11
+ class Background < Base
12
+ attribute :id, TD::Types::Integer
13
+ attribute :is_default, TD::Types::Bool
14
+ attribute :is_dark, TD::Types::Bool
15
+ attribute :name, TD::Types::String
16
+ attribute :document, TD::Types::Document.optional.default(nil)
17
+ attribute :type, TD::Types::BackgroundType
18
+ end
19
+ end
@@ -0,0 +1,12 @@
1
+ module TD::Types
2
+ # Describes a type of a background.
3
+ class BackgroundType < Base
4
+ %w[
5
+ wallpaper
6
+ pattern
7
+ solid
8
+ ].each do |type|
9
+ autoload TD::Types.camelize(type), "tdlib/types/background_type/#{type}"
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module TD::Types
2
+ # A PNG pattern to be combined with the color chosen by the user.
3
+ #
4
+ # @attr is_moving [Boolean] True, if the background needs to be slightly moved when device is rotated.
5
+ # @attr color [Integer] Main color of the background in RGB24 format.
6
+ # @attr intensity [Integer] Intensity of the pattern when it is shown above the main background color, 0-100.
7
+ class BackgroundType::Pattern < BackgroundType
8
+ attribute :is_moving, TD::Types::Bool
9
+ attribute :color, TD::Types::Integer
10
+ attribute :intensity, TD::Types::Integer
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # A solid background.
3
+ #
4
+ # @attr color [Integer] A color of the background in RGB24 format.
5
+ class BackgroundType::Solid < BackgroundType
6
+ attribute :color, TD::Types::Integer
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ module TD::Types
2
+ # A wallpaper in JPEG format.
3
+ #
4
+ # @attr is_blurred [Boolean] True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred
5
+ # with radius 12.
6
+ # @attr is_moving [Boolean] True, if the background needs to be slightly moved when device is rotated.
7
+ class BackgroundType::Wallpaper < BackgroundType
8
+ attribute :is_blurred, TD::Types::Bool
9
+ attribute :is_moving, TD::Types::Bool
10
+ end
11
+ end
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # Contains a list of backgrounds.
3
+ #
4
+ # @attr backgrounds [Array<TD::Types::Background>] A list of backgrounds.
5
+ class Backgrounds < Base
6
+ attribute :backgrounds, TD::Types::Array.of(TD::Types::Background)
7
+ end
8
+ end
@@ -4,14 +4,12 @@ module TD::Types
4
4
  # @attr id [Integer] Group identifier.
5
5
  # @attr member_count [Integer] Number of members in the group.
6
6
  # @attr status [TD::Types::ChatMemberStatus] Status of the current user in the group.
7
- # @attr everyone_is_administrator [Boolean] True, if all members have been granted administrator rights in the group.
8
7
  # @attr is_active [Boolean] True, if the group is active.
9
8
  # @attr upgraded_to_supergroup_id [Integer] Identifier of the supergroup to which this group was upgraded; 0 if none.
10
9
  class BasicGroup < Base
11
10
  attribute :id, TD::Types::Integer
12
11
  attribute :member_count, TD::Types::Integer
13
12
  attribute :status, TD::Types::ChatMemberStatus
14
- attribute :everyone_is_administrator, TD::Types::Bool
15
13
  attribute :is_active, TD::Types::Bool
16
14
  attribute :upgraded_to_supergroup_id, TD::Types::Integer
17
15
  end
@@ -1,11 +1,13 @@
1
1
  module TD::Types
2
2
  # Contains full information about a basic group.
3
3
  #
4
+ # @attr description [String] Group description.
4
5
  # @attr creator_user_id [Integer] User identifier of the creator of the group; 0 if unknown.
5
6
  # @attr members [Array<TD::Types::ChatMember>] Group members.
6
7
  # @attr invite_link [String] Invite link for this group; available only for the group creator and only after it has
7
8
  # been generated at least once.
8
9
  class BasicGroupFullInfo < Base
10
+ attribute :description, TD::Types::String
9
11
  attribute :creator_user_id, TD::Types::Integer
10
12
  attribute :members, TD::Types::Array.of(TD::Types::ChatMember)
11
13
  attribute :invite_link, TD::Types::String
@@ -0,0 +1,16 @@
1
+ module TD::Types
2
+ # Describes the exact type of a problem with a call.
3
+ class CallProblem < Base
4
+ %w[
5
+ echo
6
+ noise
7
+ interruptions
8
+ distorted_speech
9
+ silent_local
10
+ silent_remote
11
+ dropped
12
+ ].each do |type|
13
+ autoload TD::Types.camelize(type), "tdlib/types/call_problem/#{type}"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The speech was distorted.
3
+ class CallProblem::DistortedSpeech < CallProblem
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The call ended unexpectedly.
3
+ class CallProblem::Dropped < CallProblem
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The user heard their own voice.
3
+ class CallProblem::Echo < CallProblem
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The other side kept disappearing.
3
+ class CallProblem::Interruptions < CallProblem
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The user heard background noise.
3
+ class CallProblem::Noise < CallProblem
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The user couldn't hear the other side.
3
+ class CallProblem::SilentLocal < CallProblem
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The other side couldn't hear the user.
3
+ class CallProblem::SilentRemote < CallProblem
4
+ end
5
+ end
@@ -6,11 +6,13 @@ module TD::Types
6
6
  # @attr config [String] A JSON-encoded call config.
7
7
  # @attr encryption_key [String] Call encryption key.
8
8
  # @attr emojis [Array<String>] Encryption key emojis fingerprint.
9
+ # @attr allow_p2p [Boolean] True, if peer-to-peer connection is allowed by users privacy settings.
9
10
  class CallState::Ready < CallState
10
11
  attribute :protocol, TD::Types::CallProtocol
11
12
  attribute :connections, TD::Types::Array.of(TD::Types::CallConnection)
12
13
  attribute :config, TD::Types::String
13
14
  attribute :encryption_key, TD::Types::String
14
15
  attribute :emojis, TD::Types::Array.of(TD::Types::String)
16
+ attribute :allow_p2p, TD::Types::Bool
15
17
  end
16
18
  end
@@ -6,6 +6,8 @@ module TD::Types
6
6
  # @attr type [TD::Types::ChatType] Type of the chat.
7
7
  # @attr title [String] Chat title.
8
8
  # @attr photo [TD::Types::ChatPhoto, nil] Chat photo; may be null.
9
+ # @attr permissions [TD::Types::ChatPermissions] Actions that non-administrator chat members are allowed to take in
10
+ # the chat.
9
11
  # @attr last_message [TD::Types::Message, nil] Last message in the chat; may be null.
10
12
  # @attr order [Integer] Descending parameter by which chats are sorted in the main chat list.
11
13
  # If the order number of two chats is the same, they must be sorted in descending order by ID.
@@ -13,6 +15,9 @@ module TD::Types
13
15
  # @attr is_pinned [Boolean] True, if the chat is pinned.
14
16
  # @attr is_marked_as_unread [Boolean] True, if the chat is marked as unread.
15
17
  # @attr is_sponsored [Boolean] True, if the chat is sponsored by the user's MTProxy server.
18
+ # @attr can_be_deleted_only_for_self [Boolean] True, if the chat messages can be deleted only for the current user
19
+ # while other users will continue to see the messages.
20
+ # @attr can_be_deleted_for_all_users [Boolean] True, if the chat messages can be deleted for all users.
16
21
  # @attr can_be_reported [Boolean] True, if the chat can be reported to Telegram moderators through reportChat.
17
22
  # @attr default_disable_notification [Boolean] Default value of the disable_notification parameter, used when a
18
23
  # message is sent to the chat.
@@ -21,6 +26,7 @@ module TD::Types
21
26
  # @attr last_read_outbox_message_id [Integer] Identifier of the last read outgoing message.
22
27
  # @attr unread_mention_count [Integer] Number of unread messages with a mention/reply in the chat.
23
28
  # @attr notification_settings [TD::Types::ChatNotificationSettings] Notification settings for this chat.
29
+ # @attr pinned_message_id [Integer] Identifier of the pinned message in the chat; 0 if none.
24
30
  # @attr reply_markup_message_id [Integer] Identifier of the message from which reply markup needs to be used; 0 if
25
31
  # there is no default custom reply markup in the chat.
26
32
  # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the chat; may be null.
@@ -32,11 +38,14 @@ module TD::Types
32
38
  attribute :type, TD::Types::ChatType
33
39
  attribute :title, TD::Types::String
34
40
  attribute :photo, TD::Types::ChatPhoto.optional.default(nil)
41
+ attribute :permissions, TD::Types::ChatPermissions
35
42
  attribute :last_message, TD::Types::Message.optional.default(nil)
36
43
  attribute :order, TD::Types::Integer
37
44
  attribute :is_pinned, TD::Types::Bool
38
45
  attribute :is_marked_as_unread, TD::Types::Bool
39
46
  attribute :is_sponsored, TD::Types::Bool
47
+ attribute :can_be_deleted_only_for_self, TD::Types::Bool
48
+ attribute :can_be_deleted_for_all_users, TD::Types::Bool
40
49
  attribute :can_be_reported, TD::Types::Bool
41
50
  attribute :default_disable_notification, TD::Types::Bool
42
51
  attribute :unread_count, TD::Types::Integer
@@ -44,6 +53,7 @@ module TD::Types
44
53
  attribute :last_read_outbox_message_id, TD::Types::Integer
45
54
  attribute :unread_mention_count, TD::Types::Integer
46
55
  attribute :notification_settings, TD::Types::ChatNotificationSettings
56
+ attribute :pinned_message_id, TD::Types::Integer
47
57
  attribute :reply_markup_message_id, TD::Types::Integer
48
58
  attribute :draft_message, TD::Types::DraftMessage.optional.default(nil)
49
59
  attribute :client_data, TD::Types::String
@@ -4,6 +4,7 @@ module TD::Types
4
4
  %w[
5
5
  message_edited
6
6
  message_deleted
7
+ poll_stopped
7
8
  message_pinned
8
9
  message_unpinned
9
10
  member_joined
@@ -12,6 +13,7 @@ module TD::Types
12
13
  member_promoted
13
14
  member_restricted
14
15
  title_changed
16
+ permissions_changed
15
17
  description_changed
16
18
  username_changed
17
19
  photo_changed
@@ -1,8 +1,8 @@
1
1
  module TD::Types
2
- # The anyone_can_invite setting of a supergroup chat was toggled.
2
+ # The can_invite_users permission of a supergroup chat was toggled.
3
3
  #
4
- # @attr anyone_can_invite [Boolean] New value of anyone_can_invite.
4
+ # @attr can_invite_users [Boolean] New value of can_invite_users permission.
5
5
  class ChatEventAction::InvitesToggled < ChatEventAction
6
- attribute :anyone_can_invite, TD::Types::Bool
6
+ attribute :can_invite_users, TD::Types::Bool
7
7
  end
8
8
  end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # The chat permissions was changed.
3
+ #
4
+ # @attr old_permissions [TD::Types::ChatPermissions] Previous chat permissions.
5
+ # @attr new_permissions [TD::Types::ChatPermissions] New chat permissions.
6
+ class ChatEventAction::PermissionsChanged < ChatEventAction
7
+ attribute :old_permissions, TD::Types::ChatPermissions
8
+ attribute :new_permissions, TD::Types::ChatPermissions
9
+ end
10
+ end
@@ -1,10 +1,10 @@
1
1
  module TD::Types
2
2
  # The chat photo was changed.
3
3
  #
4
- # @attr old_photo [TD::Types::ChatPhoto, nil] Previous chat photo value; may be null.
5
- # @attr new_photo [TD::Types::ChatPhoto, nil] New chat photo value; may be null.
4
+ # @attr old_photo [TD::Types::Photo, nil] Previous chat photo value; may be null.
5
+ # @attr new_photo [TD::Types::Photo, nil] New chat photo value; may be null.
6
6
  class ChatEventAction::PhotoChanged < ChatEventAction
7
- attribute :old_photo, TD::Types::ChatPhoto.optional.default(nil)
8
- attribute :new_photo, TD::Types::ChatPhoto.optional.default(nil)
7
+ attribute :old_photo, TD::Types::Photo.optional.default(nil)
8
+ attribute :new_photo, TD::Types::Photo.optional.default(nil)
9
9
  end
10
10
  end
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # A poll in a message was stopped.
3
+ #
4
+ # @attr message [TD::Types::Message] The message with the poll.
5
+ class ChatEventAction::PollStopped < ChatEventAction
6
+ attribute :message, TD::Types::Message
7
+ end
8
+ end
@@ -7,7 +7,7 @@ module TD::Types
7
7
  # @attr photo [TD::Types::ChatPhoto, nil] Chat photo; may be null.
8
8
  # @attr member_count [Integer] Number of members.
9
9
  # @attr member_user_ids [Array<Integer>] User identifiers of some chat members that may be known to the current user.
10
- # @attr is_public [Boolean] True, if the chat is a public supergroup or channel with a username.
10
+ # @attr is_public [Boolean] True, if the chat is a public supergroup or a channel with a username.
11
11
  class ChatInviteLinkInfo < Base
12
12
  attribute :chat_id, TD::Types::Integer
13
13
  attribute :type, TD::Types::ChatType