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
@@ -4,24 +4,32 @@ module TD::Types
4
4
  # @attr id [Integer] Identifier of the sticker set.
5
5
  # @attr title [String] Title of the sticker set.
6
6
  # @attr name [String] Name of the sticker set.
7
+ # @attr thumbnail [TD::Types::PhotoSize, nil] Sticker set thumbnail in WEBP format with width and height 100; may be
8
+ # null.
9
+ # The file can be downloaded only before the thumbnail is changed.
7
10
  # @attr is_installed [Boolean] True, if the sticker set has been installed by the current user.
8
11
  # @attr is_archived [Boolean] True, if the sticker set has been archived.
9
12
  # A sticker set can't be installed and archived simultaneously.
10
13
  # @attr is_official [Boolean] True, if the sticker set is official.
14
+ # @attr is_animated [Boolean] True, is the stickers in the set are animated.
11
15
  # @attr is_masks [Boolean] True, if the stickers in the set are masks.
12
16
  # @attr is_viewed [Boolean] True for already viewed trending sticker sets.
13
17
  # @attr stickers [Array<TD::Types::Sticker>] List of stickers in this set.
14
- # @attr emojis [Array<TD::Types::StickerEmojis>] A list of emoji corresponding to the stickers in the same order.
18
+ # @attr emojis [Array<TD::Types::Emojis>] A list of emoji corresponding to the stickers in the same order.
19
+ # The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the
20
+ # corresponding Sticker object.
15
21
  class StickerSet < Base
16
22
  attribute :id, TD::Types::Integer
17
23
  attribute :title, TD::Types::String
18
24
  attribute :name, TD::Types::String
25
+ attribute :thumbnail, TD::Types::PhotoSize.optional.default(nil)
19
26
  attribute :is_installed, TD::Types::Bool
20
27
  attribute :is_archived, TD::Types::Bool
21
28
  attribute :is_official, TD::Types::Bool
29
+ attribute :is_animated, TD::Types::Bool
22
30
  attribute :is_masks, TD::Types::Bool
23
31
  attribute :is_viewed, TD::Types::Bool
24
32
  attribute :stickers, TD::Types::Array.of(TD::Types::Sticker)
25
- attribute :emojis, TD::Types::Array.of(TD::Types::StickerEmojis)
33
+ attribute :emojis, TD::Types::Array.of(TD::Types::Emojis)
26
34
  end
27
35
  end
@@ -4,10 +4,13 @@ module TD::Types
4
4
  # @attr id [Integer] Identifier of the sticker set.
5
5
  # @attr title [String] Title of the sticker set.
6
6
  # @attr name [String] Name of the sticker set.
7
+ # @attr thumbnail [TD::Types::PhotoSize, nil] Sticker set thumbnail in WEBP format with width and height 100; may be
8
+ # null.
7
9
  # @attr is_installed [Boolean] True, if the sticker set has been installed by current user.
8
10
  # @attr is_archived [Boolean] True, if the sticker set has been archived.
9
11
  # A sticker set can't be installed and archived simultaneously.
10
12
  # @attr is_official [Boolean] True, if the sticker set is official.
13
+ # @attr is_animated [Boolean] True, is the stickers in the set are animated.
11
14
  # @attr is_masks [Boolean] True, if the stickers in the set are masks.
12
15
  # @attr is_viewed [Boolean] True for already viewed trending sticker sets.
13
16
  # @attr size [Integer] Total number of stickers in the set.
@@ -18,9 +21,11 @@ module TD::Types
18
21
  attribute :id, TD::Types::Integer
19
22
  attribute :title, TD::Types::String
20
23
  attribute :name, TD::Types::String
24
+ attribute :thumbnail, TD::Types::PhotoSize.optional.default(nil)
21
25
  attribute :is_installed, TD::Types::Bool
22
26
  attribute :is_archived, TD::Types::Bool
23
27
  attribute :is_official, TD::Types::Bool
28
+ attribute :is_animated, TD::Types::Bool
24
29
  attribute :is_masks, TD::Types::Bool
25
30
  attribute :is_viewed, TD::Types::Bool
26
31
  attribute :size, TD::Types::Integer
@@ -4,9 +4,13 @@ module TD::Types
4
4
  # @attr files_size [Integer] Approximate total size of files.
5
5
  # @attr file_count [Integer] Approximate number of files.
6
6
  # @attr database_size [Integer] Size of the database.
7
+ # @attr language_pack_database_size [Integer] Size of the language pack database.
8
+ # @attr log_size [Integer] Size of the TDLib internal log.
7
9
  class StorageStatisticsFast < Base
8
10
  attribute :files_size, TD::Types::Integer
9
11
  attribute :file_count, TD::Types::Integer
10
12
  attribute :database_size, TD::Types::Integer
13
+ attribute :language_pack_database_size, TD::Types::Integer
14
+ attribute :log_size, TD::Types::Integer
11
15
  end
12
16
  end
@@ -12,8 +12,6 @@ module TD::Types
12
12
  # @attr status [TD::Types::ChatMemberStatus] Status of the current user in the supergroup or channel.
13
13
  # @attr member_count [Integer] Member count; 0 if unknown.
14
14
  # Currently it is guaranteed to be known only if the supergroup or channel was found through SearchPublicChats.
15
- # @attr anyone_can_invite [Boolean] True, if any member of the supergroup can invite other members.
16
- # This field has no meaning for channels.
17
15
  # @attr sign_messages [Boolean] True, if messages sent to the channel should contain information about the sender.
18
16
  # This field is only applicable to channels.
19
17
  # @attr is_channel [Boolean] True, if the supergroup is a channel.
@@ -25,16 +23,17 @@ module TD::Types
25
23
  # "-wp", which describe the platforms on which access should be restricted.
26
24
  # (For example, "terms-ios-android".
27
25
  # {description} contains a human-readable description of the restriction, which can be shown to the user).
26
+ # @attr is_scam [Boolean] True, if many users reported this supergroup as a scam.
28
27
  class Supergroup < Base
29
28
  attribute :id, TD::Types::Integer
30
29
  attribute :username, TD::Types::String.optional.default(nil)
31
30
  attribute :date, TD::Types::Integer
32
31
  attribute :status, TD::Types::ChatMemberStatus
33
32
  attribute :member_count, TD::Types::Integer
34
- attribute :anyone_can_invite, TD::Types::Bool
35
33
  attribute :sign_messages, TD::Types::Bool
36
34
  attribute :is_channel, TD::Types::Bool
37
35
  attribute :is_verified, TD::Types::Bool
38
36
  attribute :restriction_reason, TD::Types::String
37
+ attribute :is_scam, TD::Types::Bool
39
38
  end
40
39
  end
@@ -9,13 +9,13 @@ module TD::Types
9
9
  # @attr can_get_members [Boolean] True, if members of the chat can be retrieved.
10
10
  # @attr can_set_username [Boolean] True, if the chat can be made public.
11
11
  # @attr can_set_sticker_set [Boolean] True, if the supergroup sticker set can be changed.
12
+ # @attr can_view_statistics [Boolean] True, if the channel statistics is available through getChatStatisticsUrl.
12
13
  # @attr is_all_history_available [Boolean] True, if new chat members will have access to old messages.
13
14
  # In public supergroups and both public and private channels, old messages are always available, so this option
14
15
  # affects only private supergroups.
15
16
  # The value of this field is only available for chat administrators.
16
17
  # @attr sticker_set_id [Integer] Identifier of the supergroup sticker set; 0 if none.
17
18
  # @attr invite_link [String] Invite link for this chat.
18
- # @attr pinned_message_id [Integer] Identifier of the pinned message in the chat; 0 if none.
19
19
  # @attr upgraded_from_basic_group_id [Integer] Identifier of the basic group from which supergroup was upgraded; 0 if
20
20
  # none.
21
21
  # @attr upgraded_from_max_message_id [Integer] Identifier of the last message in the basic group from which
@@ -29,10 +29,10 @@ module TD::Types
29
29
  attribute :can_get_members, TD::Types::Bool
30
30
  attribute :can_set_username, TD::Types::Bool
31
31
  attribute :can_set_sticker_set, TD::Types::Bool
32
+ attribute :can_view_statistics, TD::Types::Bool
32
33
  attribute :is_all_history_available, TD::Types::Bool
33
34
  attribute :sticker_set_id, TD::Types::Integer
34
35
  attribute :invite_link, TD::Types::String
35
- attribute :pinned_message_id, TD::Types::Integer
36
36
  attribute :upgraded_from_basic_group_id, TD::Types::Integer
37
37
  attribute :upgraded_from_max_message_id, TD::Types::Integer
38
38
  end
@@ -3,6 +3,7 @@ module TD::Types
3
3
  class SupergroupMembersFilter < Base
4
4
  %w[
5
5
  recent
6
+ contacts
6
7
  administrators
7
8
  search
8
9
  restricted
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # Returns contacts of the user, which are members of the supergroup or channel.
3
+ #
4
+ # @attr query [String] Query to search for.
5
+ class SupergroupMembersFilter::Contacts < SupergroupMembersFilter
6
+ attribute :query, TD::Types::String
7
+ end
8
+ end
@@ -2,7 +2,7 @@ module TD::Types
2
2
  # Contains Telegram terms of service.
3
3
  #
4
4
  # @attr text [TD::Types::FormattedText] Text of the terms of service.
5
- # @attr min_user_age [Integer] Mininum age of a user to be able to accept the terms; 0 if any.
5
+ # @attr min_user_age [Integer] Minimum age of a user to be able to accept the terms; 0 if any.
6
6
  # @attr show_popup [Boolean] True, if a blocking popup with terms of service must be shown to the user.
7
7
  class TermsOfService < Base
8
8
  attribute :text, TD::Types::FormattedText
@@ -15,6 +15,7 @@ module TD::Types
15
15
  new_chat
16
16
  chat_title
17
17
  chat_photo
18
+ chat_permissions
18
19
  chat_last_message
19
20
  chat_order
20
21
  chat_is_pinned
@@ -26,8 +27,14 @@ module TD::Types
26
27
  chat_unread_mention_count
27
28
  chat_notification_settings
28
29
  scope_notification_settings
30
+ chat_pinned_message
29
31
  chat_reply_markup
30
32
  chat_draft_message
33
+ chat_online_member_count
34
+ notification
35
+ notification_group
36
+ active_notifications
37
+ have_pending_notifications
31
38
  delete_messages
32
39
  user_chat_action
33
40
  user_status
@@ -52,6 +59,7 @@ module TD::Types
52
59
  recent_stickers
53
60
  favorite_stickers
54
61
  saved_animations
62
+ selected_background
55
63
  language_pack_strings
56
64
  connection_state
57
65
  terms_of_service
@@ -63,6 +71,7 @@ module TD::Types
63
71
  new_pre_checkout_query
64
72
  new_custom_event
65
73
  new_custom_query
74
+ poll
66
75
  ].each do |type|
67
76
  autoload TD::Types.camelize(type), "tdlib/types/update/#{type}"
68
77
  end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # Contains active notifications that was shown on previous application launches.
3
+ # This update is sent only if a message database is used.
4
+ # In that case it comes once before any updateNotification and updateNotificationGroup update.
5
+ #
6
+ # @attr groups [Array<TD::Types::NotificationGroup>] Lists of active notification groups.
7
+ class Update::ActiveNotifications < Update
8
+ attribute :groups, TD::Types::Array.of(TD::Types::NotificationGroup)
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ module TD::Types
2
+ # The number of online group members has changed.
3
+ # This update with non-zero count is sent only for currently opened chats.
4
+ # There is no guarantee that it will be sent just after the count has changed.
5
+ #
6
+ # @attr chat_id [Integer] Identifier of the chat.
7
+ # @attr online_member_count [Integer] New number of online members in the chat, or 0 if unknown.
8
+ class Update::ChatOnlineMemberCount < Update
9
+ attribute :chat_id, TD::Types::Integer
10
+ attribute :online_member_count, TD::Types::Integer
11
+ end
12
+ end
@@ -1,5 +1,5 @@
1
1
  module TD::Types
2
- # The order of the chat in the chats list has changed.
2
+ # The order of the chat in the chat list has changed.
3
3
  # Instead of this update updateChatLastMessage, updateChatIsPinned or updateChatDraftMessage might be sent.
4
4
  #
5
5
  # @attr chat_id [Integer] Chat identifier.
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # Chat permissions was changed.
3
+ #
4
+ # @attr chat_id [Integer] Chat identifier.
5
+ # @attr permissions [TD::Types::ChatPermissions] The new chat permissions.
6
+ class Update::ChatPermissions < Update
7
+ attribute :chat_id, TD::Types::Integer
8
+ attribute :permissions, TD::Types::ChatPermissions
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ module TD::Types
2
+ # The chat pinned message was changed.
3
+ #
4
+ # @attr chat_id [Integer] Chat identifier.
5
+ # @attr pinned_message_id [Integer] The new identifier of the pinned message; 0 if there is no pinned message in the
6
+ # chat.
7
+ class Update::ChatPinnedMessage < Update
8
+ attribute :chat_id, TD::Types::Integer
9
+ attribute :pinned_message_id, TD::Types::Integer
10
+ end
11
+ end
@@ -4,7 +4,7 @@ module TD::Types
4
4
  # @attr chat_id [Integer] Chat identifier.
5
5
  # @attr message_ids [Array<Integer>] Identifiers of the deleted messages.
6
6
  # @attr is_permanent [Boolean] True, if the messages are permanently deleted by a user (as opposed to just becoming
7
- # unaccessible).
7
+ # inaccessible).
8
8
  # @attr from_cache [Boolean] True, if the messages are deleted only from the cache and can possibly be retrieved
9
9
  # again in the future.
10
10
  class Update::DeleteMessages < Update
@@ -0,0 +1,13 @@
1
+ module TD::Types
2
+ # Describes, whether there are some pending notification updates.
3
+ # Can be used to prevent application from killing, while there are some pending notifications.
4
+ #
5
+ # @attr have_delayed_notifications [Boolean] True, if there are some delayed notification updates, which will be sent
6
+ # soon.
7
+ # @attr have_unreceived_notifications [Boolean] True, if there can be some yet unreceived notifications, which are
8
+ # being fetched from the server.
9
+ class Update::HavePendingNotifications < Update
10
+ attribute :have_delayed_notifications, TD::Types::Bool
11
+ attribute :have_unreceived_notifications, TD::Types::Bool
12
+ end
13
+ end
@@ -3,7 +3,7 @@ module TD::Types
3
3
  # Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be
4
4
  # received instead of this update.
5
5
  #
6
- # @attr message [TD::Types::Message] Contains information about the message that failed to send.
6
+ # @attr message [TD::Types::Message] Contains information about the message which failed to send.
7
7
  # @attr old_message_id [Integer] The previous temporary message identifier.
8
8
  # @attr error_code [Integer] An error code.
9
9
  # @attr error_message [String] Error message.
@@ -2,11 +2,7 @@ module TD::Types
2
2
  # A new message was received; can also be an outgoing message.
3
3
  #
4
4
  # @attr message [TD::Types::Message] The new message.
5
- # @attr disable_notification [Boolean] True, if this message must not generate a notification.
6
- # @attr contains_mention [Boolean] True, if the message contains a mention of the current user.
7
5
  class Update::NewMessage < Update
8
6
  attribute :message, TD::Types::Message
9
- attribute :disable_notification, TD::Types::Bool
10
- attribute :contains_mention, TD::Types::Bool
11
7
  end
12
8
  end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # A notification was changed.
3
+ #
4
+ # @attr notification_group_id [Integer] Unique notification group identifier.
5
+ # @attr notification [TD::Types::Notification] Changed notification.
6
+ class Update::Notification < Update
7
+ attribute :notification_group_id, TD::Types::Integer
8
+ attribute :notification, TD::Types::Notification
9
+ end
10
+ end
@@ -0,0 +1,26 @@
1
+ module TD::Types
2
+ # A list of active notifications in a notification group has changed.
3
+ #
4
+ # @attr notification_group_id [Integer] Unique notification group identifier.
5
+ # @attr type [TD::Types::NotificationGroupType] New type of the notification group.
6
+ # @attr chat_id [Integer] Identifier of a chat to which all notifications in the group belong.
7
+ # @attr notification_settings_chat_id [Integer] Chat identifier, which notification settings must be applied to the
8
+ # added notifications.
9
+ # @attr is_silent [Boolean] True, if the notifications should be shown without sound.
10
+ # @attr total_count [Integer] Total number of unread notifications in the group, can be bigger than number of active
11
+ # notifications.
12
+ # @attr added_notifications [Array<TD::Types::Notification>] List of added group notifications, sorted by
13
+ # notification ID.
14
+ # @attr removed_notification_ids [Array<Integer>] Identifiers of removed group notifications, sorted by notification
15
+ # ID.
16
+ class Update::NotificationGroup < Update
17
+ attribute :notification_group_id, TD::Types::Integer
18
+ attribute :type, TD::Types::NotificationGroupType
19
+ attribute :chat_id, TD::Types::Integer
20
+ attribute :notification_settings_chat_id, TD::Types::Integer
21
+ attribute :is_silent, TD::Types::Bool
22
+ attribute :total_count, TD::Types::Integer
23
+ attribute :added_notifications, TD::Types::Array.of(TD::Types::Notification)
24
+ attribute :removed_notification_ids, TD::Types::Array.of(TD::Types::Integer)
25
+ end
26
+ end
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # Information about a poll was updated; for bots only.
3
+ #
4
+ # @attr poll [TD::Types::Poll] New data about the poll.
5
+ class Update::Poll < Update
6
+ attribute :poll, TD::Types::Poll
7
+ end
8
+ end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # The selected background has changed.
3
+ #
4
+ # @attr for_dark_theme [Boolean] True, if background for dark theme has changed.
5
+ # @attr background [TD::Types::Background, nil] The new selected background; may be null.
6
+ class Update::SelectedBackground < Update
7
+ attribute :for_dark_theme, TD::Types::Bool
8
+ attribute :background, TD::Types::Background.optional.default(nil)
9
+ end
10
+ end
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # Contains a list of updates.
3
+ #
4
+ # @attr updates [Array<TD::Types::Update>] List of updates.
5
+ class Updates < Base
6
+ attribute :updates, TD::Types::Array.of(TD::Types::Update)
7
+ end
8
+ end
@@ -11,12 +11,14 @@ module TD::Types
11
11
  # @attr outgoing_link [TD::Types::LinkState] Relationship from the current user to the other user.
12
12
  # @attr incoming_link [TD::Types::LinkState] Relationship from the other user to the current user.
13
13
  # @attr is_verified [Boolean] True, if the user is verified.
14
+ # @attr is_support [Boolean] True, if the user is Telegram support account.
14
15
  # @attr restriction_reason [String] If non-empty, it contains the reason why access to this user must be restricted.
15
16
  # The format of the string is "{type}: {description}".
16
17
  # {type} contains the type of the restriction and at least one of the suffixes "-all", "-ios", "-android", or
17
18
  # "-wp", which describe the platforms on which access should be restricted.
18
19
  # (For example, "terms-ios-android".
19
20
  # {description} contains a human-readable description of the restriction, which can be shown to the user).
21
+ # @attr is_scam [Boolean] True, if many users reported this user as a scam.
20
22
  # @attr have_access [Boolean] If false, the user is inaccessible, and the only information known about the user is
21
23
  # inside this class.
22
24
  # It can't be passed to any method except GetUser.
@@ -33,7 +35,9 @@ module TD::Types
33
35
  attribute :outgoing_link, TD::Types::LinkState
34
36
  attribute :incoming_link, TD::Types::LinkState
35
37
  attribute :is_verified, TD::Types::Bool
38
+ attribute :is_support, TD::Types::Bool
36
39
  attribute :restriction_reason, TD::Types::String
40
+ attribute :is_scam, TD::Types::Bool
37
41
  attribute :have_access, TD::Types::Bool
38
42
  attribute :type, TD::Types::UserType
39
43
  attribute :language_code, TD::Types::String
@@ -3,8 +3,11 @@ module TD::Types
3
3
  class UserPrivacySetting < Base
4
4
  %w[
5
5
  show_status
6
+ show_profile_photo
7
+ show_link_in_forwarded_messages
6
8
  allow_chat_invites
7
9
  allow_calls
10
+ allow_peer_to_peer_calls
8
11
  ].each do |type|
9
12
  autoload TD::Types.camelize(type), "tdlib/types/user_privacy_setting/#{type}"
10
13
  end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # A privacy setting for managing whether peer-to-peer connections can be used for calls.
3
+ class UserPrivacySetting::AllowPeerToPeerCalls < UserPrivacySetting
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # A privacy setting for managing whether a link to the user's account is included in forwarded messages.
3
+ class UserPrivacySetting::ShowLinkInForwardedMessages < UserPrivacySetting
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # A privacy setting for managing whether the user's profile photo is visible.
3
+ class UserPrivacySetting::ShowProfilePhoto < UserPrivacySetting
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ module TD::Types
2
+ # Contains full information about a user profile photo.
3
+ #
4
+ # @attr id [Integer] Unique user profile photo identifier.
5
+ # @attr added_date [Integer] Point in time (Unix timestamp) when the photo has been added.
6
+ # @attr sizes [Array<TD::Types::PhotoSize>] Available variants of the user photo, in different sizes.
7
+ class UserProfilePhoto < Base
8
+ attribute :id, TD::Types::Integer
9
+ attribute :added_date, TD::Types::Integer
10
+ attribute :sizes, TD::Types::Array.of(TD::Types::PhotoSize)
11
+ end
12
+ end