Skip to content

Commit

Permalink
Update schema to 1.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
hnatt committed Dec 16, 2022
1 parent 80cf9b0 commit 8255bac
Show file tree
Hide file tree
Showing 387 changed files with 5,371 additions and 1,881 deletions.
2,014 changes: 1,624 additions & 390 deletions lib/tdlib/client_methods.rb

Large diffs are not rendered by default.

2,302 changes: 1,271 additions & 1,031 deletions lib/tdlib/types.rb

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions lib/tdlib/types/added_reaction.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module TD::Types
# Represents a reaction applied to a message.
#
# @attr type [TD::Types::ReactionType] Type of the reaction.
# @attr sender_id [TD::Types::MessageSender] Identifier of the chat member, applied the reaction.
class AddedReaction < Base
attribute :type, TD::Types::ReactionType
attribute :sender_id, TD::Types::MessageSender
end
end
13 changes: 13 additions & 0 deletions lib/tdlib/types/added_reactions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module TD::Types
# Represents a list of reactions added to a message.
#
# @attr total_count [Integer] The total number of found reactions.
# @attr reactions [Array<TD::Types::AddedReaction>] The list of added reactions.
# @attr next_offset [TD::Types::String] The offset for the next request.
# If empty, there are no more results.
class AddedReactions < Base
attribute :total_count, TD::Types::Coercible::Integer
attribute :reactions, TD::Types::Array.of(TD::Types::AddedReaction)
attribute :next_offset, TD::Types::String
end
end
19 changes: 11 additions & 8 deletions lib/tdlib/types/animated_emoji.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
module TD::Types
# Describes an animated representation of an emoji.
# Describes an animated or custom 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.
# @attr sticker [TD::Types::Sticker, nil] Sticker for the emoji; may be null if yet unknown for a custom emoji.
# If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs.
# @attr sticker_width [Integer] Expected width of the sticker, which can be used if the sticker is null.
# @attr sticker_height [Integer] Expected height of the sticker, which can be used if the sticker is null.
# @attr fitzpatrick_type [Integer] Emoji modifier fitzpatrick type; 0-6; 0 if none.
# @attr sound [TD::Types::File, nil] File containing the sound to be played when the sticker is clicked; 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 :sticker, TD::Types::Sticker.optional.default(nil)
attribute :sticker_width, TD::Types::Coercible::Integer
attribute :sticker_height, TD::Types::Coercible::Integer
attribute :fitzpatrick_type, TD::Types::Coercible::Integer
attribute :sound, TD::Types::File.optional.default(nil)
end
end
48 changes: 48 additions & 0 deletions lib/tdlib/types/attachment_menu_bot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
module TD::Types
# Represents a bot added to attachment menu.
#
# @attr bot_user_id [Integer] User identifier of the bot added to attachment menu.
# @attr supports_self_chat [Boolean] True, if the bot supports opening from attachment menu in the chat with the bot.
# @attr supports_user_chats [Boolean] True, if the bot supports opening from attachment menu in private chats with
# ordinary users.
# @attr supports_bot_chats [Boolean] True, if the bot supports opening from attachment menu in private chats with
# other bots.
# @attr supports_group_chats [Boolean] True, if the bot supports opening from attachment menu in basic group and
# supergroup chats.
# @attr supports_channel_chats [Boolean] True, if the bot supports opening from attachment menu in channel chats.
# @attr supports_settings [Boolean] True, if the bot supports "settings_button_pressed" event.
# @attr name [TD::Types::String] Name for the bot in attachment menu.
# @attr name_color [TD::Types::AttachmentMenuBotColor, nil] Color to highlight selected name of the bot if
# appropriate; may be null.
# @attr default_icon [TD::Types::File, nil] Default attachment menu icon for the bot in SVG format; may be null.
# @attr ios_static_icon [TD::Types::File, nil] Attachment menu icon for the bot in SVG format for the official iOS
# app; may be null.
# @attr ios_animated_icon [TD::Types::File, nil] Attachment menu icon for the bot in TGS format for the official iOS
# app; may be null.
# @attr android_icon [TD::Types::File, nil] Attachment menu icon for the bot in TGS format for the official Android
# app; may be null.
# @attr macos_icon [TD::Types::File, nil] Attachment menu icon for the bot in TGS format for the official native
# macOS app; may be null.
# @attr icon_color [TD::Types::AttachmentMenuBotColor, nil] Color to highlight selected icon of the bot if
# appropriate; may be null.
# @attr web_app_placeholder [TD::Types::File, nil] Default placeholder for opened Web Apps in SVG format; may be
# null.
class AttachmentMenuBot < Base
attribute :bot_user_id, TD::Types::Coercible::Integer
attribute :supports_self_chat, TD::Types::Bool
attribute :supports_user_chats, TD::Types::Bool
attribute :supports_bot_chats, TD::Types::Bool
attribute :supports_group_chats, TD::Types::Bool
attribute :supports_channel_chats, TD::Types::Bool
attribute :supports_settings, TD::Types::Bool
attribute :name, TD::Types::String
attribute :name_color, TD::Types::AttachmentMenuBotColor.optional.default(nil)
attribute :default_icon, TD::Types::File.optional.default(nil)
attribute :ios_static_icon, TD::Types::File.optional.default(nil)
attribute :ios_animated_icon, TD::Types::File.optional.default(nil)
attribute :android_icon, TD::Types::File.optional.default(nil)
attribute :macos_icon, TD::Types::File.optional.default(nil)
attribute :icon_color, TD::Types::AttachmentMenuBotColor.optional.default(nil)
attribute :web_app_placeholder, TD::Types::File.optional.default(nil)
end
end
10 changes: 10 additions & 0 deletions lib/tdlib/types/attachment_menu_bot_color.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module TD::Types
# Describes a color to highlight a bot added to attachment menu.
#
# @attr light_color [Integer] Color in the RGB24 format for light themes.
# @attr dark_color [Integer] Color in the RGB24 format for dark themes.
class AttachmentMenuBotColor < Base
attribute :light_color, TD::Types::Coercible::Integer
attribute :dark_color, TD::Types::Coercible::Integer
end
end
6 changes: 5 additions & 1 deletion lib/tdlib/types/audio.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ 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 is supposed to be extracted from the downloaded file; may be null.
# The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null.
# @attr external_album_covers [Array<TD::Types::Thumbnail>] Album cover variants to use if the downloaded audio file
# contains no album cover.
# Provided thumbnail dimensions are approximate.
# @attr audio [TD::Types::File] File containing the audio.
class Audio < Base
attribute :duration, TD::Types::Coercible::Integer
Expand All @@ -20,6 +23,7 @@ class Audio < Base
attribute :mime_type, TD::Types::String
attribute :album_cover_minithumbnail, TD::Types::Minithumbnail.optional.default(nil)
attribute :album_cover_thumbnail, TD::Types::Thumbnail.optional.default(nil)
attribute :external_album_covers, TD::Types::Array.of(TD::Types::Thumbnail)
attribute :audio, TD::Types::File
end
end
2 changes: 2 additions & 0 deletions lib/tdlib/types/authentication_code_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ class AuthenticationCodeType < Base
sms
call
flash_call
missed_call
fragment
].each do |type|
autoload TD::Types.camelize(type), "tdlib/types/authentication_code_type/#{type}"
end
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,6 +1,6 @@
module TD::Types
# 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.
# The phone number that calls is the code that must be entered automatically.
#
# @attr pattern [TD::Types::String] Pattern of the phone number from which the call will be made.
class AuthenticationCodeType::FlashCall < AuthenticationCodeType
Expand Down
11 changes: 11 additions & 0 deletions lib/tdlib/types/authentication_code_type/fragment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module TD::Types
# An authentication code is delivered to https://fragment.com.
# The user must be logged in there via a wallet owning the phone number's NFT.
#
# @attr url [TD::Types::String] URL to open to receive the code.
# @attr length [Integer] Length of the code.
class AuthenticationCodeType::Fragment < AuthenticationCodeType
attribute :url, TD::Types::String
attribute :length, TD::Types::Coercible::Integer
end
end
11 changes: 11 additions & 0 deletions lib/tdlib/types/authentication_code_type/missed_call.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module TD::Types
# An authentication code is delivered by an immediately canceled call to the specified phone number.
# The last digits of the phone number that calls are the code that must be entered manually by the user.
#
# @attr phone_number_prefix [TD::Types::String] Prefix of the phone number from which the call will be made.
# @attr length [Integer] Number of digits in the code, excluding the prefix.
class AuthenticationCodeType::MissedCall < AuthenticationCodeType
attribute :phone_number_prefix, TD::Types::String
attribute :length, TD::Types::Coercible::Integer
end
end
3 changes: 2 additions & 1 deletion lib/tdlib/types/authorization_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ module TD::Types
class AuthorizationState < Base
%w[
wait_tdlib_parameters
wait_encryption_key
wait_phone_number
wait_email_address
wait_email_code
wait_code
wait_other_device_confirmation
wait_registration
Expand Down
12 changes: 12 additions & 0 deletions lib/tdlib/types/authorization_state/wait_email_address.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module TD::Types
# TDLib needs the user's email address to authorize.
# Call `setAuthenticationEmailAddress` to provide the email address, or directly call `checkAuthenticationEmailCode`
# with Apple ID/Google ID token if allowed.
#
# @attr allow_apple_id [Boolean] True, if authorization through Apple ID is allowed.
# @attr allow_google_id [Boolean] True, if authorization through Google ID is allowed.
class AuthorizationState::WaitEmailAddress < AuthorizationState
attribute :allow_apple_id, TD::Types::Bool
attribute :allow_google_id, TD::Types::Bool
end
end
16 changes: 16 additions & 0 deletions lib/tdlib/types/authorization_state/wait_email_code.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module TD::Types
# TDLib needs the user's authentication code sent to an email address to authorize.
# Call `checkAuthenticationEmailCode` to provide the code.
#
# @attr allow_apple_id [Boolean] True, if authorization through Apple ID is allowed.
# @attr allow_google_id [Boolean] True, if authorization through Google ID is allowed.
# @attr code_info [TD::Types::EmailAddressAuthenticationCodeInfo] Information about the sent authentication code.
# @attr next_phone_number_authorization_date [Integer] Point in time (Unix timestamp) when the user will be able to
# authorize with a code sent to the user's phone number; 0 if unknown.
class AuthorizationState::WaitEmailCode < AuthorizationState
attribute :allow_apple_id, TD::Types::Bool
attribute :allow_google_id, TD::Types::Bool
attribute :code_info, TD::Types::EmailAddressAuthenticationCodeInfo
attribute :next_phone_number_authorization_date, TD::Types::Coercible::Integer
end
end
8 changes: 0 additions & 8 deletions lib/tdlib/types/authorization_state/wait_encryption_key.rb

This file was deleted.

2 changes: 1 addition & 1 deletion lib/tdlib/types/authorization_state/wait_password.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TD::Types
# The user has been authorized, but needs to enter a password to start using the application.
# The user has been authorized, but needs to enter a 2-step verification password to start using the application.
#
# @attr password_hint [TD::Types::String, nil] Hint for the password; may be empty.
# @attr has_recovery_email_address [Boolean] True, if a recovery email address has been set up.
Expand Down
3 changes: 2 additions & 1 deletion lib/tdlib/types/authorization_state/wait_tdlib_parameters.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module TD::Types
# TDLib needs TdlibParameters for initialization.
# Initializetion parameters are needed.
# Call `setTdlibParameters` to provide them.
class AuthorizationState::WaitTdlibParameters < AuthorizationState
end
end
10 changes: 10 additions & 0 deletions lib/tdlib/types/available_reaction.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module TD::Types
# Represents an available reaction.
#
# @attr type [TD::Types::ReactionType] Type of the reaction.
# @attr needs_premium [Boolean] True, if Telegram Premium is needed to send the reaction.
class AvailableReaction < Base
attribute :type, TD::Types::ReactionType
attribute :needs_premium, TD::Types::Bool
end
end
14 changes: 14 additions & 0 deletions lib/tdlib/types/available_reactions.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module TD::Types
# Represents a list of reactions that can be added to a message.
#
# @attr top_reactions [Array<TD::Types::AvailableReaction>] List of reactions to be shown at the top.
# @attr recent_reactions [Array<TD::Types::AvailableReaction>] List of recently used reactions.
# @attr popular_reactions [Array<TD::Types::AvailableReaction>] List of popular reactions.
# @attr allow_custom_emoji [Boolean] True, if custom emoji reactions could be added by Telegram Premium subscribers.
class AvailableReactions < Base
attribute :top_reactions, TD::Types::Array.of(TD::Types::AvailableReaction)
attribute :recent_reactions, TD::Types::Array.of(TD::Types::AvailableReaction)
attribute :popular_reactions, TD::Types::Array.of(TD::Types::AvailableReaction)
attribute :allow_custom_emoji, TD::Types::Bool
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.
# Must be always divisible by 45.
# Must always be divisible by 45.
class BackgroundFill::Gradient < BackgroundFill
attribute :top_color, TD::Types::Coercible::Integer
attribute :bottom_color, TD::Types::Coercible::Integer
Expand Down
3 changes: 2 additions & 1 deletion lib/tdlib/types/basic_group_full_info.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module TD::Types
# Contains full information about a basic group.
#
# @attr photo [TD::Types::ChatPhoto, nil] Chat photo; may be null.
# @attr photo [TD::Types::ChatPhoto, nil] Chat photo; may be null if empty or unknown.
# If non-null, then it is the same photo as in chat.photo.
# @attr description [TD::Types::String] Group description.
# Updated only after the basic group is opened.
# @attr creator_user_id [Integer] User identifier of the creator of the group; 0 if unknown.
Expand Down
27 changes: 27 additions & 0 deletions lib/tdlib/types/bot_info.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module TD::Types
# Contains information about a bot.
#
# @attr share_text [TD::Types::String] The text that is shown on the bot's profile page and is sent together with the
# link when users share the bot.
# @attr description [TD::Types::String] The text shown in the chat with the bot if the chat is empty.
# @attr photo [TD::Types::Photo, nil] Photo shown in the chat with the bot if the chat is empty; may be null.
# @attr animation [TD::Types::Animation, nil] Animation shown in the chat with the bot if the chat is empty; may be
# null.
# @attr menu_button [TD::Types::BotMenuButton, nil] Information about a button to show instead of the bot commands
# menu button; may be null if ordinary bot commands menu must be shown.
# @attr commands [Array<TD::Types::BotCommand>] List of the bot commands.
# @attr default_group_administrator_rights [TD::Types::ChatAdministratorRights, nil] Default administrator rights for
# adding the bot to basic group and supergroup chats; may be null.
# @attr default_channel_administrator_rights [TD::Types::ChatAdministratorRights, nil] Default administrator rights
# for adding the bot to channels; may be null.
class BotInfo < Base
attribute :share_text, TD::Types::String
attribute :description, TD::Types::String
attribute :photo, TD::Types::Photo.optional.default(nil)
attribute :animation, TD::Types::Animation.optional.default(nil)
attribute :menu_button, TD::Types::BotMenuButton.optional.default(nil)
attribute :commands, TD::Types::Array.of(TD::Types::BotCommand)
attribute :default_group_administrator_rights, TD::Types::ChatAdministratorRights.optional.default(nil)
attribute :default_channel_administrator_rights, TD::Types::ChatAdministratorRights.optional.default(nil)
end
end
10 changes: 10 additions & 0 deletions lib/tdlib/types/bot_menu_button.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module TD::Types
# Describes a button to be shown instead of bot commands menu button.
#
# @attr text [TD::Types::String] Text of the button.
# @attr url [TD::Types::String] URL to be passed to openWebApp.
class BotMenuButton < Base
attribute :text, TD::Types::String
attribute :url, TD::Types::String
end
end
2 changes: 2 additions & 0 deletions lib/tdlib/types/call_server_type/telegram_reflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ module TD::Types
# A Telegram call reflector.
#
# @attr peer_tag [String] A peer tag to be used with the reflector.
# @attr is_tcp [Boolean] True, if the server uses TCP instead of UDP.
class CallServerType::TelegramReflector < CallServerType
attribute :peer_tag, TD::Types::Coercible::String
attribute :is_tcp, TD::Types::Bool
end
end
2 changes: 2 additions & 0 deletions lib/tdlib/types/call_state/discarded.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ module TD::Types
# @attr reason [TD::Types::CallDiscardReason] The reason, why the call has ended.
# @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.
# @attr need_log [Boolean] True, if the call log must be sent to the server.
class CallState::Discarded < CallState
attribute :reason, TD::Types::CallDiscardReason
attribute :need_rating, TD::Types::Bool
attribute :need_debug_information, TD::Types::Bool
attribute :need_log, TD::Types::Bool
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module TD::Types
# The payload for a callback button requiring password.
#
# @attr password [TD::Types::String] The password for the current user.
# @attr password [TD::Types::String] The 2-step verification password for the current user.
# @attr data [String] Data that was attached to the callback button.
class CallbackQueryPayload::DataWithPassword < CallbackQueryPayload
attribute :password, TD::Types::String
Expand Down
Loading

0 comments on commit 8255bac

Please sign in to comment.