tdlib-ruby 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -1
  3. data/README.md +2 -1
  4. data/bin/parser +2 -3
  5. data/lib/tdlib/client_methods.rb +341 -108
  6. data/lib/tdlib/types.rb +69 -9
  7. data/lib/tdlib/types/audio.rb +1 -1
  8. data/lib/tdlib/types/authorization_state.rb +1 -0
  9. data/lib/tdlib/types/authorization_state/wait_other_device_confirmation.rb +9 -0
  10. data/lib/tdlib/types/authorization_state/wait_phone_number.rb +2 -0
  11. data/lib/tdlib/types/auto_download_settings.rb +5 -3
  12. data/lib/tdlib/types/background.rb +1 -1
  13. data/lib/tdlib/types/background_fill.rb +11 -0
  14. data/lib/tdlib/types/background_fill/gradient.rb +13 -0
  15. data/lib/tdlib/types/background_fill/solid.rb +8 -0
  16. data/lib/tdlib/types/background_type.rb +1 -1
  17. data/lib/tdlib/types/background_type/fill.rb +8 -0
  18. data/lib/tdlib/types/background_type/pattern.rb +7 -6
  19. data/lib/tdlib/types/background_type/wallpaper.rb +1 -1
  20. data/lib/tdlib/types/base.rb +1 -1
  21. data/lib/tdlib/types/basic_group_full_info.rb +2 -2
  22. data/lib/tdlib/types/call_protocol.rb +2 -2
  23. data/lib/tdlib/types/can_transfer_ownership_result.rb +13 -0
  24. data/lib/tdlib/types/can_transfer_ownership_result/ok.rb +5 -0
  25. data/lib/tdlib/types/can_transfer_ownership_result/password_needed.rb +5 -0
  26. data/lib/tdlib/types/can_transfer_ownership_result/password_too_fresh.rb +8 -0
  27. data/lib/tdlib/types/can_transfer_ownership_result/session_too_fresh.rb +8 -0
  28. data/lib/tdlib/types/chat.rb +9 -2
  29. data/lib/tdlib/types/chat_action_bar.rb +14 -0
  30. data/lib/tdlib/types/chat_action_bar/add_contact.rb +6 -0
  31. data/lib/tdlib/types/chat_action_bar/report_add_block.rb +6 -0
  32. data/lib/tdlib/types/chat_action_bar/report_spam.rb +5 -0
  33. data/lib/tdlib/types/chat_action_bar/report_unrelated_location.rb +6 -0
  34. data/lib/tdlib/types/chat_action_bar/share_phone_number.rb +6 -0
  35. data/lib/tdlib/types/chat_administrator.rb +12 -0
  36. data/lib/tdlib/types/chat_administrators.rb +8 -0
  37. data/lib/tdlib/types/chat_event_action.rb +3 -0
  38. data/lib/tdlib/types/chat_event_action/linked_chat_changed.rb +10 -0
  39. data/lib/tdlib/types/chat_event_action/location_changed.rb +10 -0
  40. data/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb +10 -0
  41. data/lib/tdlib/types/chat_invite_link_info.rb +2 -1
  42. data/lib/tdlib/types/chat_list.rb +11 -0
  43. data/lib/tdlib/types/chat_list/archive.rb +6 -0
  44. data/lib/tdlib/types/chat_list/main.rb +5 -0
  45. data/lib/tdlib/types/chat_location.rb +10 -0
  46. data/lib/tdlib/types/chat_member_status/administrator.rb +4 -1
  47. data/lib/tdlib/types/chat_member_status/creator.rb +4 -1
  48. data/lib/tdlib/types/chat_members_filter/administrators.rb +1 -1
  49. data/lib/tdlib/types/chat_nearby.rb +10 -0
  50. data/lib/tdlib/types/chat_report_reason.rb +1 -0
  51. data/lib/tdlib/types/chat_report_reason/unrelated_location.rb +5 -0
  52. data/lib/tdlib/types/chats_nearby.rb +10 -0
  53. data/lib/tdlib/types/formatted_text.rb +4 -0
  54. data/lib/tdlib/types/inline_keyboard_button_type/login_url.rb +1 -1
  55. data/lib/tdlib/types/input_file/remote.rb +4 -0
  56. data/lib/tdlib/types/input_inline_query_result/sticker.rb +2 -2
  57. data/lib/tdlib/types/input_message_content/text.rb +2 -1
  58. data/lib/tdlib/types/log_stream/file.rb +2 -2
  59. data/lib/tdlib/types/login_url_info.rb +11 -0
  60. data/lib/tdlib/types/login_url_info/open.rb +10 -0
  61. data/lib/tdlib/types/login_url_info/request_confirmation.rb +15 -0
  62. data/lib/tdlib/types/message.rb +7 -1
  63. data/lib/tdlib/types/message_forward_info.rb +5 -5
  64. data/lib/tdlib/types/message_scheduling_state.rb +11 -0
  65. data/lib/tdlib/types/message_scheduling_state/send_at_date.rb +9 -0
  66. data/lib/tdlib/types/message_scheduling_state/send_when_online.rb +6 -0
  67. data/lib/tdlib/types/notification.rb +2 -0
  68. data/lib/tdlib/types/page_block.rb +1 -0
  69. data/lib/tdlib/types/page_block/voice_note.rb +10 -0
  70. data/lib/tdlib/types/page_block_table_cell.rb +3 -2
  71. data/lib/tdlib/types/public_chat_type.rb +11 -0
  72. data/lib/tdlib/types/public_chat_type/has_username.rb +5 -0
  73. data/lib/tdlib/types/public_chat_type/is_location_based.rb +5 -0
  74. data/lib/tdlib/types/public_message_link.rb +1 -1
  75. data/lib/tdlib/types/push_message_content/chat_add_members.rb +1 -1
  76. data/lib/tdlib/types/push_message_content/chat_delete_member.rb +1 -1
  77. data/lib/tdlib/types/remote_file.rb +5 -0
  78. data/lib/tdlib/types/rich_text/strikethrough.rb +1 -1
  79. data/lib/tdlib/types/rich_text/url.rb +2 -0
  80. data/lib/tdlib/types/secret_chat.rb +5 -4
  81. data/lib/tdlib/types/send_message_options.rb +14 -0
  82. data/lib/tdlib/types/supergroup.rb +12 -8
  83. data/lib/tdlib/types/supergroup_full_info.rb +17 -3
  84. data/lib/tdlib/types/supergroup_members_filter/administrators.rb +1 -1
  85. data/lib/tdlib/types/terms_of_service.rb +1 -1
  86. data/lib/tdlib/types/text_entity_type.rb +3 -1
  87. data/lib/tdlib/types/text_entity_type/strikethrough.rb +5 -0
  88. data/lib/tdlib/types/text_entity_type/underline.rb +5 -0
  89. data/lib/tdlib/types/text_parse_mode/markdown.rb +4 -0
  90. data/lib/tdlib/types/ton_lite_server_response.rb +8 -0
  91. data/lib/tdlib/types/ton_wallet_password_salt.rb +8 -0
  92. data/lib/tdlib/types/top_chat_category.rb +1 -0
  93. data/lib/tdlib/types/top_chat_category/forward_chats.rb +5 -0
  94. data/lib/tdlib/types/update.rb +5 -0
  95. data/lib/tdlib/types/update/active_notifications.rb +1 -1
  96. data/lib/tdlib/types/update/chat_action_bar.rb +10 -0
  97. data/lib/tdlib/types/update/chat_chat_list.rb +11 -0
  98. data/lib/tdlib/types/update/chat_has_scheduled_messages.rb +10 -0
  99. data/lib/tdlib/types/update/chat_last_message.rb +1 -1
  100. data/lib/tdlib/types/update/chat_order.rb +2 -1
  101. data/lib/tdlib/types/update/have_pending_notifications.rb +1 -1
  102. data/lib/tdlib/types/update/message_live_location_viewed.rb +11 -0
  103. data/lib/tdlib/types/update/new_callback_query.rb +1 -1
  104. data/lib/tdlib/types/update/unread_chat_count.rb +5 -1
  105. data/lib/tdlib/types/update/unread_message_count.rb +4 -2
  106. data/lib/tdlib/types/update/users_nearby.rb +9 -0
  107. data/lib/tdlib/types/user.rb +7 -10
  108. data/lib/tdlib/types/user_full_info.rb +3 -0
  109. data/lib/tdlib/types/user_privacy_setting.rb +2 -0
  110. data/lib/tdlib/types/user_privacy_setting/allow_finding_by_phone_number.rb +7 -0
  111. data/lib/tdlib/types/user_privacy_setting/show_phone_number.rb +5 -0
  112. data/lib/tdlib/types/user_privacy_setting_rule.rb +2 -0
  113. data/lib/tdlib/types/user_privacy_setting_rule/allow_chat_members.rb +8 -0
  114. data/lib/tdlib/types/user_privacy_setting_rule/allow_users.rb +1 -1
  115. data/lib/tdlib/types/user_privacy_setting_rule/restrict_chat_members.rb +8 -0
  116. data/lib/tdlib/types/user_privacy_setting_rule/restrict_users.rb +1 -1
  117. data/lib/tdlib/types/user_type/deleted.rb +1 -1
  118. data/lib/tdlib/types/user_type/unknown.rb +1 -1
  119. data/lib/tdlib/types/video.rb +1 -1
  120. data/lib/tdlib/version.rb +1 -1
  121. data/tdlib-ruby.gemspec +6 -6
  122. metadata +68 -21
  123. data/lib/tdlib/types/background_type/solid.rb +0 -8
  124. data/lib/tdlib/types/chat_report_spam_state.rb +0 -8
  125. data/lib/tdlib/types/link_state.rb +0 -13
  126. data/lib/tdlib/types/link_state/is_contact.rb +0 -5
  127. data/lib/tdlib/types/link_state/knows_phone_number.rb +0 -5
  128. data/lib/tdlib/types/link_state/none.rb +0 -5
@@ -3,7 +3,7 @@ module TD::Types
3
3
  #
4
4
  # @attr is_blurred [Boolean] True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred
5
5
  # with radius 12.
6
- # @attr is_moving [Boolean] True, if the background needs to be slightly moved when device is rotated.
6
+ # @attr is_moving [Boolean] True, if the background needs to be slightly moved when device is tilted.
7
7
  class BackgroundType::Wallpaper < BackgroundType
8
8
  attribute :is_blurred, TD::Types::Bool
9
9
  attribute :is_moving, TD::Types::Bool
@@ -1,7 +1,7 @@
1
1
  module TD::Types
2
2
  class Base < Dry::Struct
3
3
  # throw an error when unknown keys provided
4
- input input.strict
4
+ schema schema.strict
5
5
 
6
6
  # convert string keys to symbols
7
7
  transform_keys(&:to_sym)
@@ -4,8 +4,8 @@ module TD::Types
4
4
  # @attr description [String] Group description.
5
5
  # @attr creator_user_id [Integer] User identifier of the creator of the group; 0 if unknown.
6
6
  # @attr members [Array<TD::Types::ChatMember>] Group members.
7
- # @attr invite_link [String] Invite link for this group; available only for the group creator and only after it has
8
- # been generated at least once.
7
+ # @attr invite_link [String] Invite link for this group; available only after it has been generated at least once and
8
+ # only for the group creator.
9
9
  class BasicGroupFullInfo < Base
10
10
  attribute :description, TD::Types::String
11
11
  attribute :creator_user_id, TD::Types::Integer
@@ -3,8 +3,8 @@ module TD::Types
3
3
  #
4
4
  # @attr udp_p2p [Boolean] True, if UDP peer-to-peer connections are supported.
5
5
  # @attr udp_reflector [Boolean] True, if connection through UDP reflectors is supported.
6
- # @attr min_layer [Integer] Minimum supported API layer; use 65.
7
- # @attr max_layer [Integer] Maximum supported API layer; use 65.
6
+ # @attr min_layer [Integer] The minimum supported API layer; use 65.
7
+ # @attr max_layer [Integer] The maximum supported API layer; use 65.
8
8
  class CallProtocol < Base
9
9
  attribute :udp_p2p, TD::Types::Bool
10
10
  attribute :udp_reflector, TD::Types::Bool
@@ -0,0 +1,13 @@
1
+ module TD::Types
2
+ # Represents result of checking whether the current session can be used to transfer a chat ownership to another user.
3
+ class CanTransferOwnershipResult < Base
4
+ %w[
5
+ ok
6
+ password_needed
7
+ password_too_fresh
8
+ session_too_fresh
9
+ ].each do |type|
10
+ autoload TD::Types.camelize(type), "tdlib/types/can_transfer_ownership_result/#{type}"
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The session can be used.
3
+ class CanTransferOwnershipResult::Ok < CanTransferOwnershipResult
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The 2-step verification needs to be enabled first.
3
+ class CanTransferOwnershipResult::PasswordNeeded < CanTransferOwnershipResult
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # The 2-step verification was enabled recently, user needs to wait.
3
+ #
4
+ # @attr retry_after [Integer] Time left before the session can be used to transfer ownership of a chat, in seconds.
5
+ class CanTransferOwnershipResult::PasswordTooFresh < CanTransferOwnershipResult
6
+ attribute :retry_after, TD::Types::Integer
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # The session was created recently, user needs to wait.
3
+ #
4
+ # @attr retry_after [Integer] Time left before the session can be used to transfer ownership of a chat, in seconds.
5
+ class CanTransferOwnershipResult::SessionTooFresh < CanTransferOwnershipResult
6
+ attribute :retry_after, TD::Types::Integer
7
+ end
8
+ end
@@ -4,6 +4,7 @@ module TD::Types
4
4
  #
5
5
  # @attr id [Integer] Chat unique identifier.
6
6
  # @attr type [TD::Types::ChatType] Type of the chat.
7
+ # @attr chat_list [TD::Types::ChatList, nil] A chat list to which the chat belongs; may be null.
7
8
  # @attr title [String] Chat title.
8
9
  # @attr photo [TD::Types::ChatPhoto, nil] Chat photo; may be null.
9
10
  # @attr permissions [TD::Types::ChatPermissions] Actions that non-administrator chat members are allowed to take in
@@ -15,6 +16,7 @@ module TD::Types
15
16
  # @attr is_pinned [Boolean] True, if the chat is pinned.
16
17
  # @attr is_marked_as_unread [Boolean] True, if the chat is marked as unread.
17
18
  # @attr is_sponsored [Boolean] True, if the chat is sponsored by the user's MTProxy server.
19
+ # @attr has_scheduled_messages [Boolean] True, if the chat has scheduled messages.
18
20
  # @attr can_be_deleted_only_for_self [Boolean] True, if the chat messages can be deleted only for the current user
19
21
  # while other users will continue to see the messages.
20
22
  # @attr can_be_deleted_for_all_users [Boolean] True, if the chat messages can be deleted for all users.
@@ -26,16 +28,19 @@ module TD::Types
26
28
  # @attr last_read_outbox_message_id [Integer] Identifier of the last read outgoing message.
27
29
  # @attr unread_mention_count [Integer] Number of unread messages with a mention/reply in the chat.
28
30
  # @attr notification_settings [TD::Types::ChatNotificationSettings] Notification settings for this chat.
31
+ # @attr action_bar [TD::Types::ChatActionBar, nil] Describes actions which should be possible to do through a chat
32
+ # action bar; may be null.
29
33
  # @attr pinned_message_id [Integer] Identifier of the pinned message in the chat; 0 if none.
30
34
  # @attr reply_markup_message_id [Integer] Identifier of the message from which reply markup needs to be used; 0 if
31
35
  # there is no default custom reply markup in the chat.
32
36
  # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the chat; may be null.
33
37
  # @attr client_data [String] Contains client-specific data associated with the chat.
34
- # (For example, the chat position or local chat notification settings can be stored here.) Persistent if a message
35
- # database is used.
38
+ # (For example, the chat position or local chat notification settings can be stored here.) Persistent if the
39
+ # message database is used.
36
40
  class Chat < Base
37
41
  attribute :id, TD::Types::Integer
38
42
  attribute :type, TD::Types::ChatType
43
+ attribute :chat_list, TD::Types::ChatList.optional.default(nil)
39
44
  attribute :title, TD::Types::String
40
45
  attribute :photo, TD::Types::ChatPhoto.optional.default(nil)
41
46
  attribute :permissions, TD::Types::ChatPermissions
@@ -44,6 +49,7 @@ module TD::Types
44
49
  attribute :is_pinned, TD::Types::Bool
45
50
  attribute :is_marked_as_unread, TD::Types::Bool
46
51
  attribute :is_sponsored, TD::Types::Bool
52
+ attribute :has_scheduled_messages, TD::Types::Bool
47
53
  attribute :can_be_deleted_only_for_self, TD::Types::Bool
48
54
  attribute :can_be_deleted_for_all_users, TD::Types::Bool
49
55
  attribute :can_be_reported, TD::Types::Bool
@@ -53,6 +59,7 @@ module TD::Types
53
59
  attribute :last_read_outbox_message_id, TD::Types::Integer
54
60
  attribute :unread_mention_count, TD::Types::Integer
55
61
  attribute :notification_settings, TD::Types::ChatNotificationSettings
62
+ attribute :action_bar, TD::Types::ChatActionBar.optional.default(nil)
56
63
  attribute :pinned_message_id, TD::Types::Integer
57
64
  attribute :reply_markup_message_id, TD::Types::Integer
58
65
  attribute :draft_message, TD::Types::DraftMessage.optional.default(nil)
@@ -0,0 +1,14 @@
1
+ module TD::Types
2
+ # Describes actions which should be possible to do through a chat action bar.
3
+ class ChatActionBar < Base
4
+ %w[
5
+ report_spam
6
+ report_unrelated_location
7
+ report_add_block
8
+ add_contact
9
+ share_phone_number
10
+ ].each do |type|
11
+ autoload TD::Types.camelize(type), "tdlib/types/chat_action_bar/#{type}"
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ module TD::Types
2
+ # The chat is a private or secret chat and the other user can be added to the contact list using the method
3
+ # addContact.
4
+ class ChatActionBar::AddContact < ChatActionBar
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module TD::Types
2
+ # The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be
3
+ # added to the contact list using the method addContact, or the other user can be blocked using the method blockUser.
4
+ class ChatActionBar::ReportAddBlock < ChatActionBar
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam.
3
+ class ChatActionBar::ReportSpam < ChatActionBar
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module TD::Types
2
+ # The chat is a location-based supergroup, which can be reported as having unrelated location using the method
3
+ # reportChat with the reason chatReportReasonUnrelatedLocation.
4
+ class ChatActionBar::ReportUnrelatedLocation < ChatActionBar
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module TD::Types
2
+ # The chat is a private or secret chat with a mutual contact and the user's phone number can be shared with the other
3
+ # user using the method sharePhoneNumber.
4
+ class ChatActionBar::SharePhoneNumber < ChatActionBar
5
+ end
6
+ end
@@ -0,0 +1,12 @@
1
+ module TD::Types
2
+ # Contains information about a chat administrator.
3
+ #
4
+ # @attr user_id [Integer] User identifier of the administrator.
5
+ # @attr custom_title [String] Custom title of the administrator.
6
+ # @attr is_owner [Boolean] True, if the user is the owner of the chat.
7
+ class ChatAdministrator < Base
8
+ attribute :user_id, TD::Types::Integer
9
+ attribute :custom_title, TD::Types::String
10
+ attribute :is_owner, TD::Types::Bool
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module TD::Types
2
+ # Represents a list of chat administrators.
3
+ #
4
+ # @attr administrators [Array<TD::Types::ChatAdministrator>] A list of chat administrators.
5
+ class ChatAdministrators < Base
6
+ attribute :administrators, TD::Types::Array.of(TD::Types::ChatAdministrator)
7
+ end
8
+ end
@@ -18,8 +18,11 @@ module TD::Types
18
18
  username_changed
19
19
  photo_changed
20
20
  invites_toggled
21
+ linked_chat_changed
22
+ slow_mode_delay_changed
21
23
  sign_messages_toggled
22
24
  sticker_set_changed
25
+ location_changed
23
26
  is_all_history_available_toggled
24
27
  ].each do |type|
25
28
  autoload TD::Types.camelize(type), "tdlib/types/chat_event_action/#{type}"
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # The linked chat of a supergroup was changed.
3
+ #
4
+ # @attr old_linked_chat_id [Integer] Previous supergroup linked chat identifier.
5
+ # @attr new_linked_chat_id [Integer] New supergroup linked chat identifier.
6
+ class ChatEventAction::LinkedChatChanged < ChatEventAction
7
+ attribute :old_linked_chat_id, TD::Types::Integer
8
+ attribute :new_linked_chat_id, TD::Types::Integer
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # The supergroup location was changed.
3
+ #
4
+ # @attr old_location [TD::Types::ChatLocation, nil] Previous location; may be null.
5
+ # @attr new_location [TD::Types::ChatLocation, nil] New location; may be null.
6
+ class ChatEventAction::LocationChanged < ChatEventAction
7
+ attribute :old_location, TD::Types::ChatLocation.optional.default(nil)
8
+ attribute :new_location, TD::Types::ChatLocation.optional.default(nil)
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # The slow_mode_delay setting of a supergroup was changed.
3
+ #
4
+ # @attr old_slow_mode_delay [Integer] Previous value of slow_mode_delay.
5
+ # @attr new_slow_mode_delay [Integer] New value of slow_mode_delay.
6
+ class ChatEventAction::SlowModeDelayChanged < ChatEventAction
7
+ attribute :old_slow_mode_delay, TD::Types::Integer
8
+ attribute :new_slow_mode_delay, TD::Types::Integer
9
+ end
10
+ end
@@ -7,7 +7,8 @@ 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 a channel with a username.
10
+ # @attr is_public [Boolean] True, if the chat is a public supergroup or channel, i.e.
11
+ # it has a username or it is a location-based supergroup.
11
12
  class ChatInviteLinkInfo < Base
12
13
  attribute :chat_id, TD::Types::Integer
13
14
  attribute :type, TD::Types::ChatType
@@ -0,0 +1,11 @@
1
+ module TD::Types
2
+ # Describes a list of chats.
3
+ class ChatList < Base
4
+ %w[
5
+ main
6
+ archive
7
+ ].each do |type|
8
+ autoload TD::Types.camelize(type), "tdlib/types/chat_list/#{type}"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ module TD::Types
2
+ # A list of chats usually located at the top of the main chat list.
3
+ # Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives.
4
+ class ChatList::Archive < ChatList
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # A main list of chats.
3
+ class ChatList::Main < ChatList
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # Represents a location to which a chat is connected.
3
+ #
4
+ # @attr location [TD::Types::Location] The location.
5
+ # @attr address [String] Location address; 1-64 characters, as defined by the chat owner.
6
+ class ChatLocation < Base
7
+ attribute :location, TD::Types::Location
8
+ attribute :address, TD::Types::String
9
+ end
10
+ end
@@ -4,6 +4,8 @@ module TD::Types
4
4
  # members.
5
5
  # In supergroups and channels, there are more detailed options for administrator privileges.
6
6
  #
7
+ # @attr custom_title [String] A custom title of the administrator; 0-16 characters without emojis; applicable to
8
+ # supergroups only.
7
9
  # @attr can_be_edited [Boolean] True, if the current user can edit the administrator privileges for the called user.
8
10
  # @attr can_change_info [Boolean] True, if the administrator can change the chat title, photo, and other settings.
9
11
  # @attr can_post_messages [Boolean] True, if the administrator can create channel posts; applicable to channels only.
@@ -14,8 +16,9 @@ module TD::Types
14
16
  # @attr can_restrict_members [Boolean] True, if the administrator can restrict, ban, or unban chat members.
15
17
  # @attr can_pin_messages [Boolean] True, if the administrator can pin messages; applicable to groups only.
16
18
  # @attr can_promote_members [Boolean] True, if the administrator can add new administrators with a subset of their
17
- # own privileges or demote administrators that were directly or indirectly promoted by him.
19
+ # own privileges or demote administrators that were directly or indirectly promoted by them.
18
20
  class ChatMemberStatus::Administrator < ChatMemberStatus
21
+ attribute :custom_title, TD::Types::String
19
22
  attribute :can_be_edited, TD::Types::Bool
20
23
  attribute :can_change_info, TD::Types::Bool
21
24
  attribute :can_post_messages, TD::Types::Bool
@@ -1,8 +1,11 @@
1
1
  module TD::Types
2
- # The user is the creator of a chat and has all the administrator privileges.
2
+ # The user is the owner of a chat and has all the administrator privileges.
3
3
  #
4
+ # @attr custom_title [String] A custom title of the owner; 0-16 characters without emojis; applicable to supergroups
5
+ # only.
4
6
  # @attr is_member [Boolean] True, if the user is a member of the chat.
5
7
  class ChatMemberStatus::Creator < ChatMemberStatus
8
+ attribute :custom_title, TD::Types::String
6
9
  attribute :is_member, TD::Types::Bool
7
10
  end
8
11
  end
@@ -1,5 +1,5 @@
1
1
  module TD::Types
2
- # Returns the creator and administrators.
2
+ # Returns the owner and administrators.
3
3
  class ChatMembersFilter::Administrators < ChatMembersFilter
4
4
  end
5
5
  end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # Describes a chat located nearby.
3
+ #
4
+ # @attr chat_id [Integer] Chat identifier.
5
+ # @attr distance [Integer] Distance to the chat location in meters.
6
+ class ChatNearby < Base
7
+ attribute :chat_id, TD::Types::Integer
8
+ attribute :distance, TD::Types::Integer
9
+ end
10
+ end
@@ -7,6 +7,7 @@ module TD::Types
7
7
  pornography
8
8
  child_abuse
9
9
  copyright
10
+ unrelated_location
10
11
  custom
11
12
  ].each do |type|
12
13
  autoload TD::Types.camelize(type), "tdlib/types/chat_report_reason/#{type}"
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The location-based chat is unrelated to its stated location.
3
+ class ChatReportReason::UnrelatedLocation < ChatReportReason
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # Represents a list of chats located nearby.
3
+ #
4
+ # @attr users_nearby [Array<TD::Types::ChatNearby>] List of users nearby.
5
+ # @attr supergroups_nearby [Array<TD::Types::ChatNearby>] List of location-based supergroups nearby.
6
+ class ChatsNearby < Base
7
+ attribute :users_nearby, TD::Types::Array.of(TD::Types::ChatNearby)
8
+ attribute :supergroups_nearby, TD::Types::Array.of(TD::Types::ChatNearby)
9
+ end
10
+ end
@@ -3,6 +3,10 @@ module TD::Types
3
3
  #
4
4
  # @attr text [String] The text.
5
5
  # @attr entities [Array<TD::Types::TextEntity>] Entities contained in the text.
6
+ # Entities can be nested, but must not mutually intersect with each other.
7
+ # Pre, Code and PreCode entities can't contain other entities.
8
+ # Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities.
9
+ # All other entities can't contain each other.
6
10
  class FormattedText < Base
7
11
  attribute :text, TD::Types::String
8
12
  attribute :entities, TD::Types::Array.of(TD::Types::TextEntity)
@@ -1,7 +1,7 @@
1
1
  module TD::Types
2
2
  # A button that opens a specified URL and automatically logs in in current user if they allowed to do that.
3
3
  #
4
- # @attr url [String] HTTP URL to open.
4
+ # @attr url [String] An HTTP URL to open.
5
5
  # @attr id [Integer] Unique button identifier.
6
6
  # @attr forward_text [String] If non-empty, new text of the button in forwarded messages.
7
7
  class InlineKeyboardButtonType::LoginUrl < InlineKeyboardButtonType
@@ -1,5 +1,9 @@
1
1
  module TD::Types
2
2
  # A file defined by its remote ID.
3
+ # The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known
4
+ # to TDLib.
5
+ # For example, if the file is from a message, then the message must be not deleted and accessible to the user.
6
+ # If the file database is disabled, then the corresponding object with the file must be preloaded by the client.
3
7
  #
4
8
  # @attr id [String] Remote file identifier.
5
9
  class InputFile::Remote < InputFile
@@ -1,9 +1,9 @@
1
1
  module TD::Types
2
- # Represents a link to a WEBP or a TGS sticker.
2
+ # Represents a link to a WEBP or TGS sticker.
3
3
  #
4
4
  # @attr id [String] Unique identifier of the query result.
5
5
  # @attr thumbnail_url [String] URL of the sticker thumbnail, if it exists.
6
- # @attr sticker_url [String] The URL of the WEBP or a TGS sticker (sticker file size must not exceed 5MB).
6
+ # @attr sticker_url [String] The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB).
7
7
  # @attr sticker_width [Integer] Width of the sticker.
8
8
  # @attr sticker_height [Integer] Height of the sticker.
9
9
  # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup.