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
@@ -2,7 +2,8 @@ module TD::Types
2
2
  # A text message.
3
3
  #
4
4
  # @attr text [TD::Types::FormattedText] Formatted text to be sent; 1-GetOption("message_text_length_max") characters.
5
- # Only Bold, Italic, Code, Pre, PreCode and TextUrl entities are allowed to be specified manually.
5
+ # Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to
6
+ # be specified manually.
6
7
  # @attr disable_web_page_preview [Boolean] True, if rich web page previews for URLs in the message text should be
7
8
  # disabled.
8
9
  # @attr clear_draft [Boolean] True, if a chat message draft should be deleted.
@@ -2,8 +2,8 @@ module TD::Types
2
2
  # The log is written to a file.
3
3
  #
4
4
  # @attr path [String] Path to the file to where the internal TDLib log will be written.
5
- # @attr max_file_size [Integer] Maximum size of the file to where the internal TDLib log is written before the file
6
- # will be auto-rotated.
5
+ # @attr max_file_size [Integer] The maximum size of the file to where the internal TDLib log is written before the
6
+ # file will be auto-rotated.
7
7
  class LogStream::File < LogStream
8
8
  attribute :path, TD::Types::String
9
9
  attribute :max_file_size, TD::Types::Integer
@@ -0,0 +1,11 @@
1
+ module TD::Types
2
+ # Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl.
3
+ class LoginUrlInfo < Base
4
+ %w[
5
+ open
6
+ request_confirmation
7
+ ].each do |type|
8
+ autoload TD::Types.camelize(type), "tdlib/types/login_url_info/#{type}"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # An HTTP url needs to be open.
3
+ #
4
+ # @attr url [String] The URL to open.
5
+ # @attr skip_confirm [Boolean] True, if there is no need to show an ordinary open URL confirm.
6
+ class LoginUrlInfo::Open < LoginUrlInfo
7
+ attribute :url, TD::Types::String
8
+ attribute :skip_confirm, TD::Types::Bool
9
+ end
10
+ end
@@ -0,0 +1,15 @@
1
+ module TD::Types
2
+ # An authorization confirmation dialog needs to be shown to the user.
3
+ #
4
+ # @attr url [String] An HTTP URL to be opened.
5
+ # @attr domain [String] A domain of the URL.
6
+ # @attr bot_user_id [Integer] User identifier of a bot linked with the website.
7
+ # @attr request_write_access [Boolean] True, if the user needs to be requested to give the permission to the bot to
8
+ # send them messages.
9
+ class LoginUrlInfo::RequestConfirmation < LoginUrlInfo
10
+ attribute :url, TD::Types::String
11
+ attribute :domain, TD::Types::String
12
+ attribute :bot_user_id, TD::Types::Integer
13
+ attribute :request_write_access, TD::Types::Bool
14
+ end
15
+ end
@@ -7,9 +7,11 @@ module TD::Types
7
7
  # @attr chat_id [Integer] Chat identifier.
8
8
  # @attr sending_state [TD::Types::MessageSendingState, nil] Information about the sending state of the message; may
9
9
  # be null.
10
+ # @attr scheduling_state [TD::Types::MessageSchedulingState, nil] Information about the scheduling state of the
11
+ # message; may be null.
10
12
  # @attr is_outgoing [Boolean] True, if the message is outgoing.
11
13
  # @attr can_be_edited [Boolean] True, if the message can be edited.
12
- # For live location and poll messages this fields shows, whether editMessageLiveLocation or stopPoll can be used
14
+ # For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used
13
15
  # with this message by the client.
14
16
  # @attr can_be_forwarded [Boolean] True, if the message can be forwarded.
15
17
  # @attr can_be_deleted_only_for_self [Boolean] True, if the message can be deleted only for the current user while
@@ -31,6 +33,8 @@ module TD::Types
31
33
  # @attr views [Integer] Number of times this message was viewed.
32
34
  # @attr media_album_id [Integer] Unique identifier of an album this message belongs to.
33
35
  # Only photos and videos can be grouped together in albums.
36
+ # @attr restriction_reason [String] If non-empty, contains a human-readable description of the reason why access to
37
+ # this message must be restricted.
34
38
  # @attr content [TD::Types::MessageContent] Content of the message.
35
39
  # @attr reply_markup [TD::Types::ReplyMarkup, nil] Reply markup for the message; may be null.
36
40
  class Message < Base
@@ -38,6 +42,7 @@ module TD::Types
38
42
  attribute :sender_user_id, TD::Types::Integer
39
43
  attribute :chat_id, TD::Types::Integer
40
44
  attribute :sending_state, TD::Types::MessageSendingState.optional.default(nil)
45
+ attribute :scheduling_state, TD::Types::MessageSchedulingState.optional.default(nil)
41
46
  attribute :is_outgoing, TD::Types::Bool
42
47
  attribute :can_be_edited, TD::Types::Bool
43
48
  attribute :can_be_forwarded, TD::Types::Bool
@@ -55,6 +60,7 @@ module TD::Types
55
60
  attribute :author_signature, TD::Types::String.optional.default(nil)
56
61
  attribute :views, TD::Types::Integer
57
62
  attribute :media_album_id, TD::Types::Integer
63
+ attribute :restriction_reason, TD::Types::String
58
64
  attribute :content, TD::Types::MessageContent
59
65
  attribute :reply_markup, TD::Types::ReplyMarkup.optional.default(nil)
60
66
  end
@@ -3,11 +3,11 @@ module TD::Types
3
3
  #
4
4
  # @attr origin [TD::Types::MessageForwardOrigin] Origin of a forwarded message.
5
5
  # @attr date [Integer] Point in time (Unix timestamp) when the message was originally sent.
6
- # @attr from_chat_id [Integer] For messages forwarded to the chat with the current user (saved messages) or to the
7
- # channel discussion supergroup, the identifier of the chat from which the message was forwarded last time; 0 if unknown.
8
- # @attr from_message_id [Integer] For messages forwarded to the chat with the current user (saved messages) or to the
9
- # channel discussion supergroup, the identifier of the original message from which the new message was forwarded last
10
- # time; 0 if unknown.
6
+ # @attr from_chat_id [Integer] For messages forwarded to the chat with the current user (Saved Messages) or to the
7
+ # channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown.
8
+ # @attr from_message_id [Integer] For messages forwarded to the chat with the current user (Saved Messages) or to the
9
+ # channel's discussion group, the identifier of the original message from which the new message was forwarded last time;
10
+ # 0 if unknown.
11
11
  class MessageForwardInfo < Base
12
12
  attribute :origin, TD::Types::MessageForwardOrigin
13
13
  attribute :date, TD::Types::Integer
@@ -0,0 +1,11 @@
1
+ module TD::Types
2
+ # Contains information about the time when a scheduled message will be sent.
3
+ class MessageSchedulingState < Base
4
+ %w[
5
+ send_at_date
6
+ send_when_online
7
+ ].each do |type|
8
+ autoload TD::Types.camelize(type), "tdlib/types/message_scheduling_state/#{type}"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module TD::Types
2
+ # The message will be sent at the specified date.
3
+ #
4
+ # @attr send_date [Integer] Date the message will be sent.
5
+ # The date must be within 367 days in the future.
6
+ class MessageSchedulingState::SendAtDate < MessageSchedulingState
7
+ attribute :send_date, TD::Types::Integer
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ module TD::Types
2
+ # The message will be sent when the peer will be online.
3
+ # Applicable to private chats only and when the exact online status of the peer is known.
4
+ class MessageSchedulingState::SendWhenOnline < MessageSchedulingState
5
+ end
6
+ end
@@ -3,10 +3,12 @@ module TD::Types
3
3
  #
4
4
  # @attr id [Integer] Unique persistent identifier of this notification.
5
5
  # @attr date [Integer] Notification date.
6
+ # @attr is_silent [Boolean] True, if the notification was initially silent.
6
7
  # @attr type [TD::Types::NotificationType] Notification type.
7
8
  class Notification < Base
8
9
  attribute :id, TD::Types::Integer
9
10
  attribute :date, TD::Types::Integer
11
+ attribute :is_silent, TD::Types::Bool
10
12
  attribute :type, TD::Types::NotificationType
11
13
  end
12
14
  end
@@ -20,6 +20,7 @@ module TD::Types
20
20
  audio
21
21
  photo
22
22
  video
23
+ voice_note
23
24
  cover
24
25
  embedded
25
26
  embedded_post
@@ -0,0 +1,10 @@
1
+ module TD::Types
2
+ # A voice note.
3
+ #
4
+ # @attr voice_note [TD::Types::VoiceNote, nil] Voice note; may be null.
5
+ # @attr caption [TD::Types::PageBlockCaption] Voice note caption.
6
+ class PageBlock::VoiceNote < PageBlock
7
+ attribute :voice_note, TD::Types::VoiceNote.optional.default(nil)
8
+ attribute :caption, TD::Types::PageBlockCaption
9
+ end
10
+ end
@@ -1,14 +1,15 @@
1
1
  module TD::Types
2
2
  # Represents a cell of a table.
3
3
  #
4
- # @attr text [TD::Types::RichText] Cell text.
4
+ # @attr text [TD::Types::RichText, nil] Cell text; may be null.
5
+ # If the text is null, then the cell should be invisible.
5
6
  # @attr is_header [Boolean] True, if it is a header cell.
6
7
  # @attr colspan [Integer] The number of columns the cell should span.
7
8
  # @attr rowspan [Integer] The number of rows the cell should span.
8
9
  # @attr align [TD::Types::PageBlockHorizontalAlignment] Horizontal cell content alignment.
9
10
  # @attr valign [TD::Types::PageBlockVerticalAlignment] Vertical cell content alignment.
10
11
  class PageBlockTableCell < Base
11
- attribute :text, TD::Types::RichText
12
+ attribute :text, TD::Types::RichText.optional.default(nil)
12
13
  attribute :is_header, TD::Types::Bool
13
14
  attribute :colspan, TD::Types::Integer
14
15
  attribute :rowspan, TD::Types::Integer
@@ -0,0 +1,11 @@
1
+ module TD::Types
2
+ # Describes a type of public chats.
3
+ class PublicChatType < Base
4
+ %w[
5
+ has_username
6
+ is_location_based
7
+ ].each do |type|
8
+ autoload TD::Types.camelize(type), "tdlib/types/public_chat_type/#{type}"
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The chat is public, because it has username.
3
+ class PublicChatType::HasUsername < PublicChatType
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module TD::Types
2
+ # The chat is public, because it is a location-based supergroup.
3
+ class PublicChatType::IsLocationBased < PublicChatType
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module TD::Types
2
- # Contains a public HTTPS link to a message in a public supergroup or channel with a username.
2
+ # Contains a public HTTPS link to a message in a supergroup or channel with a username.
3
3
  #
4
4
  # @attr link [String] Message link.
5
5
  # @attr html [String] HTML-code for embedding the message.
@@ -3,7 +3,7 @@ module TD::Types
3
3
  #
4
4
  # @attr member_name [String] Name of the added member.
5
5
  # @attr is_current_user [Boolean] True, if the current user was added to the group.
6
- # @attr is_returned [Boolean] True, if the user has returned to the group himself.
6
+ # @attr is_returned [Boolean] True, if the user has returned to the group themself.
7
7
  class PushMessageContent::ChatAddMembers < PushMessageContent
8
8
  attribute :member_name, TD::Types::String
9
9
  attribute :is_current_user, TD::Types::Bool
@@ -3,7 +3,7 @@ module TD::Types
3
3
  #
4
4
  # @attr member_name [String] Name of the deleted member.
5
5
  # @attr is_current_user [Boolean] True, if the current user was deleted from the group.
6
- # @attr is_left [Boolean] True, if the user has left the group himself.
6
+ # @attr is_left [Boolean] True, if the user has left the group themself.
7
7
  class PushMessageContent::ChatDeleteMember < PushMessageContent
8
8
  attribute :member_name, TD::Types::String
9
9
  attribute :is_current_user, TD::Types::Bool
@@ -3,18 +3,23 @@ module TD::Types
3
3
  #
4
4
  # @attr id [String, nil] Remote file identifier; may be empty.
5
5
  # Can be used across application restarts or even from other devices for the current user.
6
+ # Uniquely identifies a file, but a file can have a lot of different valid identifiers.
6
7
  # If the ID starts with "http://" or "https://", it represents the HTTP URL of the file.
7
8
  # TDLib is currently unable to download files if only their URL is known.
8
9
  # If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation
9
10
  # process by sending {TD::Types::Update::FileGenerationStart} to the client with the HTTP URL in the original_path and
10
11
  # "#url#" as the conversion string.
11
12
  # Clients should generate the file by downloading it to the specified location.
13
+ # @attr unique_id [String, nil] Unique file identifier; may be empty if unknown.
14
+ # The unique file identifier which is the same for the same file even for different users and is persistent over
15
+ # time.
12
16
  # @attr is_uploading_active [Boolean] True, if the file is currently being uploaded (or a remote copy is being
13
17
  # generated by some other means).
14
18
  # @attr is_uploading_completed [Boolean] True, if a remote copy is fully available.
15
19
  # @attr uploaded_size [Integer] Size of the remote available part of the file; 0 if unknown.
16
20
  class RemoteFile < Base
17
21
  attribute :id, TD::Types::String.optional.default(nil)
22
+ attribute :unique_id, TD::Types::String.optional.default(nil)
18
23
  attribute :is_uploading_active, TD::Types::Bool
19
24
  attribute :is_uploading_completed, TD::Types::Bool
20
25
  attribute :uploaded_size, TD::Types::Integer
@@ -1,5 +1,5 @@
1
1
  module TD::Types
2
- # A strike-through rich text.
2
+ # A strikethrough rich text.
3
3
  #
4
4
  # @attr text [TD::Types::RichText] Text.
5
5
  class RichText::Strikethrough < RichText
@@ -3,8 +3,10 @@ module TD::Types
3
3
  #
4
4
  # @attr text [TD::Types::RichText] Text.
5
5
  # @attr url [String] URL.
6
+ # @attr is_cached [Boolean] True, if the URL has cached instant view server-side.
6
7
  class RichText::Url < RichText
7
8
  attribute :text, TD::Types::RichText
8
9
  attribute :url, TD::Types::String
10
+ attribute :is_cached, TD::Types::Bool
9
11
  end
10
12
  end
@@ -7,13 +7,14 @@ module TD::Types
7
7
  # @attr is_outbound [Boolean] True, if the chat was created by the current user; otherwise false.
8
8
  # @attr ttl [Integer] Current message Time To Live setting (self-destruct timer) for the chat, in seconds.
9
9
  # @attr key_hash [String] Hash of the currently used key for comparison with the hash of the chat partner's key.
10
- # This is a string of 36 bytes, which must be used to make a 12x12 square image with a color depth of 4.
11
- # The first 16 bytes should be used to make a central 8x8 square, while the remaining 20 bytes should be used to
12
- # construct a 2-pixel-wide border around that square.
10
+ # This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of
11
+ # one of 4 colors.
12
+ # The pixels must be used to make a 12x12 square image filled from left to right, top to bottom.
13
13
  # Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32
14
14
  # 2-digit hex numbers.
15
15
  # @attr layer [Integer] Secret chat layer; determines features supported by the other client.
16
- # Video notes are supported if the layer >= 66.
16
+ # Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are
17
+ # supported if the layer >= 101.
17
18
  class SecretChat < Base
18
19
  attribute :id, TD::Types::Integer
19
20
  attribute :user_id, TD::Types::Integer
@@ -0,0 +1,14 @@
1
+ module TD::Types
2
+ # Options to be used when a message is send.
3
+ #
4
+ # @attr disable_notification [Boolean] Pass true to disable notification for the message.
5
+ # Must be false if the message is sent to a secret chat.
6
+ # @attr from_background [Boolean] Pass true if the message is sent from the background.
7
+ # @attr scheduling_state [TD::Types::MessageSchedulingState] Message scheduling state.
8
+ # Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled.
9
+ class SendMessageOptions < Base
10
+ attribute :disable_notification, TD::Types::Bool
11
+ attribute :from_background, TD::Types::Bool
12
+ attribute :scheduling_state, TD::Types::MessageSchedulingState
13
+ end
14
+ end
@@ -9,20 +9,21 @@ module TD::Types
9
9
  # @attr username [String, nil] Username of the supergroup or channel; empty for private supergroups or channels.
10
10
  # @attr date [Integer] Point in time (Unix timestamp) when the current user joined, or the point in time when the
11
11
  # supergroup or channel was created, in case the user is not a member.
12
- # @attr status [TD::Types::ChatMemberStatus] Status of the current user in the supergroup or channel.
12
+ # @attr status [TD::Types::ChatMemberStatus] Status of the current user in the supergroup or channel; custom title
13
+ # will be always empty.
13
14
  # @attr member_count [Integer] Member count; 0 if unknown.
14
15
  # Currently it is guaranteed to be known only if the supergroup or channel was found through SearchPublicChats.
16
+ # @attr has_linked_chat [Boolean] True, if the channel has a discussion group, or the supergroup is the designated
17
+ # discussion group for a channel.
18
+ # @attr has_location [Boolean] True, if the supergroup is connected to a location, i.e.
19
+ # the supergroup is a location-based supergroup.
15
20
  # @attr sign_messages [Boolean] True, if messages sent to the channel should contain information about the sender.
16
21
  # This field is only applicable to channels.
22
+ # @attr is_slow_mode_enabled [Boolean] True, if the slow mode is enabled in the supergroup.
17
23
  # @attr is_channel [Boolean] True, if the supergroup is a channel.
18
24
  # @attr is_verified [Boolean] True, if the supergroup or channel is verified.
19
- # @attr restriction_reason [String] If non-empty, contains the reason why access to this supergroup or channel must
20
- # be restricted.
21
- # Format of the string is "{type}: {description}".
22
- # {type} Contains the type of the restriction and at least one of the suffixes "-all", "-ios", "-android", or
23
- # "-wp", which describe the platforms on which access should be restricted.
24
- # (For example, "terms-ios-android".
25
- # {description} contains a human-readable description of the restriction, which can be shown to the user).
25
+ # @attr restriction_reason [String] If non-empty, contains a human-readable description of the reason why access to
26
+ # this supergroup or channel must be restricted.
26
27
  # @attr is_scam [Boolean] True, if many users reported this supergroup as a scam.
27
28
  class Supergroup < Base
28
29
  attribute :id, TD::Types::Integer
@@ -30,7 +31,10 @@ module TD::Types
30
31
  attribute :date, TD::Types::Integer
31
32
  attribute :status, TD::Types::ChatMemberStatus
32
33
  attribute :member_count, TD::Types::Integer
34
+ attribute :has_linked_chat, TD::Types::Bool
35
+ attribute :has_location, TD::Types::Bool
33
36
  attribute :sign_messages, TD::Types::Bool
37
+ attribute :is_slow_mode_enabled, TD::Types::Bool
34
38
  attribute :is_channel, TD::Types::Bool
35
39
  attribute :is_verified, TD::Types::Bool
36
40
  attribute :restriction_reason, TD::Types::String
@@ -6,15 +6,24 @@ module TD::Types
6
6
  # @attr administrator_count [Integer] Number of privileged users in the supergroup or channel; 0 if unknown.
7
7
  # @attr restricted_count [Integer] Number of restricted users in the supergroup; 0 if unknown.
8
8
  # @attr banned_count [Integer] Number of users banned from chat; 0 if unknown.
9
+ # @attr linked_chat_id [Integer] Chat identifier of a discussion group for the channel, or a channel, for which the
10
+ # supergroup is the designated discussion group; 0 if none or unknown.
11
+ # @attr slow_mode_delay [Integer] Delay between consecutive sent messages for non-administrator supergroup members,
12
+ # in seconds.
13
+ # @attr slow_mode_delay_expires_in [Float] Time left before next message can be sent in the supergroup, in seconds.
14
+ # An {TD::Types::Update::SupergroupFullInfo} update is not triggered when value of this field changes, but both new
15
+ # and old values are non-zero.
9
16
  # @attr can_get_members [Boolean] True, if members of the chat can be retrieved.
10
- # @attr can_set_username [Boolean] True, if the chat can be made public.
17
+ # @attr can_set_username [Boolean] True, if the chat username can be changed.
11
18
  # @attr can_set_sticker_set [Boolean] True, if the supergroup sticker set can be changed.
19
+ # @attr can_set_location [Boolean] True, if the supergroup location can be changed.
12
20
  # @attr can_view_statistics [Boolean] True, if the channel statistics is available through getChatStatisticsUrl.
13
21
  # @attr is_all_history_available [Boolean] True, if new chat members will have access to old messages.
14
- # In public supergroups and both public and private channels, old messages are always available, so this option
15
- # affects only private supergroups.
22
+ # In public or discussion groups and both public and private channels, old messages are always available, so this
23
+ # option affects only private supergroups without a linked chat.
16
24
  # The value of this field is only available for chat administrators.
17
25
  # @attr sticker_set_id [Integer] Identifier of the supergroup sticker set; 0 if none.
26
+ # @attr location [TD::Types::ChatLocation, nil] Location to which the supergroup is connected; may be null.
18
27
  # @attr invite_link [String] Invite link for this chat.
19
28
  # @attr upgraded_from_basic_group_id [Integer] Identifier of the basic group from which supergroup was upgraded; 0 if
20
29
  # none.
@@ -26,12 +35,17 @@ module TD::Types
26
35
  attribute :administrator_count, TD::Types::Integer
27
36
  attribute :restricted_count, TD::Types::Integer
28
37
  attribute :banned_count, TD::Types::Integer
38
+ attribute :linked_chat_id, TD::Types::Integer
39
+ attribute :slow_mode_delay, TD::Types::Integer
40
+ attribute :slow_mode_delay_expires_in, TD::Types::Float
29
41
  attribute :can_get_members, TD::Types::Bool
30
42
  attribute :can_set_username, TD::Types::Bool
31
43
  attribute :can_set_sticker_set, TD::Types::Bool
44
+ attribute :can_set_location, TD::Types::Bool
32
45
  attribute :can_view_statistics, TD::Types::Bool
33
46
  attribute :is_all_history_available, TD::Types::Bool
34
47
  attribute :sticker_set_id, TD::Types::Integer
48
+ attribute :location, TD::Types::ChatLocation.optional.default(nil)
35
49
  attribute :invite_link, TD::Types::String
36
50
  attribute :upgraded_from_basic_group_id, TD::Types::Integer
37
51
  attribute :upgraded_from_max_message_id, TD::Types::Integer
@@ -1,5 +1,5 @@
1
1
  module TD::Types
2
- # Returns the creator and administrators.
2
+ # Returns the owner and administrators.
3
3
  class SupergroupMembersFilter::Administrators < SupergroupMembersFilter
4
4
  end
5
5
  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] Minimum age of a user to be able to accept the terms; 0 if any.
5
+ # @attr min_user_age [Integer] The 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
@@ -8,14 +8,16 @@ module TD::Types
8
8
  bot_command
9
9
  url
10
10
  email_address
11
+ phone_number
11
12
  bold
12
13
  italic
14
+ underline
15
+ strikethrough
13
16
  code
14
17
  pre
15
18
  pre_code
16
19
  text_url
17
20
  mention_name
18
- phone_number
19
21
  ].each do |type|
20
22
  autoload TD::Types.camelize(type), "tdlib/types/text_entity_type/#{type}"
21
23
  end