Skip to content

Commit

Permalink
Update schema to 1.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
hnatt committed Dec 8, 2021
1 parent 90a28e3 commit 80cf9b0
Show file tree
Hide file tree
Showing 263 changed files with 1,998 additions and 757 deletions.
1,029 changes: 719 additions & 310 deletions lib/tdlib/client_methods.rb

Large diffs are not rendered by default.

134 changes: 110 additions & 24 deletions lib/tdlib/types.rb

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions lib/tdlib/types/account_ttl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ module TD::Types
# Contains information about the period of inactivity after which the current user's account will automatically be
# deleted.
#
# @attr days [Integer] Number of days of inactivity before the account will be flagged for deletion; should range
# from 30-366 days.
# @attr days [Integer] Number of days of inactivity before the account will be flagged for deletion; 30-366 days.
class AccountTtl < Base
attribute :days, TD::Types::Coercible::Integer
end
Expand Down
15 changes: 15 additions & 0 deletions lib/tdlib/types/animated_emoji.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module TD::Types
# Describes an animated representation of an emoji.
#
# @attr sticker [TD::Types::Sticker] Animated sticker for the emoji.
# @attr color_replacements [Array<TD::Types::ColorReplacement>] List of colors to be replaced while the sticker is
# rendered.
# @attr sound [TD::Types::File, nil] File containing the sound to be played when the animated emoji is clicked if
# any; may be null.
# The sound is encoded with the Opus codec, and stored inside an OGG container.
class AnimatedEmoji < Base
attribute :sticker, TD::Types::Sticker
attribute :color_replacements, TD::Types::Array.of(TD::Types::ColorReplacement)
attribute :sound, TD::Types::File.optional.default(nil)
end
end
2 changes: 1 addition & 1 deletion lib/tdlib/types/audio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module TD::Types
# @attr album_cover_minithumbnail [TD::Types::Minithumbnail, nil] The minithumbnail of the album cover; may be null.
# @attr album_cover_thumbnail [TD::Types::Thumbnail, nil] The thumbnail of the album cover in JPEG format; as defined
# by the sender.
# The full size thumbnail should be extracted from the downloaded file; may be null.
# The full size thumbnail is supposed to be extracted from the downloaded file; may be null.
# @attr audio [TD::Types::File] File containing the audio.
class Audio < Base
attribute :duration, TD::Types::Coercible::Integer
Expand Down
8 changes: 4 additions & 4 deletions lib/tdlib/types/authentication_code_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module TD::Types
# Information about the authentication code that was sent.
#
# @attr phone_number [TD::Types::String] A phone number that is being authenticated.
# @attr type [TD::Types::AuthenticationCodeType] Describes the way the code was sent to the user.
# @attr next_type [TD::Types::AuthenticationCodeType, nil] Describes the way the next code will be sent to the user;
# may be null.
# @attr timeout [Integer] Timeout before the code should be re-sent, in seconds.
# @attr type [TD::Types::AuthenticationCodeType] The way the code was sent to the user.
# @attr next_type [TD::Types::AuthenticationCodeType, nil] The way the next code will be sent to the user; may be
# null.
# @attr timeout [Integer] Timeout before the code can be re-sent, in seconds.
class AuthenticationCodeInfo < Base
attribute :phone_number, TD::Types::String
attribute :type, TD::Types::AuthenticationCodeType
Expand Down
2 changes: 1 addition & 1 deletion lib/tdlib/types/authentication_code_type/flash_call.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TD::Types
# An authentication code is delivered by an immediately cancelled call to the specified phone number.
# An authentication code is delivered by an immediately canceled call to the specified phone number.
# The number from which the call was made is the code.
#
# @attr pattern [TD::Types::String] Pattern of the phone number from which the call will be made.
Expand Down
2 changes: 1 addition & 1 deletion lib/tdlib/types/authorization_state/closed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module TD::Types
# All databases are closed and all resources are released.
# No other updates will be received after this.
# All queries will be responded to with error code 500.
# To continue working, one should create a new instance of the TDLib client.
# To continue working, one must create a new instance of the TDLib client.
class AuthorizationState::Closed < AuthorizationState
end
end
8 changes: 4 additions & 4 deletions lib/tdlib/types/auto_download_settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ module TD::Types
# Contains auto-download settings.
#
# @attr is_auto_download_enabled [Boolean] True, if the auto-download is enabled.
# @attr max_photo_file_size [Integer] The maximum size of a photo file to be auto-downloaded.
# @attr max_video_file_size [Integer] The maximum size of a video file to be auto-downloaded.
# @attr max_other_file_size [Integer] The maximum size of other file types to be auto-downloaded.
# @attr video_upload_bitrate [Integer] The maximum suggested bitrate for uploaded videos.
# @attr max_photo_file_size [Integer] The maximum size of a photo file to be auto-downloaded, in bytes.
# @attr max_video_file_size [Integer] The maximum size of a video file to be auto-downloaded, in bytes.
# @attr max_other_file_size [Integer] The maximum size of other file types to be auto-downloaded, in bytes.
# @attr video_upload_bitrate [Integer] The maximum suggested bitrate for uploaded videos, in kbit/s.
# @attr preload_large_videos [Boolean] True, if the beginning of video files needs to be preloaded for instant
# playback.
# @attr preload_next_audio [Boolean] True, if the next audio track needs to be preloaded while the user is listening
Expand Down
2 changes: 1 addition & 1 deletion lib/tdlib/types/auto_download_settings_presets.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TD::Types
# Contains auto-download settings presets for the user.
# Contains auto-download settings presets for the current user.
#
# @attr low [TD::Types::AutoDownloadSettings] Preset with lowest settings; supposed to be used by default when
# roaming.
Expand Down
1 change: 1 addition & 0 deletions lib/tdlib/types/background_fill.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class BackgroundFill < Base
%w[
solid
gradient
freeform_gradient
].each do |type|
autoload TD::Types.camelize(type), "tdlib/types/background_fill/#{type}"
end
Expand Down
8 changes: 8 additions & 0 deletions lib/tdlib/types/background_fill/freeform_gradient.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module TD::Types
# Describes a freeform gradient fill of a background.
#
# @attr colors [Array<Integer>] A list of 3 or 4 colors of the freeform gradients in the RGB24 format.
class BackgroundFill::FreeformGradient < BackgroundFill
attribute :colors, TD::Types::Array.of(TD::Types::Coercible::Integer)
end
end
2 changes: 1 addition & 1 deletion lib/tdlib/types/background_fill/gradient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module TD::Types
# @attr top_color [Integer] A top color of the background in the RGB24 format.
# @attr bottom_color [Integer] A bottom color of the background in the RGB24 format.
# @attr rotation_angle [Integer] Clockwise rotation angle of the gradient, in degrees; 0-359.
# Should be always divisible by 45.
# Must be always divisible by 45.
class BackgroundFill::Gradient < BackgroundFill
attribute :top_color, TD::Types::Coercible::Integer
attribute :bottom_color, TD::Types::Coercible::Integer
Expand Down
2 changes: 1 addition & 1 deletion lib/tdlib/types/background_type/fill.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module TD::Types
# A filled background.
#
# @attr fill [TD::Types::BackgroundFill] Description of the background fill.
# @attr fill [TD::Types::BackgroundFill] The background fill.
class BackgroundType::Fill < BackgroundType
attribute :fill, TD::Types::BackgroundFill
end
Expand Down
8 changes: 6 additions & 2 deletions lib/tdlib/types/background_type/pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ module TD::Types
# A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the
# background fill chosen by the user.
#
# @attr fill [TD::Types::BackgroundFill] Description of the background fill.
# @attr intensity [Integer] Intensity of the pattern when it is shown above the filled background; 0-100.
# @attr fill [TD::Types::BackgroundFill] Fill of the background.
# @attr intensity [Integer] Intensity of the pattern when it is shown above the filled background; 0-100..
# @attr is_inverted [Boolean] True, if the background fill must be applied only to the pattern itself.
# All other pixels are black in this case.
# For dark themes only.
# @attr is_moving [Boolean] True, if the background needs to be slightly moved when device is tilted.
class BackgroundType::Pattern < BackgroundType
attribute :fill, TD::Types::BackgroundFill
attribute :intensity, TD::Types::Coercible::Integer
attribute :is_inverted, TD::Types::Bool
attribute :is_moving, TD::Types::Bool
end
end
2 changes: 2 additions & 0 deletions lib/tdlib/types/basic_group_full_info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ module TD::Types
# @attr invite_link [TD::Types::ChatInviteLink, nil] Primary invite link for this group; may be null.
# For chat administrators with can_invite_users right only.
# Updated only after the basic group is opened.
# @attr bot_commands [Array<TD::Types::BotCommands>] List of commands of bots in the group.
class BasicGroupFullInfo < Base
attribute :photo, TD::Types::ChatPhoto.optional.default(nil)
attribute :description, TD::Types::String
attribute :creator_user_id, TD::Types::Coercible::Integer
attribute :members, TD::Types::Array.of(TD::Types::ChatMember)
attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil)
attribute :bot_commands, TD::Types::Array.of(TD::Types::BotCommands)
end
end
16 changes: 16 additions & 0 deletions lib/tdlib/types/bot_command_scope.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module TD::Types
# Represents the scope to which bot commands are relevant.
class BotCommandScope < Base
%w[
default
all_private_chats
all_group_chats
all_chat_administrators
chat
chat_administrators
chat_member
].each do |type|
autoload TD::Types.camelize(type), "tdlib/types/bot_command_scope/#{type}"
end
end
end
5 changes: 5 additions & 0 deletions lib/tdlib/types/bot_command_scope/all_chat_administrators.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module TD::Types
# A scope covering all group and supergroup chat administrators.
class BotCommandScope::AllChatAdministrators < BotCommandScope
end
end
5 changes: 5 additions & 0 deletions lib/tdlib/types/bot_command_scope/all_group_chats.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module TD::Types
# A scope covering all group and supergroup chats.
class BotCommandScope::AllGroupChats < BotCommandScope
end
end
5 changes: 5 additions & 0 deletions lib/tdlib/types/bot_command_scope/all_private_chats.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module TD::Types
# A scope covering all private chats.
class BotCommandScope::AllPrivateChats < BotCommandScope
end
end
8 changes: 8 additions & 0 deletions lib/tdlib/types/bot_command_scope/chat.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module TD::Types
# A scope covering all members of a chat.
#
# @attr chat_id [Integer] Chat identifier.
class BotCommandScope::Chat < BotCommandScope
attribute :chat_id, TD::Types::Coercible::Integer
end
end
8 changes: 8 additions & 0 deletions lib/tdlib/types/bot_command_scope/chat_administrators.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module TD::Types
# A scope covering all administrators of a chat.
#
# @attr chat_id [Integer] Chat identifier.
class BotCommandScope::ChatAdministrators < BotCommandScope
attribute :chat_id, TD::Types::Coercible::Integer
end
end
10 changes: 10 additions & 0 deletions lib/tdlib/types/bot_command_scope/chat_member.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module TD::Types
# A scope covering a member of a chat.
#
# @attr chat_id [Integer] Chat identifier.
# @attr user_id [Integer] User identifier.
class BotCommandScope::ChatMember < BotCommandScope
attribute :chat_id, TD::Types::Coercible::Integer
attribute :user_id, TD::Types::Coercible::Integer
end
end
5 changes: 5 additions & 0 deletions lib/tdlib/types/bot_command_scope/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module TD::Types
# A scope covering all users.
class BotCommandScope::Default < BotCommandScope
end
end
10 changes: 10 additions & 0 deletions lib/tdlib/types/bot_commands.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module TD::Types
# Contains a list of bot commands.
#
# @attr bot_user_id [Integer] Bot's user identifier.
# @attr commands [Array<TD::Types::BotCommand>] List of bot commands.
class BotCommands < Base
attribute :bot_user_id, TD::Types::Coercible::Integer
attribute :commands, TD::Types::Array.of(TD::Types::BotCommand)
end
end
10 changes: 0 additions & 10 deletions lib/tdlib/types/bot_info.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/tdlib/types/call_discard_reason/missed.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TD::Types
# The call was ended before the conversation started.
# It was cancelled by the caller or missed by the other party.
# It was canceled by the caller or missed by the other party.
class CallDiscardReason::Missed < CallDiscardReason
end
end
4 changes: 2 additions & 2 deletions lib/tdlib/types/call_state/discarded.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ module TD::Types
# The call has ended successfully.
#
# @attr reason [TD::Types::CallDiscardReason] The reason, why the call has ended.
# @attr need_rating [Boolean] True, if the call rating should be sent to the server.
# @attr need_debug_information [Boolean] True, if the call debug information should be sent to the server.
# @attr need_rating [Boolean] True, if the call rating must be sent to the server.
# @attr need_debug_information [Boolean] True, if the call debug information must be sent to the server.
class CallState::Discarded < CallState
attribute :reason, TD::Types::CallDiscardReason
attribute :need_rating, TD::Types::Bool
Expand Down
2 changes: 1 addition & 1 deletion lib/tdlib/types/callback_query_answer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module TD::Types
# Contains a bot's answer to a callback query.
#
# @attr text [TD::Types::String] Text of the answer.
# @attr show_alert [Boolean] True, if an alert should be shown to the user instead of a toast notification.
# @attr show_alert [Boolean] True, if an alert must be shown to the user instead of a toast notification.
# @attr url [TD::Types::String] URL to be opened.
class CallbackQueryAnswer < Base
attribute :text, TD::Types::String
Expand Down
15 changes: 10 additions & 5 deletions lib/tdlib/types/chat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ module TD::Types
# not defined.
# TTL is counted from the time message or its content is viewed in secret chats and from the send date in other
# chats.
# @attr action_bar [TD::Types::ChatActionBar, nil] Describes actions which should be possible to do through a chat
# action bar; may be null.
# @attr voice_chat [TD::Types::VoiceChat] Contains information about voice chat of the chat.
# @attr theme_name [TD::Types::String] If non-empty, name of a theme, set for the chat.
# @attr action_bar [TD::Types::ChatActionBar, nil] Information about actions which must be possible to do through the
# chat action bar; may be null.
# @attr video_chat [TD::Types::VideoChat] Information about video chat of the chat.
# @attr pending_join_requests [TD::Types::ChatJoinRequestsInfo, nil] Information about pending join requests; may be
# null.
# @attr reply_markup_message_id [Integer] Identifier of the message from which reply markup needs to be used; 0 if
# there is no default custom reply markup in the chat.
# @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the chat; may be null.
# @attr client_data [TD::Types::String] Contains application-specific data associated with the chat.
# @attr client_data [TD::Types::String] Application-specific data associated with the chat.
# (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the
# message database is used.
class Chat < Base
Expand All @@ -60,8 +63,10 @@ class Chat < Base
attribute :unread_mention_count, TD::Types::Coercible::Integer
attribute :notification_settings, TD::Types::ChatNotificationSettings
attribute :message_ttl_setting, TD::Types::Coercible::Integer
attribute :theme_name, TD::Types::String
attribute :action_bar, TD::Types::ChatActionBar.optional.default(nil)
attribute :voice_chat, TD::Types::VoiceChat
attribute :video_chat, TD::Types::VideoChat
attribute :pending_join_requests, TD::Types::ChatJoinRequestsInfo.optional.default(nil)
attribute :reply_markup_message_id, TD::Types::Coercible::Integer
attribute :draft_message, TD::Types::DraftMessage.optional.default(nil)
attribute :client_data, TD::Types::String
Expand Down
2 changes: 2 additions & 0 deletions lib/tdlib/types/chat_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ class ChatAction < Base
uploading_voice_note
uploading_photo
uploading_document
choosing_sticker
choosing_location
choosing_contact
start_playing_game
recording_video_note
uploading_video_note
watching_animations
cancel
].each do |type|
autoload TD::Types.camelize(type), "tdlib/types/chat_action/#{type}"
Expand Down
2 changes: 1 addition & 1 deletion lib/tdlib/types/chat_action/cancel.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TD::Types
# The user has cancelled the previous action.
# The user has canceled the previous action.
class ChatAction::Cancel < ChatAction
end
end
5 changes: 5 additions & 0 deletions lib/tdlib/types/chat_action/choosing_sticker.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module TD::Types
# The user is picking a sticker to send.
class ChatAction::ChoosingSticker < ChatAction
end
end
8 changes: 8 additions & 0 deletions lib/tdlib/types/chat_action/watching_animations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module TD::Types
# The user is watching animations sent by the other party by clicking on an animated emoji.
#
# @attr emoji [TD::Types::String] The animated emoji.
class ChatAction::WatchingAnimations < ChatAction
attribute :emoji, TD::Types::String
end
end
2 changes: 1 addition & 1 deletion lib/tdlib/types/chat_action_bar.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TD::Types
# Describes actions which should be possible to do through a chat action bar.
# Describes actions which must be possible to do through a chat action bar.
class ChatActionBar < Base
%w[
report_spam
Expand Down
3 changes: 2 additions & 1 deletion lib/tdlib/types/chat_action_bar/report_add_block.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module TD::Types
# The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be
# blocked using the method blockUser, or the other user can be added to the contact list using the method addContact.
# blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the
# method addContact.
#
# @attr can_unarchive [Boolean] If true, the chat was automatically archived and can be moved back to the main chat
# list using addChatToList simultaneously with setting chat notification settings to default using
Expand Down
11 changes: 6 additions & 5 deletions lib/tdlib/types/chat_event_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class ChatEventAction < Base
message_unpinned
member_joined
member_joined_by_invite_link
member_joined_by_request
member_left
member_invited
member_promoted
Expand All @@ -29,11 +30,11 @@ class ChatEventAction < Base
invite_link_edited
invite_link_revoked
invite_link_deleted
voice_chat_created
voice_chat_discarded
voice_chat_participant_is_muted_toggled
voice_chat_participant_volume_level_changed
voice_chat_mute_new_participants_toggled
video_chat_created
video_chat_discarded
video_chat_participant_is_muted_toggled
video_chat_participant_volume_level_changed
video_chat_mute_new_participants_toggled
].each do |type|
autoload TD::Types.camelize(type), "tdlib/types/chat_event_action/#{type}"
end
Expand Down
10 changes: 10 additions & 0 deletions lib/tdlib/types/chat_event_action/member_joined_by_request.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module TD::Types
# A new member was accepted to the chat by an administrator.
#
# @attr approver_user_id [Integer] User identifier of the chat administrator, approved user join request.
# @attr invite_link [TD::Types::ChatInviteLink, nil] Invite link used to join the chat; may be null.
class ChatEventAction::MemberJoinedByRequest < ChatEventAction
attribute :approver_user_id, TD::Types::Coercible::Integer
attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil)
end
end
Loading

0 comments on commit 80cf9b0

Please sign in to comment.