diff --git a/bin/parser b/bin/parser index fd48520c..eddd1e0a 100755 --- a/bin/parser +++ b/bin/parser @@ -1,4 +1,12 @@ #!/usr/bin/env ruby + +# Possible errors: +# bin/parser:395:in `sort_by': comparison of NilClass with String failed (ArgumentError) +# Solution: +# Fix td_api.tl. In this case there is a extra line +# "//-pass an empty string to abort verification and receive error VERIFICATION_FAILED for the request" +# just move it to the previous line on td_api.tl + require 'active_support/all' AUTOLOAD_BASE_DIR = 'tdlib/types' @@ -40,10 +48,10 @@ def parse_argument_description(argument, description) end { - argument => { - description: description, - optional: optional - } + argument => { + description: description, + optional: optional + } } end @@ -186,10 +194,10 @@ end def type_to_comment_type(type) type.gsub('TD::Types::Array.of(', 'Array<').gsub(')', '>'). - gsub('TD::Types::Coercible::Integer', 'Integer'). - gsub('TD::Types::Coercible::Float', 'Float'). - gsub('TD::Types::Coercible::String', 'String'). - gsub('TD::Types::Bool', 'Boolean') + gsub('TD::Types::Coercible::Integer', 'Integer'). + gsub('TD::Types::Coercible::Float', 'Float'). + gsub('TD::Types::Coercible::String', 'String'). + gsub('TD::Types::Bool', 'Boolean') end # Generates YARD documentation comment for each param @@ -250,7 +258,7 @@ File.write 'lib/tdlib/types/base.rb', klass puts "Parsing #{TD_API_TL_LOCATION}" # Reading the TL file and splitting it into classes and functions -@classes, @functions = open(TD_API_TL_LOCATION).read.split("\n\n---functions---\n\n") +@classes, @functions = File.read(TD_API_TL_LOCATION).split("\n\n---functions---\n\n") # First entry in td_api.tl is typecasting, it's worthless for us. # Last entry before functions is a testing class, once again worthless @@ -294,7 +302,7 @@ puts "Converting classes into Ruby types" class_name = "#{super_class_name}::#{class_name.sub(super_class_name, '')} < #{super_class_name}" puts "MKDIR 'lib/tdlib/types/#{super_class_name.underscore}'" - FileUtils.mkdir_p "lib/tdlib/types/#{super_class_name.underscore}" + FileUtils.mkdir_p "lib/tdlib/types/#{super_class_name.underscore}" end if attributes.blank? diff --git a/lib/tdlib/client_methods.rb b/lib/tdlib/client_methods.rb index 0e6c6a6b..ea48b63e 100644 --- a/lib/tdlib/client_methods.rb +++ b/lib/tdlib/client_methods.rb @@ -4,7 +4,7 @@ module TD::ClientMethods # Accepts an incoming call. # # @param call_id [Integer] Call identifier. - # @param protocol [TD::Types::CallProtocol] Description of the call protocols supported by the application. + # @param protocol [TD::Types::CallProtocol] The call protocols supported by the application. # @return [TD::Types::Ok] def accept_call(call_id:, protocol:) broadcast('@type' => 'acceptCall', @@ -21,15 +21,56 @@ def accept_terms_of_service(terms_of_service_id:) 'terms_of_service_id' => terms_of_service_id) end - # Adds a new member to a chat. + # Activates stealth mode for stories, which hides all views of stories from the current user in the last + # "story_stealth_mode_past_period" seconds and for the next "story_stealth_mode_future_period" seconds; for Telegram + # Premium users only. + # + # @return [TD::Types::Ok] + def activate_story_stealth_mode + broadcast('@type' => 'activateStoryStealthMode') + end + + # Adds a new media preview to the beginning of the list of media previews of a bot. + # Returns the added preview after addition is completed server-side. + # The total number of previews must not exceed getOption("bot_media_preview_count_max") for the given language. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # The bot must be owned and must have the main Web App. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code for which preview is added. + # If empty, then the preview will be shown to all users for whose languages there are no dedicated previews. + # If non-empty, then there must be an official language pack of the same name, which is returned by + # getLocalizationTargetInfo. + # @param content [TD::Types::InputStoryContent] Content of the added preview. + # @return [TD::Types::BotMediaPreview] + def add_bot_media_preview(bot_user_id:, language_code:, content:) + broadcast('@type' => 'addBotMediaPreview', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code, + 'content' => content) + end + + # Adds a chat folder by an invite link. + # + # @param invite_link [TD::Types::String] Invite link for the chat folder. + # @param chat_ids [Array] Identifiers of the chats added to the chat folder. + # The chats are automatically joined if they aren't joined yet. + # @return [TD::Types::Ok] + def add_chat_folder_by_invite_link(invite_link:, chat_ids:) + broadcast('@type' => 'addChatFolderByInviteLink', + 'invite_link' => invite_link, + 'chat_ids' => chat_ids) + end + + # Adds a new member to a chat; requires can_invite_users member right. # Members can't be added to private or secret chats. + # Returns information about members that weren't added. # # @param chat_id [Integer] Chat identifier. # @param user_id [Integer] Identifier of the user. # @param forward_limit [Integer] The number of earlier messages from the chat to be forwarded to the new member; up # to 100. - # Ignored for supergroups and channels. - # @return [TD::Types::Ok] + # Ignored for supergroups and channels, or if the added user is a bot. + # @return [TD::Types::FailedToAddMembers] def add_chat_member(chat_id:, user_id:, forward_limit:) broadcast('@type' => 'addChatMember', 'chat_id' => chat_id, @@ -37,15 +78,16 @@ def add_chat_member(chat_id:, user_id:, forward_limit:) 'forward_limit' => forward_limit) end - # Adds multiple new members to a chat. - # Currently this method is only available for supergroups and channels. + # Adds multiple new members to a chat; requires can_invite_users member right. + # Currently, this method is only available for supergroups and channels. # This method can't be used to join a chat. # Members can't be added to a channel if it has more than 200 members. + # Returns information about members that weren't added. # # @param chat_id [Integer] Chat identifier. # @param user_ids [Array] Identifiers of the users to be added to the chat. # The maximum number of added users is 20 for supergroups and 100 for channels. - # @return [TD::Types::Ok] + # @return [TD::Types::FailedToAddMembers] def add_chat_members(chat_id:, user_ids:) broadcast('@type' => 'addChatMembers', 'chat_id' => chat_id, @@ -68,12 +110,11 @@ def add_chat_to_list(chat_id:, chat_list:) # Adds a user to the contact list or edits an existing contact by their user identifier. # - # @param contact [TD::Types::Contact, nil] The contact to add or edit; phone number can be empty and needs to be + # @param contact [TD::Types::Contact, nil] The contact to add or edit; phone number may be empty and needs to be # specified only if known, vCard is ignored. - # @param share_phone_number [Boolean] True, if the new contact needs to be allowed to see current user's phone - # number. + # @param share_phone_number [Boolean] Pass true to share the current user's phone number with the new contact. # A corresponding rule to {TD::Types::UserPrivacySetting::ShowPhoneNumber} will be added if needed. - # Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be + # Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be # asked to share their phone number. # @return [TD::Types::Ok] def add_contact(contact: nil, share_phone_number:) @@ -85,8 +126,7 @@ def add_contact(contact: nil, share_phone_number:) # Adds a custom server language pack to the list of installed language packs in current localization target. # Can be called before authorization. # - # @param language_pack_id [TD::Types::String] Identifier of a language pack to be added; may be different from a name - # that is used in an "https://t.me/setlanguage/" link. + # @param language_pack_id [TD::Types::String] Identifier of a language pack to be added. # @return [TD::Types::Ok] def add_custom_server_language_pack(language_pack_id:) broadcast('@type' => 'addCustomServerLanguagePack', @@ -96,7 +136,8 @@ def add_custom_server_language_pack(language_pack_id:) # Adds a new sticker to the list of favorite stickers. # The new sticker is added to the top of the list. # If the sticker was already in the list, it is removed from the list first. - # Only stickers belonging to a sticker set can be added to this list. + # Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. + # Emoji stickers can't be added to favorite stickers. # # @param sticker [TD::Types::InputFile] Sticker file to add. # @return [TD::Types::Ok] @@ -105,21 +146,44 @@ def add_favorite_sticker(sticker:) 'sticker' => sticker) end + # Adds a file from a message to the list of file downloads. + # Download progress and completion of the download will be notified through updateFile updates. + # If message database is used, the list of file downloads is persistent across application restarts. + # The downloading is independent of download using downloadFile, i.e. + # it continues if downloadFile is canceled or is used to download a part of the file. + # + # @param file_id [Integer] Identifier of the file to download. + # @param chat_id [Integer] Chat identifier of the message with the file. + # @param message_id [Integer] Message identifier. + # @param priority [Integer] Priority of the download (1-32). + # The higher the priority, the earlier the file will be downloaded. + # If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called + # will be downloaded first. + # @return [TD::Types::File] + def add_file_to_downloads(file_id:, chat_id:, message_id:, priority:) + broadcast('@type' => 'addFileToDownloads', + 'file_id' => file_id, + 'chat_id' => chat_id, + 'message_id' => message_id, + 'priority' => priority) + end + # Adds a local message to a chat. # The message is persistent across application restarts only if the message database is used. # Returns the added message. # # @param chat_id [Integer] Target chat. - # @param sender [TD::Types::MessageSender] The sender sender of the message. - # @param reply_to_message_id [Integer] Identifier of the message to reply to or 0. + # @param sender_id [TD::Types::MessageSender] Identifier of the sender of the message. + # @param reply_to [TD::Types::InputMessageReplyTo] Information about the message or story to be replied; pass null if + # none. # @param disable_notification [Boolean] Pass true to disable notification for the message. # @param input_message_content [TD::Types::InputMessageContent] The content of the message to be added. # @return [TD::Types::Message] - def add_local_message(chat_id:, sender:, reply_to_message_id:, disable_notification:, input_message_content:) + def add_local_message(chat_id:, sender_id:, reply_to:, disable_notification:, input_message_content:) broadcast('@type' => 'addLocalMessage', 'chat_id' => chat_id, - 'sender' => sender, - 'reply_to_message_id' => reply_to_message_id, + 'sender_id' => sender_id, + 'reply_to' => reply_to, 'disable_notification' => disable_notification, 'input_message_content' => input_message_content) end @@ -136,6 +200,26 @@ def add_log_message(verbosity_level:, text:) 'text' => text) end + # Adds a reaction or a tag to a message. + # Use getMessageAvailableReactions to receive the list of available reactions for the message. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @param reaction_type [TD::Types::ReactionType] Type of the reaction to add. + # Use addPaidMessageReaction instead to add the paid reaction. + # @param is_big [Boolean] Pass true if the reaction is added with a big animation. + # @param update_recent_reactions [Boolean] Pass true if the reaction needs to be added to recent reactions; tags are + # never added to the list of recent reactions. + # @return [TD::Types::Ok] + def add_message_reaction(chat_id:, message_id:, reaction_type:, is_big:, update_recent_reactions:) + broadcast('@type' => 'addMessageReaction', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reaction_type' => reaction_type, + 'is_big' => is_big, + 'update_recent_reactions' => update_recent_reactions) + end + # Adds the specified data to data usage statistics. # Can be called before authorization. # @@ -147,12 +231,30 @@ def add_network_statistics(entry:) 'entry' => entry) end + # Adds the paid message reaction to a message. + # Use getMessageAvailableReactions to receive the list of available reactions for the message. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @param star_count [Integer] Number of Telegram Stars to be used for the reaction; + # 1-getOption("paid_reaction_star_count_max"). + # @param is_anonymous [Boolean] Pass true to make paid reaction of the user on the message anonymous; pass false to + # make the user's profile visible among top reactors. + # @return [TD::Types::Ok] + def add_paid_message_reaction(chat_id:, message_id:, star_count:, is_anonymous:) + broadcast('@type' => 'addPaidMessageReaction', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'star_count' => star_count, + 'is_anonymous' => is_anonymous) + end + # Adds a proxy server for network requests. # Can be called before authorization. # - # @param server [TD::Types::String] Proxy server IP address. + # @param server [TD::Types::String] Proxy server domain or IP address. # @param port [Integer] Proxy server port. - # @param enable [Boolean] True, if the proxy should be enabled. + # @param enable [Boolean] Pass true to immediately enable the proxy. # @param type [TD::Types::ProxyType] Proxy type. # @return [TD::Types::Proxy] def add_proxy(server:, port:, enable:, type:) @@ -163,10 +265,77 @@ def add_proxy(server:, port:, enable:, type:) 'type' => type) end + # Adds a message to a quick reply shortcut via inline bot. + # If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new + # shortcut is created. + # The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding + # the new message. + # Returns the added message. + # + # @param shortcut_name [TD::Types::String] Name of the target shortcut. + # @param reply_to_message_id [Integer] Identifier of a quick reply message in the same shortcut to be replied; pass 0 + # if none. + # @param query_id [Integer] Identifier of the inline query. + # @param result_id [TD::Types::String] Identifier of the inline query result. + # @param hide_via_bot [Boolean] Pass true to hide the bot, via which the message is sent. + # Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and + # getOption("venue_search_bot_username"). + # @return [TD::Types::QuickReplyMessage] + def add_quick_reply_shortcut_inline_query_result_message(shortcut_name:, reply_to_message_id:, query_id:, result_id:, + hide_via_bot:) + broadcast('@type' => 'addQuickReplyShortcutInlineQueryResultMessage', + 'shortcut_name' => shortcut_name, + 'reply_to_message_id' => reply_to_message_id, + 'query_id' => query_id, + 'result_id' => result_id, + 'hide_via_bot' => hide_via_bot) + end + + # Adds a message to a quick reply shortcut. + # If shortcut doesn't exist and there are less than getOption("quick_reply_shortcut_count_max") shortcuts, then a new + # shortcut is created. + # The shortcut must not contain more than getOption("quick_reply_shortcut_message_count_max") messages after adding + # the new message. + # Returns the added message. + # + # @param shortcut_name [TD::Types::String] Name of the target shortcut. + # @param reply_to_message_id [Integer] Identifier of a quick reply message in the same shortcut to be replied; pass 0 + # if none. + # @param input_message_content [TD::Types::InputMessageContent] The content of the message to be added; + # inputMessagePoll, {TD::Types::InputMessageContent::Forwarded} and {TD::Types::InputMessageContent::Location} with + # live_period aren't supported. + # @return [TD::Types::QuickReplyMessage] + def add_quick_reply_shortcut_message(shortcut_name:, reply_to_message_id:, input_message_content:) + broadcast('@type' => 'addQuickReplyShortcutMessage', + 'shortcut_name' => shortcut_name, + 'reply_to_message_id' => reply_to_message_id, + 'input_message_content' => input_message_content) + end + + # Adds 2-10 messages grouped together into an album to a quick reply shortcut. + # Currently, only audio, document, photo and video messages can be grouped into an album. + # Documents and audio files can be only grouped in an album with messages of the same type. + # Returns sent messages. + # + # @param shortcut_name [TD::Types::String] Name of the target shortcut. + # @param reply_to_message_id [Integer] Identifier of a quick reply message in the same shortcut to be replied; pass 0 + # if none. + # @param input_message_contents [Array] Contents of messages to be sent. + # At most 10 messages can be added to an album. + # All messages must have the same value of show_caption_above_media. + # @return [TD::Types::QuickReplyMessages] + def add_quick_reply_shortcut_message_album(shortcut_name:, reply_to_message_id:, input_message_contents:) + broadcast('@type' => 'addQuickReplyShortcutMessageAlbum', + 'shortcut_name' => shortcut_name, + 'reply_to_message_id' => reply_to_message_id, + 'input_message_contents' => input_message_contents) + end + # Manually adds a new sticker to the list of recently used stickers. # The new sticker is added to the top of the list. # If the sticker was already in the list, it is removed from the list first. - # Only stickers belonging to a sticker set can be added to this list. + # Only stickers belonging to a sticker set or in WEBP or WEBM format can be added to this list. + # Emoji stickers can't be added to recent stickers. # # @param is_attached [Boolean] Pass true to add the sticker to the list of stickers recently attached to photo or # video files; pass false to add the sticker to the list of recently sent stickers. @@ -195,21 +364,32 @@ def add_recently_found_chat(chat_id:) # Only non-secret video animations with MIME type "video/mp4" can be added to the list. # # @param animation [TD::Types::InputFile] The animation file to be added. - # Only animations known to the server (i.e. - # successfully sent via a message) can be added to the list. + # Only animations known to the server (i.e., successfully sent via a message) can be added to the list. # @return [TD::Types::Ok] def add_saved_animation(animation:) broadcast('@type' => 'addSavedAnimation', 'animation' => animation) end - # Adds a new sticker to a set; for bots only. - # Returns the sticker set. + # Adds a new notification sound to the list of saved notification sounds. + # The new notification sound is added to the top of the list. + # If it is already in the list, its position isn't changed. # - # @param user_id [Integer] Sticker set owner. + # @param sound [TD::Types::InputFile] Notification sound file to add. + # @return [TD::Types::NotificationSound] + def add_saved_notification_sound(sound:) + broadcast('@type' => 'addSavedNotificationSound', + 'sound' => sound) + end + + # Adds a new sticker to a set. + # + # @param user_id [Integer] Sticker set owner; ignored for regular users. # @param name [TD::Types::String] Sticker set name. + # The sticker set must be owned by the current user, and contain less than 200 stickers for custom emoji sticker + # sets and less than 120 otherwise. # @param sticker [TD::Types::InputSticker] Sticker to add to the set. - # @return [TD::Types::StickerSet] + # @return [TD::Types::Ok] def add_sticker_to_set(user_id:, name:, sticker:) broadcast('@type' => 'addStickerToSet', 'user_id' => user_id, @@ -217,11 +397,20 @@ def add_sticker_to_set(user_id:, name:, sticker:) 'sticker' => sticker) end + # Allows the specified bot to send messages to the user. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @return [TD::Types::Ok] + def allow_bot_to_send_messages(bot_user_id:) + broadcast('@type' => 'allowBotToSendMessages', + 'bot_user_id' => bot_user_id) + end + # Sets the result of a callback query; for bots only. # # @param callback_query_id [Integer] Identifier of the callback query. # @param text [TD::Types::String] Text of the answer. - # @param show_alert [Boolean] If true, an alert should be shown to the user instead of a toast notification. + # @param show_alert [Boolean] Pass true to show an alert to the user instead of a toast notification. # @param url [TD::Types::String] URL to be opened. # @param cache_time [Integer] Time during which the result of the query can be cached, in seconds. # @return [TD::Types::Ok] @@ -248,25 +437,23 @@ def answer_custom_query(custom_query_id:, data:) # Sets the result of an inline query; for bots only. # # @param inline_query_id [Integer] Identifier of the inline query. - # @param is_personal [Boolean] True, if the result of the query can be cached for the specified user. + # @param is_personal [Boolean] Pass true if results may be cached and returned only for the user that sent the query. + # By default, results may be returned to any user who sends the same query. + # @param button [TD::Types::InlineQueryResultsButton] Button to be shown above inline query results; pass null if + # none. # @param results [Array] The results of the query. # @param cache_time [Integer] Allowed time to cache the results of the query, in seconds. # @param next_offset [TD::Types::String] Offset for the next inline query; pass an empty string if there are no more # results. - # @param switch_pm_text [TD::Types::String] If non-empty, this text should be shown on the button that opens a - # private chat with the bot and sends a start message to the bot with the parameter switch_pm_parameter. - # @param switch_pm_parameter [TD::Types::String] The parameter for the bot start message. - # @return [TD::Types::Ok] - def answer_inline_query(inline_query_id:, is_personal:, results:, cache_time:, next_offset:, switch_pm_text:, - switch_pm_parameter:) - broadcast('@type' => 'answerInlineQuery', - 'inline_query_id' => inline_query_id, - 'is_personal' => is_personal, - 'results' => results, - 'cache_time' => cache_time, - 'next_offset' => next_offset, - 'switch_pm_text' => switch_pm_text, - 'switch_pm_parameter' => switch_pm_parameter) + # @return [TD::Types::Ok] + def answer_inline_query(inline_query_id:, is_personal:, button:, results:, cache_time:, next_offset:) + broadcast('@type' => 'answerInlineQuery', + 'inline_query_id' => inline_query_id, + 'is_personal' => is_personal, + 'button' => button, + 'results' => results, + 'cache_time' => cache_time, + 'next_offset' => next_offset) end # Sets the result of a pre-checkout query; for bots only. @@ -293,7 +480,56 @@ def answer_shipping_query(shipping_query_id:, shipping_options:, error_message:) 'error_message' => error_message) end - # Bans a member in a chat. + # Sets the result of interaction with a Web App and sends corresponding message on behalf of the user to the chat + # from which the query originated; for bots only. + # + # @param web_app_query_id [TD::Types::String] Identifier of the Web App query. + # @param result [TD::Types::InputInlineQueryResult] The result of the query. + # @return [TD::Types::SentWebAppMessage] + def answer_web_app_query(web_app_query_id:, result:) + broadcast('@type' => 'answerWebAppQuery', + 'web_app_query_id' => web_app_query_id, + 'result' => result) + end + + # Applies a Telegram Premium gift code. + # + # @param code [TD::Types::String] The code to apply. + # @return [TD::Types::Ok] + def apply_premium_gift_code(code:) + broadcast('@type' => 'applyPremiumGiftCode', + 'code' => code) + end + + # Informs server about a purchase through App Store. + # For official applications only. + # + # @param receipt [String] App Store receipt. + # @param purpose [TD::Types::StorePaymentPurpose] Transaction purpose. + # @return [TD::Types::Ok] + def assign_app_store_transaction(receipt:, purpose:) + broadcast('@type' => 'assignAppStoreTransaction', + 'receipt' => receipt, + 'purpose' => purpose) + end + + # Informs server about a purchase through Google Play. + # For official applications only. + # + # @param package_name [TD::Types::String] Application package name. + # @param store_product_id [TD::Types::String] Identifier of the purchased store product. + # @param purchase_token [TD::Types::String] Google Play purchase token. + # @param purpose [TD::Types::StorePaymentPurpose] Transaction purpose. + # @return [TD::Types::Ok] + def assign_google_play_transaction(package_name:, store_product_id:, purchase_token:, purpose:) + broadcast('@type' => 'assignGooglePlayTransaction', + 'package_name' => package_name, + 'store_product_id' => store_product_id, + 'purchase_token' => purchase_token, + 'purpose' => purpose) + end + + # Bans a member in a chat; requires can_restrict_members administrator right. # Members can't be banned in private or secret chats. # In supergroups and channels, the user will not be able to return to the group on their own using invite links, # etc., unless unbanned first. @@ -303,8 +539,8 @@ def answer_shipping_query(shipping_query_id:, shipping_options:, error_message:) # @param banned_until_date [Integer] Point in time (Unix timestamp) when the user will be unbanned; 0 if never. # If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is # considered to be banned forever. - # Ignored in basic groups. - # @param revoke_messages [Boolean] Pass true to delete all messages in the chat for the user. + # Ignored in basic groups and if a chat is banned. + # @param revoke_messages [Boolean] Pass true to delete all messages in the chat for the user that is being removed. # Always true for supergroups and channels. # @return [TD::Types::Ok] def ban_chat_member(chat_id:, member_id:, banned_until_date:, revoke_messages:) @@ -318,9 +554,9 @@ def ban_chat_member(chat_id:, member_id:, banned_until_date:, revoke_messages:) # Blocks an original sender of a message in the Replies chat. # # @param message_id [Integer] The identifier of an incoming message in the Replies chat. - # @param delete_message [Boolean] Pass true if the message must be deleted. - # @param delete_all_messages [Boolean] Pass true if all messages from the same sender must be deleted. - # @param report_spam [Boolean] Pass true if the sender must be reported to the Telegram moderators. + # @param delete_message [Boolean] Pass true to delete the message. + # @param delete_all_messages [Boolean] Pass true to delete all messages from the same sender. + # @param report_spam [Boolean] Pass true to report the sender to the Telegram moderators. # @return [TD::Types::Ok] def block_message_sender_from_replies(message_id:, delete_message:, delete_all_messages:, report_spam:) broadcast('@type' => 'blockMessageSenderFromReplies', @@ -330,6 +566,60 @@ def block_message_sender_from_replies(message_id:, delete_message:, delete_all_m 'report_spam' => report_spam) end + # Boosts a chat and returns the list of available chat boost slots for the current user after the boost. + # + # @param chat_id [Integer] Identifier of the chat. + # @param slot_ids [Array] Identifiers of boost slots of the current user from which to apply boosts to the + # chat. + # @return [TD::Types::ChatBoostSlots] + def boost_chat(chat_id:, slot_ids:) + broadcast('@type' => 'boostChat', + 'chat_id' => chat_id, + 'slot_ids' => slot_ids) + end + + # Checks whether the specified bot can send messages to the user. + # Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @return [TD::Types::Ok] + def can_bot_send_messages(bot_user_id:) + broadcast('@type' => 'canBotSendMessages', + 'bot_user_id' => bot_user_id) + end + + # Checks whether an in-store purchase is possible. + # Must be called before any in-store purchase. + # + # @param purpose [TD::Types::StorePaymentPurpose] Transaction purpose. + # @return [TD::Types::Ok] + def can_purchase_from_store(purpose:) + broadcast('@type' => 'canPurchaseFromStore', + 'purpose' => purpose) + end + + # Check whether the current user can message another user or try to create a chat with them. + # + # @param user_id [Integer] Identifier of the other user. + # @param only_local [Boolean] Pass true to get only locally available information without sending network requests. + # @return [TD::Types::CanSendMessageToUserResult] + def can_send_message_to_user(user_id:, only_local:) + broadcast('@type' => 'canSendMessageToUser', + 'user_id' => user_id, + 'only_local' => only_local) + end + + # Checks whether the current user can send a story on behalf of a chat; requires can_post_stories right for + # supergroup and channel chats. + # + # @param chat_id [Integer] Chat identifier. + # Pass Saved Messages chat identifier when posting a story on behalf of the current user. + # @return [TD::Types::CanSendStoryResult] + def can_send_story(chat_id:) + broadcast('@type' => 'canSendStory', + 'chat_id' => chat_id) + end + # Checks whether the current session can be used to transfer a chat ownership to another user. # # @return [TD::Types::CanTransferOwnershipResult] @@ -350,17 +640,32 @@ def cancel_download_file(file_id:, only_if_pending:) 'only_if_pending' => only_if_pending) end - # Stops the uploading of a file. - # Supported only for files uploaded by using uploadFile. + # Cancels reset of 2-step verification password. + # The method can be called if passwordState.pending_reset_date > 0. + # + # @return [TD::Types::Ok] + def cancel_password_reset + broadcast('@type' => 'cancelPasswordReset') + end + + # Stops the preliminary uploading of a file. + # Supported only for files uploaded by using preliminaryUploadFile. # For other files the behavior is undefined. # # @param file_id [Integer] Identifier of the file to stop uploading. # @return [TD::Types::Ok] - def cancel_upload_file(file_id:) - broadcast('@type' => 'cancelUploadFile', + def cancel_preliminary_upload_file(file_id:) + broadcast('@type' => 'cancelPreliminaryUploadFile', 'file_id' => file_id) end + # Cancels verification of the 2-step verification recovery email address. + # + # @return [TD::Types::PasswordState] + def cancel_recovery_email_address_verification + broadcast('@type' => 'cancelRecoveryEmailAddressVerification') + end + # Changes imported contacts using the list of contacts saved on the device. # Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts. # Query result depends on the result of the previous query, so only one query is possible at the same time. @@ -373,19 +678,6 @@ def change_imported_contacts(contacts:) 'contacts' => contacts) end - # Changes the phone number of the user and sends an authentication code to the user's new phone number. - # On success, returns information about the sent code. - # - # @param phone_number [TD::Types::String] The new phone number of the user in international format. - # @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone - # number. - # @return [TD::Types::AuthenticationCodeInfo] - def change_phone_number(phone_number:, settings:) - broadcast('@type' => 'changePhoneNumber', - 'phone_number' => phone_number, - 'settings' => settings) - end - # Installs/uninstalls or activates/archives a sticker set. # # @param set_id [Integer] Identifier of the sticker set. @@ -414,37 +706,56 @@ def check_authentication_bot_token(token:) # Checks the authentication code. # Works only when the current authorization state is authorizationStateWaitCode. # - # @param code [TD::Types::String] The verification code received via SMS, Telegram message, phone call, or flash - # call. + # @param code [TD::Types::String] Authentication code to check. # @return [TD::Types::Ok] def check_authentication_code(code:) broadcast('@type' => 'checkAuthenticationCode', 'code' => code) end - # Checks the authentication password for correctness. + # Checks the authentication of an email address. + # Works only when the current authorization state is authorizationStateWaitEmailCode. + # + # @param code [TD::Types::EmailAddressAuthentication] Email address authentication to check. + # @return [TD::Types::Ok] + def check_authentication_email_code(code:) + broadcast('@type' => 'checkAuthenticationEmailCode', + 'code' => code) + end + + # Checks the 2-step verification password for correctness. # Works only when the current authorization state is authorizationStateWaitPassword. # - # @param password [TD::Types::String] The password to check. + # @param password [TD::Types::String] The 2-step verification password to check. # @return [TD::Types::Ok] def check_authentication_password(password:) broadcast('@type' => 'checkAuthenticationPassword', 'password' => password) end - # Checks the authentication code sent to confirm a new phone number of the user. + # Checks whether a 2-step verification password recovery code sent to an email address is valid. + # Works only when the current authorization state is authorizationStateWaitPassword. # - # @param code [TD::Types::String] Verification code received by SMS, phone call or flash call. + # @param recovery_code [TD::Types::String] Recovery code to check. # @return [TD::Types::Ok] - def check_change_phone_number_code(code:) - broadcast('@type' => 'checkChangePhoneNumberCode', - 'code' => code) + def check_authentication_password_recovery_code(recovery_code:) + broadcast('@type' => 'checkAuthenticationPasswordRecoveryCode', + 'recovery_code' => recovery_code) + end + + # Checks the validity of an invite link for a chat folder and returns information about the corresponding chat + # folder. + # + # @param invite_link [TD::Types::String] Invite link to be checked. + # @return [TD::Types::ChatFolderInviteLinkInfo] + def check_chat_folder_invite_link(invite_link:) + broadcast('@type' => 'checkChatFolderInviteLink', + 'invite_link' => invite_link) end # Checks the validity of an invite link for a chat and returns information about the corresponding chat. # - # @param invite_link [TD::Types::String] Invite link to be checked; must have URL "t.me", "telegram.me", or - # "telegram.dog" and query beginning with "/joinchat/" or "/+". + # @param invite_link [TD::Types::String] Invite link to be checked. # @return [TD::Types::ChatInviteLinkInfo] def check_chat_invite_link(invite_link:) broadcast('@type' => 'checkChatInviteLink', @@ -453,8 +764,8 @@ def check_chat_invite_link(invite_link:) # Checks whether a username can be set for a chat. # - # @param chat_id [Integer] Chat identifier; should be identifier of a supergroup chat, or a channel chat, or a - # private chat with self, or zero if chat is being created. + # @param chat_id [Integer] Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private + # chat with self, or 0 if the chat is being created. # @param username [TD::Types::String] Username to be checked. # @return [TD::Types::CheckChatUsernameResult] def check_chat_username(chat_id:, username:) @@ -465,6 +776,7 @@ def check_chat_username(chat_id:, username:) # Checks whether the maximum number of owned public chats has been reached. # Returns corresponding error if the limit was reached. + # The limit can be increased with Telegram Premium. # # @param type [TD::Types::PublicChatType] Type of the public chats, for which to check the limit. # @return [TD::Types::Ok] @@ -473,52 +785,79 @@ def check_created_public_chats_limit(type:) 'type' => type) end - # Checks the database encryption key for correctness. - # Works only when the current authorization state is authorizationStateWaitEncryptionKey. - # - # @param encryption_key [String] Encryption key to check or set up. - # @return [TD::Types::Ok] - def check_database_encryption_key(encryption_key:) - broadcast('@type' => 'checkDatabaseEncryptionKey', - 'encryption_key' => encryption_key) - end - # Checks the email address verification code for Telegram Passport. # - # @param code [TD::Types::String] Verification code. + # @param code [TD::Types::String] Verification code to check. # @return [TD::Types::Ok] def check_email_address_verification_code(code:) broadcast('@type' => 'checkEmailAddressVerificationCode', 'code' => code) end - # Checks phone number confirmation code. + # Checks the login email address authentication. # - # @param code [TD::Types::String] The phone number confirmation code. + # @param code [TD::Types::EmailAddressAuthentication] Email address authentication to check. # @return [TD::Types::Ok] - def check_phone_number_confirmation_code(code:) - broadcast('@type' => 'checkPhoneNumberConfirmationCode', + def check_login_email_address_code(code:) + broadcast('@type' => 'checkLoginEmailAddressCode', 'code' => code) end - # Checks the phone number verification code for Telegram Passport. + # Checks whether a 2-step verification password recovery code sent to an email address is valid. + # + # @param recovery_code [TD::Types::String] Recovery code to check. + # @return [TD::Types::Ok] + def check_password_recovery_code(recovery_code:) + broadcast('@type' => 'checkPasswordRecoveryCode', + 'recovery_code' => recovery_code) + end + + # Check the authentication code and completes the request for which the code was sent if appropriate. # - # @param code [TD::Types::String] Verification code. + # @param code [TD::Types::String] Authentication code to check. # @return [TD::Types::Ok] - def check_phone_number_verification_code(code:) - broadcast('@type' => 'checkPhoneNumberVerificationCode', + def check_phone_number_code(code:) + broadcast('@type' => 'checkPhoneNumberCode', + 'code' => code) + end + + # Return information about a Telegram Premium gift code. + # + # @param code [TD::Types::String] The code to check. + # @return [TD::Types::PremiumGiftCodeInfo] + def check_premium_gift_code(code:) + broadcast('@type' => 'checkPremiumGiftCode', 'code' => code) end + # Checks validness of a name for a quick reply shortcut. + # Can be called synchronously. + # + # @param name [TD::Types::String] The name of the shortcut; 1-32 characters. + # @return [TD::Types::Ok] + def check_quick_reply_shortcut_name(name:) + broadcast('@type' => 'checkQuickReplyShortcutName', + 'name' => name) + end + # Checks the 2-step verification recovery email address verification code. # - # @param code [TD::Types::String] Verification code. + # @param code [TD::Types::String] Verification code to check. # @return [TD::Types::PasswordState] def check_recovery_email_address_code(code:) broadcast('@type' => 'checkRecoveryEmailAddressCode', 'code' => code) end + # Checks whether a name can be used for a new sticker set. + # + # @param name [TD::Types::String] Name to be checked. + # @return [TD::Types::CheckStickerSetNameResult] + def check_sticker_set_name(name:) + broadcast('@type' => 'checkStickerSetName', + 'name' => name) + end + # Removes potentially dangerous characters from the name of a file. # The encoding of the file name is supposed to be UTF-8. # Returns an empty string on failure. @@ -531,15 +870,23 @@ def clean_file_name(file_name:) 'file_name' => file_name) end - # Clears draft messages in all chats. + # Clears message drafts in all chats. # - # @param exclude_secret_chats [Boolean] If true, local draft messages in secret chats will not be cleared. + # @param exclude_secret_chats [Boolean] Pass true to keep local message drafts in secret chats. # @return [TD::Types::Ok] def clear_all_draft_messages(exclude_secret_chats:) broadcast('@type' => 'clearAllDraftMessages', 'exclude_secret_chats' => exclude_secret_chats) end + # Clears the list of all autosave settings exceptions. + # The method is guaranteed to work only after at least one call to getAutosaveSettings. + # + # @return [TD::Types::Ok] + def clear_autosave_settings_exceptions + broadcast('@type' => 'clearAutosaveSettingsExceptions') + end + # Clears all imported contacts, contact list remains unchanged. # # @return [TD::Types::Ok] @@ -547,6 +894,20 @@ def clear_imported_contacts broadcast('@type' => 'clearImportedContacts') end + # Clears the list of recently used emoji statuses for self status. + # + # @return [TD::Types::Ok] + def clear_recent_emoji_statuses + broadcast('@type' => 'clearRecentEmojiStatuses') + end + + # Clears the list of recently used reactions. + # + # @return [TD::Types::Ok] + def clear_recent_reactions + broadcast('@type' => 'clearRecentReactions') + end + # Clears the list of recently used stickers. # # @param is_attached [Boolean] Pass true to clear the list of stickers recently attached to photo or video files; @@ -564,6 +925,47 @@ def clear_recently_found_chats broadcast('@type' => 'clearRecentlyFoundChats') end + # Clears the list of recently searched for hashtags or cashtags. + # + # @param clear_cashtags [Boolean] Pass true to clear the list of recently searched for cashtags; otherwise, the list + # of recently searched for hashtags will be cleared. + # @return [TD::Types::Ok] + def clear_searched_for_tags(clear_cashtags:) + broadcast('@type' => 'clearSearchedForTags', + 'clear_cashtags' => clear_cashtags) + end + + # Informs TDLib that a message with an animated emoji was clicked by the user. + # Returns a big animated sticker to be played or a 404 error if usual animation needs to be played. + # + # @param chat_id [Integer] Chat identifier of the message. + # @param message_id [Integer] Identifier of the clicked message. + # @return [TD::Types::Sticker] + def click_animated_emoji_message(chat_id:, message_id:) + broadcast('@type' => 'clickAnimatedEmojiMessage', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + + # Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the + # sponsored message. + # + # @param chat_id [Integer] Chat identifier of the sponsored message. + # @param message_id [Integer] Identifier of the sponsored message. + # @return [TD::Types::Ok] + def click_chat_sponsored_message(chat_id:, message_id:) + broadcast('@type' => 'clickChatSponsoredMessage', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + + # Informs TDLib that the user clicked Premium subscription button on the Premium features screen. + # + # @return [TD::Types::Ok] + def click_premium_subscription_button + broadcast('@type' => 'clickPremiumSubscriptionButton') + end + # Closes the TDLib instance. # All databases will be flushed to disk and properly closed. # After the close completes, updateAuthorizationState with authorizationStateClosed will be sent. @@ -593,6 +995,26 @@ def close_secret_chat(secret_chat_id:) 'secret_chat_id' => secret_chat_id) end + # Informs TDLib that a story is closed by the user. + # + # @param story_sender_chat_id [Integer] The identifier of the sender of the story to close. + # @param story_id [Integer] The identifier of the story. + # @return [TD::Types::Ok] + def close_story(story_sender_chat_id:, story_id:) + broadcast('@type' => 'closeStory', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id) + end + + # Informs TDLib that a previously opened Web App was closed. + # + # @param web_app_launch_id [Integer] Identifier of Web App launch, received from openWebApp. + # @return [TD::Types::Ok] + def close_web_app(web_app_launch_id:) + broadcast('@type' => 'closeWebApp', + 'web_app_launch_id' => web_app_launch_id) + end + # Confirms QR code authentication on another device. # Returns created session on success. # @@ -604,10 +1026,19 @@ def confirm_qr_code_authentication(link:) 'link' => link) end + # Confirms an unconfirmed session of the current user from another device. + # + # @param session_id [Integer] Session identifier. + # @return [TD::Types::Ok] + def confirm_session(session_id:) + broadcast('@type' => 'confirmSession', + 'session_id' => session_id) + end + # Returns an existing chat corresponding to a known basic group. # # @param basic_group_id [Integer] Basic group identifier. - # @param force [Boolean] If true, the chat will be created without network request. + # @param force [Boolean] Pass true to create the chat without a network request. # In this case all information about the chat except its type, title and photo can be incorrect. # @return [TD::Types::Chat] def create_basic_group_chat(basic_group_id:, force:) @@ -616,11 +1047,23 @@ def create_basic_group_chat(basic_group_id:, force:) 'force' => force) end + # Creates a business chat link for the current account. + # Requires Telegram Business subscription. + # There can be up to getOption("business_chat_link_count_max") links created. + # Returns the created link. + # + # @param link_info [TD::Types::InputBusinessChatLink] Information about the link to create. + # @return [TD::Types::BusinessChatLink] + def create_business_chat_link(link_info:) + broadcast('@type' => 'createBusinessChatLink', + 'link_info' => link_info) + end + # Creates a new call. # # @param user_id [Integer] Identifier of the user to be called. - # @param protocol [TD::Types::CallProtocol] Description of the call protocols supported by the application. - # @param is_video [Boolean] True, if a video call needs to be created. + # @param protocol [TD::Types::CallProtocol] The call protocols supported by the application. + # @param is_video [Boolean] Pass true to create a video call. # @return [TD::Types::CallId] def create_call(user_id:, protocol:, is_video:) broadcast('@type' => 'createCall', @@ -629,14 +1072,32 @@ def create_call(user_id:, protocol:, is_video:) 'is_video' => is_video) end - # Creates new chat filter. - # Returns information about the created chat filter. + # Creates new chat folder. + # Returns information about the created chat folder. + # There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram + # Premium. + # + # @param folder [TD::Types::ChatFolder] The new chat folder. + # @return [TD::Types::ChatFolderInfo] + def create_chat_folder(folder:) + broadcast('@type' => 'createChatFolder', + 'folder' => folder) + end + + # Creates a new invite link for a chat folder. + # A link can be created for a chat folder if it has only pinned and included chats. # - # @param filter [TD::Types::ChatFilter] Chat filter. - # @return [TD::Types::ChatFilterInfo] - def create_chat_filter(filter:) - broadcast('@type' => 'createChatFilter', - 'filter' => filter) + # @param chat_folder_id [Integer] Chat folder identifier. + # @param name [TD::Types::String] Name of the link; 0-32 characters. + # @param chat_ids [Array] Identifiers of chats to be accessible by the invite link. + # Use getChatsForChatFolderInviteLink to get suitable chats. + # Basic groups will be automatically converted to supergroups before link creation. + # @return [TD::Types::ChatFolderInviteLink] + def create_chat_folder_invite_link(chat_folder_id:, name:, chat_ids:) + broadcast('@type' => 'createChatFolderInviteLink', + 'chat_folder_id' => chat_folder_id, + 'name' => name, + 'chat_ids' => chat_ids) end # Creates a new invite link for a chat. @@ -644,27 +1105,81 @@ def create_chat_filter(filter:) # Requires administrator privileges and can_invite_users right in the chat. # # @param chat_id [Integer] Chat identifier. - # @param expire_date [Integer] Point in time (Unix timestamp) when the link will expire; pass 0 if never. - # @param member_limit [Integer] The maximum number of chat members that can join the chat by the link simultaneously; - # 0-99999; pass 0 if not limited. + # @param name [TD::Types::String] Invite link name; 0-32 characters. + # @param expiration_date [Integer] Point in time (Unix timestamp) when the link will expire; pass 0 if never. + # @param member_limit [Integer] The maximum number of chat members that can join the chat via the link + # simultaneously; 0-99999; pass 0 if not limited. + # @param creates_join_request [Boolean] Pass true if users joining the chat via the link need to be approved by chat + # administrators. + # In this case, member_limit must be 0. # @return [TD::Types::ChatInviteLink] - def create_chat_invite_link(chat_id:, expire_date:, member_limit:) - broadcast('@type' => 'createChatInviteLink', - 'chat_id' => chat_id, - 'expire_date' => expire_date, - 'member_limit' => member_limit) + def create_chat_invite_link(chat_id:, name:, expiration_date:, member_limit:, creates_join_request:) + broadcast('@type' => 'createChatInviteLink', + 'chat_id' => chat_id, + 'name' => name, + 'expiration_date' => expiration_date, + 'member_limit' => member_limit, + 'creates_join_request' => creates_join_request) + end + + # Creates a new subscription invite link for a channel chat. + # Requires can_invite_users right in the chat. + # + # @param chat_id [Integer] Chat identifier. + # @param name [TD::Types::String] Invite link name; 0-32 characters. + # @param subscription_pricing [TD::Types::StarSubscriptionPricing] Information about subscription plan that will be + # applied to the users joining the chat via the link. + # Subscription period must be 2592000 in production environment, and 60 or 300 if Telegram test environment is + # used. + # @return [TD::Types::ChatInviteLink] + def create_chat_subscription_invite_link(chat_id:, name:, subscription_pricing:) + broadcast('@type' => 'createChatSubscriptionInviteLink', + 'chat_id' => chat_id, + 'name' => name, + 'subscription_pricing' => subscription_pricing) + end + + # Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member + # right in the supergroup. + # + # @param chat_id [Integer] Identifier of the chat. + # @param name [TD::Types::String] Name of the topic; 1-128 characters. + # @param icon [TD::Types::ForumTopicIcon] Icon of the topic. + # Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. + # Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned + # by getForumTopicDefaultIcons. + # @return [TD::Types::ForumTopicInfo] + def create_forum_topic(chat_id:, name:, icon:) + broadcast('@type' => 'createForumTopic', + 'chat_id' => chat_id, + 'name' => name, + 'icon' => icon) + end + + # Creates a link for the given invoice; for bots only. + # + # @param invoice [TD::Types::InputMessageContent] Information about the invoice of the type inputMessageInvoice. + # @return [TD::Types::HttpUrl] + def create_invoice_link(invoice:) + broadcast('@type' => 'createInvoiceLink', + 'invoice' => invoice) end # Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. - # Returns the newly created chat. + # Returns information about the newly created chat. # - # @param user_ids [Array] Identifiers of users to be added to the basic group. + # @param user_ids [Array, nil] Identifiers of users to be added to the basic group; may be empty to create a + # basic group without other members. # @param title [TD::Types::String] Title of the new basic group; 1-128 characters. - # @return [TD::Types::Chat] - def create_new_basic_group_chat(user_ids:, title:) - broadcast('@type' => 'createNewBasicGroupChat', - 'user_ids' => user_ids, - 'title' => title) + # @param message_auto_delete_time [Integer] Message auto-delete time value, in seconds; must be from 0 up to 365 * + # 86400 and be divisible by 86400. + # If 0, then messages aren't deleted automatically. + # @return [TD::Types::CreatedBasicGroupChat] + def create_new_basic_group_chat(user_ids: nil, title:, message_auto_delete_time:) + broadcast('@type' => 'createNewBasicGroupChat', + 'user_ids' => user_ids, + 'title' => title, + 'message_auto_delete_time' => message_auto_delete_time) end # Creates a new secret chat. @@ -677,50 +1192,64 @@ def create_new_secret_chat(user_id:) 'user_id' => user_id) end - # Creates a new sticker set; for bots only. + # Creates a new sticker set. # Returns the newly created sticker set. # - # @param user_id [Integer, nil] Sticker set owner. - # @param title [TD::Types::String, nil] Sticker set title; 1-64 characters. + # @param user_id [Integer] Sticker set owner; ignored for regular users. + # @param title [TD::Types::String] Sticker set title; 1-64 characters. # @param name [TD::Types::String, nil] Sticker set name. # Can contain only English letters, digits and underscores. - # Must end with *"_by_"* (** is case insensitive); 1-64 characters. - # @param is_masks [Boolean, nil] True, if stickers are masks. - # Animated stickers can't be masks. - # @param stickers [Array] List of stickers to be added to the set; must be non-empty. - # All stickers must be of the same type. + # Must end with *"_by_"* (** is case insensitive) for bots; 0-64 characters. + # If empty, then the name returned by getSuggestedStickerSetName will be used automatically. + # @param sticker_type [TD::Types::StickerType] Type of the stickers in the set. + # @param needs_repainting [Boolean] Pass true if stickers in the sticker set must be repainted; for custom emoji + # sticker sets only. + # @param stickers [Array] List of stickers to be added to the set; 1-200 stickers for custom + # emoji sticker sets, and 1-120 stickers otherwise. + # For TGS stickers, uploadStickerFile must be used before the sticker is shown. + # @param source [TD::Types::String, nil] Source of the sticker set; may be empty if unknown. # @return [TD::Types::StickerSet] - def create_new_sticker_set(user_id: nil, title: nil, name: nil, is_masks: nil, stickers:) - broadcast('@type' => 'createNewStickerSet', - 'user_id' => user_id, - 'title' => title, - 'name' => name, - 'is_masks' => is_masks, - 'stickers' => stickers) + def create_new_sticker_set(user_id:, title:, name: nil, sticker_type:, needs_repainting:, stickers:, source: nil) + broadcast('@type' => 'createNewStickerSet', + 'user_id' => user_id, + 'title' => title, + 'name' => name, + 'sticker_type' => sticker_type, + 'needs_repainting' => needs_repainting, + 'stickers' => stickers, + 'source' => source) end # Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. # Returns the newly created chat. # # @param title [TD::Types::String] Title of the new chat; 1-128 characters. - # @param is_channel [Boolean] True, if a channel chat needs to be created. + # @param is_forum [Boolean] Pass true to create a forum supergroup chat. + # @param is_channel [Boolean] Pass true to create a channel chat; ignored if a forum is created. # @param description [TD::Types::String] Chat description; 0-255 characters. - # @param location [TD::Types::ChatLocation] Chat location if a location-based supergroup is being created. - # @param for_import [Boolean] True, if the supergroup is created for importing messages using importMessage. + # @param location [TD::Types::ChatLocation] Chat location if a location-based supergroup is being created; pass null + # to create an ordinary supergroup chat. + # @param message_auto_delete_time [Integer] Message auto-delete time value, in seconds; must be from 0 up to 365 * + # 86400 and be divisible by 86400. + # If 0, then messages aren't deleted automatically. + # @param for_import [Boolean] Pass true to create a supergroup for importing messages using importMessages. # @return [TD::Types::Chat] - def create_new_supergroup_chat(title:, is_channel:, description:, location:, for_import:) - broadcast('@type' => 'createNewSupergroupChat', - 'title' => title, - 'is_channel' => is_channel, - 'description' => description, - 'location' => location, - 'for_import' => for_import) + def create_new_supergroup_chat(title:, is_forum:, is_channel:, description:, location:, message_auto_delete_time:, + for_import:) + broadcast('@type' => 'createNewSupergroupChat', + 'title' => title, + 'is_forum' => is_forum, + 'is_channel' => is_channel, + 'description' => description, + 'location' => location, + 'message_auto_delete_time' => message_auto_delete_time, + 'for_import' => for_import) end # Returns an existing chat corresponding to a given user. # # @param user_id [Integer] User identifier. - # @param force [Boolean] If true, the chat will be created without network request. + # @param force [Boolean] Pass true to create the chat without a network request. # In this case all information about the chat except its type, title and photo can be incorrect. # @return [TD::Types::Chat] def create_private_chat(user_id:, force:) @@ -741,7 +1270,7 @@ def create_secret_chat(secret_chat_id:) # Returns an existing chat corresponding to a known supergroup or channel. # # @param supergroup_id [Integer] Supergroup or channel identifier. - # @param force [Boolean] If true, the chat will be created without network request. + # @param force [Boolean] Pass true to create the chat without a network request. # In this case all information about the chat except its type, title and photo can be incorrect. # @return [TD::Types::Chat] def create_supergroup_chat(supergroup_id:, force:) @@ -752,8 +1281,8 @@ def create_supergroup_chat(supergroup_id:, force:) # Creates a new temporary password for processing payments. # - # @param password [TD::Types::String] Persistent user password. - # @param valid_for [Integer] Time during which the temporary password will be valid, in seconds; should be between 60 + # @param password [TD::Types::String] The 2-step verification password of the current user. + # @param valid_for [Integer] Time during which the temporary password will be valid, in seconds; must be between 60 # and 86400. # @return [TD::Types::TemporaryPasswordState] def create_temporary_password(password:, valid_for:) @@ -762,20 +1291,23 @@ def create_temporary_password(password:, valid_for:) 'valid_for' => valid_for) end - # Creates a voice chat (a group call bound to a chat). - # Available only for basic groups, supergroups and channels; requires can_manage_voice_chats rights. + # Creates a video chat (a group call bound to a chat). + # Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right. # - # @param chat_id [Integer] Chat identifier, in which the voice chat will be created. + # @param chat_id [Integer] Identifier of a chat in which the video chat will be created. # @param title [TD::Types::String, nil] Group call title; if empty, chat title will be used. # @param start_date [Integer] Point in time (Unix timestamp) when the group call is supposed to be started by an - # administrator; 0 to start the voice chat immediately. + # administrator; 0 to start the video chat immediately. # The date must be at least 10 seconds and at most 8 days in the future. + # @param is_rtmp_stream [Boolean] Pass true to create an RTMP stream instead of an ordinary video chat; requires + # owner privileges. # @return [TD::Types::GroupCallId] - def create_voice_chat(chat_id:, title: nil, start_date:) - broadcast('@type' => 'createVoiceChat', - 'chat_id' => chat_id, - 'title' => title, - 'start_date' => start_date) + def create_video_chat(chat_id:, title: nil, start_date:, is_rtmp_stream:) + broadcast('@type' => 'createVideoChat', + 'chat_id' => chat_id, + 'title' => title, + 'start_date' => start_date, + 'is_rtmp_stream' => is_rtmp_stream) end # Deletes the account of the current user, deleting all information associated with the user from the server. @@ -783,10 +1315,14 @@ def create_voice_chat(chat_id:, title: nil, start_date:) # Can be called before authorization when the current authorization state is authorizationStateWaitPassword. # # @param reason [TD::Types::String, nil] The reason why the account was deleted; optional. + # @param password [TD::Types::String] The 2-step verification password of the current user. + # If the current user isn't authorized, then an empty string can be passed and account deletion can be canceled + # within one week. # @return [TD::Types::Ok] - def delete_account(reason: nil) - broadcast('@type' => 'deleteAccount', - 'reason' => reason) + def delete_account(reason: nil, password:) + broadcast('@type' => 'deleteAccount', + 'reason' => reason, + 'password' => password) end # Deletes all call messages. @@ -812,56 +1348,133 @@ def delete_all_revoked_chat_invite_links(chat_id:, creator_user_id:) 'creator_user_id' => creator_user_id) end - # Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. - # For group chats this will release the username and remove all members. - # Chats with more than 1000 members can't be deleted using this method. + # Delete media previews from the list of media previews of a bot. # - # @param chat_id [Integer] Chat identifier. + # @param bot_user_id [Integer] Identifier of the target bot. + # The bot must be owned and must have the main Web App. + # @param language_code [TD::Types::String] Language code of the media previews to delete. + # @param file_ids [Array] File identifiers of the media to delete. # @return [TD::Types::Ok] - def delete_chat(chat_id:) - broadcast('@type' => 'deleteChat', - 'chat_id' => chat_id) + def delete_bot_media_previews(bot_user_id:, language_code:, file_ids:) + broadcast('@type' => 'deleteBotMediaPreviews', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code, + 'file_ids' => file_ids) end - # Deletes existing chat filter. + # Deletes a business chat link of the current account. # - # @param chat_filter_id [Integer] Chat filter identifier. + # @param link [TD::Types::String] The link to delete. # @return [TD::Types::Ok] - def delete_chat_filter(chat_filter_id:) - broadcast('@type' => 'deleteChatFilter', - 'chat_filter_id' => chat_filter_id) + def delete_business_chat_link(link:) + broadcast('@type' => 'deleteBusinessChatLink', + 'link' => link) end - # Deletes all messages in the chat. - # Use Chat.can_be_deleted_only_for_self and Chat.can_be_deleted_for_all_users fields to find whether and how the - # method can be applied to the chat. + # Deletes the business bot that is connected to the current user account. # - # @param chat_id [Integer] Chat identifier. - # @param remove_from_chat_list [Boolean] Pass true if the chat should be removed from the chat list. - # @param revoke [Boolean] Pass true to try to delete chat history for all users. + # @param bot_user_id [Integer] Unique user identifier for the bot. # @return [TD::Types::Ok] - def delete_chat_history(chat_id:, remove_from_chat_list:, revoke:) - broadcast('@type' => 'deleteChatHistory', - 'chat_id' => chat_id, - 'remove_from_chat_list' => remove_from_chat_list, - 'revoke' => revoke) + def delete_business_connected_bot(bot_user_id:) + broadcast('@type' => 'deleteBusinessConnectedBot', + 'bot_user_id' => bot_user_id) end - # Deletes all messages sent by the specified user to a chat. + # Deletes a chat along with all messages in the corresponding chat for all chat members. + # For group chats this will release the usernames and remove all members. + # Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat. + # + # @param chat_id [Integer] Chat identifier. + # @return [TD::Types::Ok] + def delete_chat(chat_id:) + broadcast('@type' => 'deleteChat', + 'chat_id' => chat_id) + end + + # Deletes background in a specific chat. + # + # @param chat_id [Integer] Chat identifier. + # @param restore_previous [Boolean] Pass true to restore previously set background. + # Can be used only in private and secret chats with non-deleted users if userFullInfo.set_chat_background == true. + # Supposed to be used from {TD::Types::MessageContent::ChatSetBackground} messages with the currently set + # background that was set for both sides by the other user. + # @return [TD::Types::Ok] + def delete_chat_background(chat_id:, restore_previous:) + broadcast('@type' => 'deleteChatBackground', + 'chat_id' => chat_id, + 'restore_previous' => restore_previous) + end + + # Deletes existing chat folder. + # + # @param chat_folder_id [Integer] Chat folder identifier. + # @param leave_chat_ids [Array] Identifiers of the chats to leave. + # The chats must be pinned or always included in the folder. + # @return [TD::Types::Ok] + def delete_chat_folder(chat_folder_id:, leave_chat_ids:) + broadcast('@type' => 'deleteChatFolder', + 'chat_folder_id' => chat_folder_id, + 'leave_chat_ids' => leave_chat_ids) + end + + # Deletes an invite link for a chat folder. + # + # @param chat_folder_id [Integer] Chat folder identifier. + # @param invite_link [TD::Types::String] Invite link to be deleted. + # @return [TD::Types::Ok] + def delete_chat_folder_invite_link(chat_folder_id:, invite_link:) + broadcast('@type' => 'deleteChatFolderInviteLink', + 'chat_folder_id' => chat_folder_id, + 'invite_link' => invite_link) + end + + # Deletes all messages in the chat. + # Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the + # method can be applied to the chat. + # + # @param chat_id [Integer] Chat identifier. + # @param remove_from_chat_list [Boolean] Pass true to remove the chat from all chat lists. + # @param revoke [Boolean] Pass true to delete chat history for all users. + # @return [TD::Types::Ok] + def delete_chat_history(chat_id:, remove_from_chat_list:, revoke:) + broadcast('@type' => 'deleteChatHistory', + 'chat_id' => chat_id, + 'remove_from_chat_list' => remove_from_chat_list, + 'revoke' => revoke) + end + + # Deletes all messages between the specified dates in a chat. + # Supported only for private chats and basic groups. + # Messages sent in the last 30 seconds will not be deleted. + # + # @param chat_id [Integer] Chat identifier. + # @param min_date [Integer] The minimum date of the messages to delete. + # @param max_date [Integer] The maximum date of the messages to delete. + # @param revoke [Boolean] Pass true to delete chat messages for all users; private chats only. + # @return [TD::Types::Ok] + def delete_chat_messages_by_date(chat_id:, min_date:, max_date:, revoke:) + broadcast('@type' => 'deleteChatMessagesByDate', + 'chat_id' => chat_id, + 'min_date' => min_date, + 'max_date' => max_date, + 'revoke' => revoke) + end + + # Deletes all messages sent by the specified message sender in a chat. # Supported only for supergroups; requires can_delete_messages administrator privileges. # # @param chat_id [Integer] Chat identifier. - # @param user_id [Integer] User identifier. + # @param sender_id [TD::Types::MessageSender] Identifier of the sender of messages to delete. # @return [TD::Types::Ok] - def delete_chat_messages_from_user(chat_id:, user_id:) - broadcast('@type' => 'deleteChatMessagesFromUser', - 'chat_id' => chat_id, - 'user_id' => user_id) + def delete_chat_messages_by_sender(chat_id:, sender_id:) + broadcast('@type' => 'deleteChatMessagesBySender', + 'chat_id' => chat_id, + 'sender_id' => sender_id) end # Deletes the default reply markup from a chat. - # Must be called after a one-time keyboard or a ForceReply reply markup has been used. - # UpdateChatReplyMarkup will be sent if the reply markup will be changed. + # Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. + # An updateChatReplyMarkup update will be sent if the reply markup is changed. # # @param chat_id [Integer] Chat identifier. # @param message_id [Integer] The message identifier of the used keyboard. @@ -872,6 +1485,27 @@ def delete_chat_reply_markup(chat_id:, message_id:) 'message_id' => message_id) end + # Deletes commands supported by the bot for the given user scope and language; for bots only. + # + # @param scope [TD::Types::BotCommandScope] The scope to which the commands are relevant; pass null to delete + # commands in the default bot command scope. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code or an empty string. + # @return [TD::Types::Ok] + def delete_commands(scope:, language_code:) + broadcast('@type' => 'deleteCommands', + 'scope' => scope, + 'language_code' => language_code) + end + + # Deletes default background for chats. + # + # @param for_dark_theme [Boolean] Pass true if the background is deleted for a dark theme. + # @return [TD::Types::Ok] + def delete_default_background(for_dark_theme:) + broadcast('@type' => 'deleteDefaultBackground', + 'for_dark_theme' => for_dark_theme) + end + # Deletes a file from the TDLib file cache. # # @param file_id [Integer] Identifier of the file to delete. @@ -881,6 +1515,18 @@ def delete_file(file_id:) 'file_id' => file_id) end + # Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless + # the user is creator of the topic, the topic has no messages from other users and has at most 11 messages. + # + # @param chat_id [Integer] Identifier of the chat. + # @param message_thread_id [Integer] Message thread identifier of the forum topic. + # @return [TD::Types::Ok] + def delete_forum_topic(chat_id:, message_thread_id:) + broadcast('@type' => 'deleteForumTopic', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id) + end + # Deletes all information about a language pack in the current localization target. # The language pack which is currently in use (including base language pack) or is being synchronized can't be # deleted. @@ -897,7 +1543,9 @@ def delete_language_pack(language_pack_id:) # # @param chat_id [Integer] Chat identifier. # @param message_ids [Array] Identifiers of the messages to be deleted. - # @param revoke [Boolean] Pass true to try to delete messages for all chat members. + # Use messageProperties.can_be_deleted_only_for_self and messageProperties.can_be_deleted_for_all_users to get + # suitable messages. + # @param revoke [Boolean] Pass true to delete messages for all chat members. # Always true for supergroups, channels and secret chats. # @return [TD::Types::Ok] def delete_messages(chat_id:, message_ids:, revoke:) @@ -925,6 +1573,26 @@ def delete_profile_photo(profile_photo_id:) 'profile_photo_id' => profile_photo_id) end + # Deletes a quick reply shortcut. + # + # @param shortcut_id [Integer] Unique identifier of the quick reply shortcut. + # @return [TD::Types::Ok] + def delete_quick_reply_shortcut(shortcut_id:) + broadcast('@type' => 'deleteQuickReplyShortcut', + 'shortcut_id' => shortcut_id) + end + + # Deletes specified quick reply messages. + # + # @param shortcut_id [Integer] Unique identifier of the quick reply shortcut to which the messages belong. + # @param message_ids [Array] Unique identifiers of the messages. + # @return [TD::Types::Ok] + def delete_quick_reply_shortcut_messages(shortcut_id:, message_ids:) + broadcast('@type' => 'deleteQuickReplyShortcutMessages', + 'shortcut_id' => shortcut_id, + 'message_ids' => message_ids) + end + # Deletes revoked chat invite links. # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for # other links. @@ -945,13 +1613,58 @@ def delete_saved_credentials broadcast('@type' => 'deleteSavedCredentials') end - # Deletes saved order info. + # Deletes all messages in a Saved Messages topic. + # + # @param saved_messages_topic_id [Integer] Identifier of Saved Messages topic which messages will be deleted. + # @return [TD::Types::Ok] + def delete_saved_messages_topic_history(saved_messages_topic_id:) + broadcast('@type' => 'deleteSavedMessagesTopicHistory', + 'saved_messages_topic_id' => saved_messages_topic_id) + end + + # Deletes all messages between the specified dates in a Saved Messages topic. + # Messages sent in the last 30 seconds will not be deleted. + # + # @param saved_messages_topic_id [Integer] Identifier of Saved Messages topic which messages will be deleted. + # @param min_date [Integer] The minimum date of the messages to delete. + # @param max_date [Integer] The maximum date of the messages to delete. + # @return [TD::Types::Ok] + def delete_saved_messages_topic_messages_by_date(saved_messages_topic_id:, min_date:, max_date:) + broadcast('@type' => 'deleteSavedMessagesTopicMessagesByDate', + 'saved_messages_topic_id' => saved_messages_topic_id, + 'min_date' => min_date, + 'max_date' => max_date) + end + + # Deletes saved order information. # # @return [TD::Types::Ok] def delete_saved_order_info broadcast('@type' => 'deleteSavedOrderInfo') end + # Completely deletes a sticker set. + # + # @param name [TD::Types::String] Sticker set name. + # The sticker set must be owned by the current user. + # @return [TD::Types::Ok] + def delete_sticker_set(name:) + broadcast('@type' => 'deleteStickerSet', + 'name' => name) + end + + # Deletes a previously sent story. + # Can be called only if story.can_be_deleted == true. + # + # @param story_sender_chat_id [Integer] Identifier of the chat that posted the story. + # @param story_id [Integer] Identifier of the story to delete. + # @return [TD::Types::Ok] + def delete_story(story_sender_chat_id:, story_id:) + broadcast('@type' => 'deleteStory', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id) + end + # Closes the TDLib instance, destroying all local data without a proper logout. # The current user session will remain in the list of all active sessions. # All local data will be destroyed. @@ -963,6 +1676,16 @@ def destroy broadcast('@type' => 'destroy') end + # Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup + # or channel. + # + # @param supergroup_id [Integer] Identifier of the supergroup or channel. + # @return [TD::Types::Ok] + def disable_all_supergroup_usernames(supergroup_id:) + broadcast('@type' => 'disableAllSupergroupUsernames', + 'supergroup_id' => supergroup_id) + end + # Disables the currently enabled proxy. # Can be called before authorization. # @@ -974,9 +1697,9 @@ def disable_proxy # Discards a call. # # @param call_id [Integer] Call identifier. - # @param is_disconnected [Boolean] True, if the user was disconnected. + # @param is_disconnected [Boolean] Pass true if the user was disconnected. # @param duration [Integer] The call duration, in seconds. - # @param is_video [Boolean] True, if the call was a video call. + # @param is_video [Boolean] Pass true if the call was a video call. # @param connection_id [Integer] Identifier of the connection used during the call. # @return [TD::Types::Ok] def discard_call(call_id:, is_disconnected:, duration:, is_video:, connection_id:) @@ -988,16 +1711,6 @@ def discard_call(call_id:, is_disconnected:, duration:, is_video:, connection_id 'connection_id' => connection_id) end - # Discards a group call. - # Requires groupCall.can_be_managed. - # - # @param group_call_id [Integer] Group call identifier. - # @return [TD::Types::Ok] - def discard_group_call(group_call_id:) - broadcast('@type' => 'discardGroupCall', - 'group_call_id' => group_call_id) - end - # Disconnects all websites from the current user's Telegram account. # # @return [TD::Types::Ok] @@ -1020,14 +1733,14 @@ def disconnect_website(website_id:) # @param file_id [Integer] Identifier of the file to download. # @param priority [Integer] Priority of the download (1-32). # The higher the priority, the earlier the file will be downloaded. - # If the priorities of two files are equal, then the last one for which downloadFile was called will be downloaded - # first. - # @param offset [Integer] The starting position from which the file should be downloaded. - # @param limit [Integer] Number of bytes which should be downloaded starting from the "offset" position before the - # download will be automatically cancelled; use 0 to download without a limit. - # @param synchronous [Boolean] If false, this request returns file state just after the download has been started. - # If true, this request returns file state only after the download has succeeded, has failed, has been cancelled or - # a new downloadFile request with different offset/limit parameters was sent. + # If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called + # will be downloaded first. + # @param offset [Integer] The starting position from which the file needs to be downloaded. + # @param limit [Integer] Number of bytes which need to be downloaded starting from the "offset" position before the + # download will automatically be canceled; use 0 to download without a limit. + # @param synchronous [Boolean] Pass true to return response only after the file download has succeeded, has failed, + # has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return + # file state immediately, just after the download has been started. # @return [TD::Types::File] def download_file(file_id:, priority:, offset:, limit:, synchronous:) broadcast('@type' => 'downloadFile', @@ -1038,35 +1751,216 @@ def download_file(file_id:, priority:, offset:, limit:, synchronous:) 'synchronous' => synchronous) end - # Edits existing chat filter. - # Returns information about the edited chat filter. + # Replaces media preview in the list of media previews of a bot. + # Returns the new preview after edit is completed server-side. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # The bot must be owned and must have the main Web App. + # @param language_code [TD::Types::String] Language code of the media preview to edit. + # @param file_id [Integer] File identifier of the media to replace. + # @param content [TD::Types::InputStoryContent] Content of the new preview. + # @return [TD::Types::BotMediaPreview] + def edit_bot_media_preview(bot_user_id:, language_code:, file_id:, content:) + broadcast('@type' => 'editBotMediaPreview', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code, + 'file_id' => file_id, + 'content' => content) + end + + # Edits a business chat link of the current account. + # Requires Telegram Business subscription. + # Returns the edited link. + # + # @param link [TD::Types::String] The link to edit. + # @param link_info [TD::Types::InputBusinessChatLink] New description of the link. + # @return [TD::Types::BusinessChatLink] + def edit_business_chat_link(link:, link_info:) + broadcast('@type' => 'editBusinessChatLink', + 'link' => link, + 'link_info' => link_info) + end + + # Edits the caption of a message sent on behalf of a business account; for bots only. + # + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which the + # message was sent. + # @param chat_id [Integer] The chat the message belongs to. + # @param message_id [Integer] Identifier of the message. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @param caption [TD::Types::FormattedText] New message content caption; pass null to remove caption; + # 0-getOption("message_caption_length_max") characters. + # @param show_caption_above_media [Boolean] Pass true to show the caption above the media; otherwise, the caption + # will be shown below the media. + # Can be true only for animation, photo, and video messages. + # @return [TD::Types::BusinessMessage] + def edit_business_message_caption(business_connection_id:, chat_id:, message_id:, reply_markup:, caption:, + show_caption_above_media:) + broadcast('@type' => 'editBusinessMessageCaption', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reply_markup' => reply_markup, + 'caption' => caption, + 'show_caption_above_media' => show_caption_above_media) + end + + # Edits the content of a live location in a message sent on behalf of a business account; for bots only. + # + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which the + # message was sent. + # @param chat_id [Integer] The chat the message belongs to. + # @param message_id [Integer] Identifier of the message. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @param location [TD::Types::Location] New location content of the message; pass null to stop sharing the live + # location. + # @param live_period [Integer] New time relative to the message send date, for which the location can be updated, in + # seconds. + # If 0x7FFFFFFF specified, then the location can be updated forever. + # Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must + # remain in the next 90 days. + # Pass 0 to keep the current live_period. + # @param heading [Integer] The new direction in which the location moves, in degrees; 1-360. + # Pass 0 if unknown. + # @param proximity_alert_radius [Integer] The new maximum distance for proximity alerts, in meters (0-100000). + # Pass 0 if the notification is disabled. + # @return [TD::Types::BusinessMessage] + def edit_business_message_live_location(business_connection_id:, chat_id:, message_id:, reply_markup:, location:, + live_period:, heading:, proximity_alert_radius:) + broadcast('@type' => 'editBusinessMessageLiveLocation', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reply_markup' => reply_markup, + 'location' => location, + 'live_period' => live_period, + 'heading' => heading, + 'proximity_alert_radius' => proximity_alert_radius) + end + + # Edits the content of a message with an animation, an audio, a document, a photo or a video in a message sent on + # behalf of a business account; for bots only. + # + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which the + # message was sent. + # @param chat_id [Integer] The chat the message belongs to. + # @param message_id [Integer] Identifier of the message. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. + # @param input_message_content [TD::Types::InputMessageContent] New content of the message. + # Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, + # {TD::Types::InputMessageContent::Photo} or inputMessageVideo. + # @return [TD::Types::BusinessMessage] + def edit_business_message_media(business_connection_id:, chat_id:, message_id:, reply_markup:, input_message_content:) + broadcast('@type' => 'editBusinessMessageMedia', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reply_markup' => reply_markup, + 'input_message_content' => input_message_content) + end + + # Edits the reply markup of a message sent on behalf of a business account; for bots only. + # + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which the + # message was sent. + # @param chat_id [Integer] The chat the message belongs to. + # @param message_id [Integer] Identifier of the message. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @return [TD::Types::BusinessMessage] + def edit_business_message_reply_markup(business_connection_id:, chat_id:, message_id:, reply_markup:) + broadcast('@type' => 'editBusinessMessageReplyMarkup', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reply_markup' => reply_markup) + end + + # Edits the text of a text or game message sent on behalf of a business account; for bots only. # - # @param chat_filter_id [Integer] Chat filter identifier. - # @param filter [TD::Types::ChatFilter] The edited chat filter. - # @return [TD::Types::ChatFilterInfo] - def edit_chat_filter(chat_filter_id:, filter:) - broadcast('@type' => 'editChatFilter', - 'chat_filter_id' => chat_filter_id, - 'filter' => filter) + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which the + # message was sent. + # @param chat_id [Integer] The chat the message belongs to. + # @param message_id [Integer] Identifier of the message. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @param input_message_content [TD::Types::InputMessageContent] New text content of the message. + # Must be of type inputMessageText. + # @return [TD::Types::BusinessMessage] + def edit_business_message_text(business_connection_id:, chat_id:, message_id:, reply_markup:, input_message_content:) + broadcast('@type' => 'editBusinessMessageText', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reply_markup' => reply_markup, + 'input_message_content' => input_message_content) + end + + # Edits existing chat folder. + # Returns information about the edited chat folder. + # + # @param chat_folder_id [Integer] Chat folder identifier. + # @param folder [TD::Types::ChatFolder] The edited chat folder. + # @return [TD::Types::ChatFolderInfo] + def edit_chat_folder(chat_folder_id:, folder:) + broadcast('@type' => 'editChatFolder', + 'chat_folder_id' => chat_folder_id, + 'folder' => folder) + end + + # Edits an invite link for a chat folder. + # + # @param chat_folder_id [Integer] Chat folder identifier. + # @param invite_link [TD::Types::String] Invite link to be edited. + # @param name [TD::Types::String] New name of the link; 0-32 characters. + # @param chat_ids [Array] New identifiers of chats to be accessible by the invite link. + # Use getChatsForChatFolderInviteLink to get suitable chats. + # Basic groups will be automatically converted to supergroups before link editing. + # @return [TD::Types::ChatFolderInviteLink] + def edit_chat_folder_invite_link(chat_folder_id:, invite_link:, name:, chat_ids:) + broadcast('@type' => 'editChatFolderInviteLink', + 'chat_folder_id' => chat_folder_id, + 'invite_link' => invite_link, + 'name' => name, + 'chat_ids' => chat_ids) end # Edits a non-primary invite link for a chat. # Available for basic groups, supergroups, and channels. - # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for - # other links. + # If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used + # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other + # links. # # @param chat_id [Integer] Chat identifier. # @param invite_link [TD::Types::String] Invite link to be edited. - # @param expire_date [Integer] Point in time (Unix timestamp) when the link will expire; pass 0 if never. - # @param member_limit [Integer] The maximum number of chat members that can join the chat by the link simultaneously; - # 0-99999; pass 0 if not limited. + # @param name [TD::Types::String] Invite link name; 0-32 characters. + # @param expiration_date [Integer] Point in time (Unix timestamp) when the link will expire; pass 0 if never. + # @param member_limit [Integer] The maximum number of chat members that can join the chat via the link + # simultaneously; 0-99999; pass 0 if not limited. + # @param creates_join_request [Boolean] Pass true if users joining the chat via the link need to be approved by chat + # administrators. + # In this case, member_limit must be 0. # @return [TD::Types::ChatInviteLink] - def edit_chat_invite_link(chat_id:, invite_link:, expire_date:, member_limit:) - broadcast('@type' => 'editChatInviteLink', - 'chat_id' => chat_id, - 'invite_link' => invite_link, - 'expire_date' => expire_date, - 'member_limit' => member_limit) + def edit_chat_invite_link(chat_id:, invite_link:, name:, expiration_date:, member_limit:, creates_join_request:) + broadcast('@type' => 'editChatInviteLink', + 'chat_id' => chat_id, + 'invite_link' => invite_link, + 'name' => name, + 'expiration_date' => expiration_date, + 'member_limit' => member_limit, + 'creates_join_request' => creates_join_request) + end + + # Edits a subscription invite link for a channel chat. + # Requires can_invite_users right in the chat for own links and owner privileges for other links. + # + # @param chat_id [Integer] Chat identifier. + # @param invite_link [TD::Types::String] Invite link to be edited. + # @param name [TD::Types::String] Invite link name; 0-32 characters. + # @return [TD::Types::ChatInviteLink] + def edit_chat_subscription_invite_link(chat_id:, invite_link:, name:) + broadcast('@type' => 'editChatSubscriptionInviteLink', + 'chat_id' => chat_id, + 'invite_link' => invite_link, + 'name' => name) end # Edits information about a custom local language pack in the current localization target. @@ -1079,37 +1973,72 @@ def edit_custom_language_pack_info(info:) 'info' => info) end + # Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics right in the supergroup + # unless the user is creator of the topic. + # + # @param chat_id [Integer] Identifier of the chat. + # @param message_thread_id [Integer] Message thread identifier of the forum topic. + # @param name [TD::Types::String, nil] New name of the topic; 0-128 characters. + # If empty, the previous topic name is kept. + # @param edit_icon_custom_emoji [Boolean] Pass true to edit the icon of the topic. + # Icon of the General topic can't be edited. + # @param icon_custom_emoji_id [Integer] Identifier of the new custom emoji for topic icon; pass 0 to remove the + # custom emoji. + # Ignored if edit_icon_custom_emoji is false. + # Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by + # getForumTopicDefaultIcons. + # @return [TD::Types::Ok] + def edit_forum_topic(chat_id:, message_thread_id:, name: nil, edit_icon_custom_emoji:, icon_custom_emoji_id:) + broadcast('@type' => 'editForumTopic', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id, + 'name' => name, + 'edit_icon_custom_emoji' => edit_icon_custom_emoji, + 'icon_custom_emoji_id' => icon_custom_emoji_id) + end + # Edits the caption of an inline message sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. - # @param caption [TD::Types::FormattedText] New message content caption; 0-GetOption("message_caption_length_max") - # characters. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @param caption [TD::Types::FormattedText] New message content caption; pass null to remove caption; + # 0-getOption("message_caption_length_max") characters. + # @param show_caption_above_media [Boolean] Pass true to show the caption above the media; otherwise, the caption + # will be shown below the media. + # Can be true only for animation, photo, and video messages. # @return [TD::Types::Ok] - def edit_inline_message_caption(inline_message_id:, reply_markup:, caption:) - broadcast('@type' => 'editInlineMessageCaption', - 'inline_message_id' => inline_message_id, - 'reply_markup' => reply_markup, - 'caption' => caption) + def edit_inline_message_caption(inline_message_id:, reply_markup:, caption:, show_caption_above_media:) + broadcast('@type' => 'editInlineMessageCaption', + 'inline_message_id' => inline_message_id, + 'reply_markup' => reply_markup, + 'caption' => caption, + 'show_caption_above_media' => show_caption_above_media) end # Edits the content of a live location in an inline message sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. - # @param location [TD::Types::Location, nil] New location content of the message; may be null. - # Pass null to stop sharing the live location. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @param location [TD::Types::Location] New location content of the message; pass null to stop sharing the live + # location. + # @param live_period [Integer] New time relative to the message send date, for which the location can be updated, in + # seconds. + # If 0x7FFFFFFF specified, then the location can be updated forever. + # Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must + # remain in the next 90 days. + # Pass 0 to keep the current live_period. # @param heading [Integer] The new direction in which the location moves, in degrees; 1-360. # Pass 0 if unknown. # @param proximity_alert_radius [Integer] The new maximum distance for proximity alerts, in meters (0-100000). # Pass 0 if the notification is disabled. # @return [TD::Types::Ok] - def edit_inline_message_live_location(inline_message_id:, reply_markup:, location: nil, heading:, + def edit_inline_message_live_location(inline_message_id:, reply_markup:, location:, live_period:, heading:, proximity_alert_radius:) broadcast('@type' => 'editInlineMessageLiveLocation', 'inline_message_id' => inline_message_id, 'reply_markup' => reply_markup, 'location' => location, + 'live_period' => live_period, 'heading' => heading, 'proximity_alert_radius' => proximity_alert_radius) end @@ -1118,7 +2047,7 @@ def edit_inline_message_live_location(inline_message_id:, reply_markup:, locatio # sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @param input_message_content [TD::Types::InputMessageContent] New content of the message. # Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, # {TD::Types::InputMessageContent::Photo} or inputMessageVideo. @@ -1133,7 +2062,7 @@ def edit_inline_message_media(inline_message_id:, reply_markup:, input_message_c # Edits the reply markup of an inline message sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. # @return [TD::Types::Ok] def edit_inline_message_reply_markup(inline_message_id:, reply_markup:) broadcast('@type' => 'editInlineMessageReplyMarkup', @@ -1144,9 +2073,9 @@ def edit_inline_message_reply_markup(inline_message_id:, reply_markup:) # Edits the text of an inline text or game message sent via a bot; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. # @param input_message_content [TD::Types::InputMessageContent] New text content of the message. - # Should be of type inputMessageText. + # Must be of type inputMessageText. # @return [TD::Types::Ok] def edit_inline_message_text(inline_message_id:, reply_markup:, input_message_content:) broadcast('@type' => 'editInlineMessageText', @@ -1160,16 +2089,21 @@ def edit_inline_message_text(inline_message_id:, reply_markup:, input_message_co # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. - # @param caption [TD::Types::FormattedText] New message content caption; 0-GetOption("message_caption_length_max") - # characters. + # Use messageProperties.can_be_edited to check whether the message can be edited. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. + # @param caption [TD::Types::FormattedText] New message content caption; 0-getOption("message_caption_length_max") + # characters; pass null to remove caption. + # @param show_caption_above_media [Boolean] Pass true to show the caption above the media; otherwise, the caption + # will be shown below the media. + # Can be true only for animation, photo, and video messages. # @return [TD::Types::Message] - def edit_message_caption(chat_id:, message_id:, reply_markup:, caption:) - broadcast('@type' => 'editMessageCaption', - 'chat_id' => chat_id, - 'message_id' => message_id, - 'reply_markup' => reply_markup, - 'caption' => caption) + def edit_message_caption(chat_id:, message_id:, reply_markup:, caption:, show_caption_above_media:) + broadcast('@type' => 'editMessageCaption', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reply_markup' => reply_markup, + 'caption' => caption, + 'show_caption_above_media' => show_caption_above_media) end # Edits the message content of a live location. @@ -1178,33 +2112,45 @@ def edit_message_caption(chat_id:, message_id:, reply_markup:, caption:) # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. - # @param location [TD::Types::Location, nil] New location content of the message; may be null. - # Pass null to stop sharing the live location. + # Use messageProperties.can_be_edited to check whether the message can be edited. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. + # @param location [TD::Types::Location] New location content of the message; pass null to stop sharing the live + # location. + # @param live_period [Integer] New time relative to the message send date, for which the location can be updated, in + # seconds. + # If 0x7FFFFFFF specified, then the location can be updated forever. + # Otherwise, must not exceed the current live_period by more than a day, and the live location expiration date must + # remain in the next 90 days. + # Pass 0 to keep the current live_period. # @param heading [Integer] The new direction in which the location moves, in degrees; 1-360. # Pass 0 if unknown. # @param proximity_alert_radius [Integer] The new maximum distance for proximity alerts, in meters (0-100000). # Pass 0 if the notification is disabled. # @return [TD::Types::Message] - def edit_message_live_location(chat_id:, message_id:, reply_markup:, location: nil, heading:, proximity_alert_radius:) + def edit_message_live_location(chat_id:, message_id:, reply_markup:, location:, live_period:, heading:, + proximity_alert_radius:) broadcast('@type' => 'editMessageLiveLocation', 'chat_id' => chat_id, 'message_id' => message_id, 'reply_markup' => reply_markup, 'location' => location, + 'live_period' => live_period, 'heading' => heading, 'proximity_alert_radius' => proximity_alert_radius) end - # Edits the content of a message with an animation, an audio, a document, a photo or a video. - # The media in the message can't be replaced if the message was set to self-destruct. - # Media can't be replaced by self-destructing media. - # Media in an album can be edited only to contain a photo or a video. + # Edits the content of a message with an animation, an audio, a document, a photo or a video, including message + # caption. + # If only the caption needs to be edited, use editMessageCaption instead. + # The media can't be edited if the message was set to self-destruct or to a self-destructing media. + # The type of message content in an album can't be changed with exception of replacing a photo with a video or vice + # versa. # Returns the edited message after the edit is completed on the server side. # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # Use messageProperties.can_be_edited to check whether the message can be edited. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @param input_message_content [TD::Types::InputMessageContent] New content of the message. # Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, # {TD::Types::InputMessageContent::Photo} or inputMessageVideo. @@ -1222,7 +2168,8 @@ def edit_message_media(chat_id:, message_id:, reply_markup:, input_message_conte # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup. + # Use messageProperties.can_be_edited to check whether the message can be edited. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. # @return [TD::Types::Message] def edit_message_reply_markup(chat_id:, message_id:, reply_markup:) broadcast('@type' => 'editMessageReplyMarkup', @@ -1236,8 +2183,9 @@ def edit_message_reply_markup(chat_id:, message_id:, reply_markup:) # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param scheduling_state [TD::Types::MessageSchedulingState] The new message scheduling state. - # Pass null to send the message immediately. + # Use messageProperties.can_edit_scheduling_state to check whether the message is suitable. + # @param scheduling_state [TD::Types::MessageSchedulingState] The new message scheduling state; pass null to send the + # message immediately. # @return [TD::Types::Ok] def edit_message_scheduling_state(chat_id:, message_id:, scheduling_state:) broadcast('@type' => 'editMessageSchedulingState', @@ -1251,9 +2199,10 @@ def edit_message_scheduling_state(chat_id:, message_id:, scheduling_state:) # # @param chat_id [Integer] The chat the message belongs to. # @param message_id [Integer] Identifier of the message. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # Use messageProperties.can_be_edited to check whether the message can be edited. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @param input_message_content [TD::Types::InputMessageContent] New text content of the message. - # Should be of type inputMessageText. + # Must be of type inputMessageText. # @return [TD::Types::Message] def edit_message_text(chat_id:, message_id:, reply_markup:, input_message_content:) broadcast('@type' => 'editMessageText', @@ -1267,9 +2216,9 @@ def edit_message_text(chat_id:, message_id:, reply_markup:, input_message_conten # Can be called before authorization. # # @param proxy_id [Integer] Proxy identifier. - # @param server [TD::Types::String] Proxy server IP address. + # @param server [TD::Types::String] Proxy server domain or IP address. # @param port [Integer] Proxy server port. - # @param enable [Boolean] True, if the proxy should be enabled. + # @param enable [Boolean] Pass true to immediately enable the proxy. # @param type [TD::Types::ProxyType] Proxy type. # @return [TD::Types::Proxy] def edit_proxy(proxy_id:, server:, port:, enable:, type:) @@ -1281,6 +2230,70 @@ def edit_proxy(proxy_id:, server:, port:, enable:, type:) 'type' => type) end + # Asynchronously edits the text, media or caption of a quick reply message. + # Use quickReplyMessage.can_be_edited to check whether a message can be edited. + # Text message can be edited only to a text message. + # The type of message content in an album can't be changed with exception of replacing a photo with a video or vice + # versa. + # + # @param shortcut_id [Integer] Unique identifier of the quick reply shortcut with the message. + # @param message_id [Integer] Identifier of the message. + # @param input_message_content [TD::Types::InputMessageContent] New content of the message. + # Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageAudio, + # inputMessageDocument, {TD::Types::InputMessageContent::Photo} or inputMessageVideo. + # @return [TD::Types::Ok] + def edit_quick_reply_message(shortcut_id:, message_id:, input_message_content:) + broadcast('@type' => 'editQuickReplyMessage', + 'shortcut_id' => shortcut_id, + 'message_id' => message_id, + 'input_message_content' => input_message_content) + end + + # Cancels or reenables Telegram Star subscription to a channel. + # + # @param subscription_id [TD::Types::String] Identifier of the subscription to change. + # @param is_canceled [Boolean] New value of is_canceled. + # @return [TD::Types::Ok] + def edit_star_subscription(subscription_id:, is_canceled:) + broadcast('@type' => 'editStarSubscription', + 'subscription_id' => subscription_id, + 'is_canceled' => is_canceled) + end + + # Changes content and caption of a story. + # Can be called only if story.can_be_edited == true. + # + # @param story_sender_chat_id [Integer] Identifier of the chat that posted the story. + # @param story_id [Integer] Identifier of the story to edit. + # @param content [TD::Types::InputStoryContent] New content of the story; pass null to keep the current content. + # @param areas [TD::Types::InputStoryAreas] New clickable rectangle areas to be shown on the story media; pass null + # to keep the current areas. + # Areas can't be edited if story content isn't changed. + # @param caption [TD::Types::FormattedText] New story caption; pass null to keep the current caption. + # @return [TD::Types::Ok] + def edit_story(story_sender_chat_id:, story_id:, content:, areas:, caption:) + broadcast('@type' => 'editStory', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id, + 'content' => content, + 'areas' => areas, + 'caption' => caption) + end + + # Changes cover of a video story. + # Can be called only if story.can_be_edited == true and the story isn't being edited now. + # + # @param story_sender_chat_id [Integer] Identifier of the chat that posted the story. + # @param story_id [Integer] Identifier of the story to edit. + # @param cover_frame_timestamp [Float] New timestamp of the frame, which will be used as video thumbnail. + # @return [TD::Types::Ok] + def edit_story_cover(story_sender_chat_id:, story_id:, cover_frame_timestamp:) + broadcast('@type' => 'editStoryCover', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id, + 'cover_frame_timestamp' => cover_frame_timestamp) + end + # Enables a proxy. # Only one proxy can be enabled at a time. # Can be called before authorization. @@ -1292,6 +2305,16 @@ def enable_proxy(proxy_id:) 'proxy_id' => proxy_id) end + # Ends a group call. + # Requires groupCall.can_be_managed. + # + # @param group_call_id [Integer] Group call identifier. + # @return [TD::Types::Ok] + def end_group_call(group_call_id:) + broadcast('@type' => 'endGroupCall', + 'group_call_id' => group_call_id) + end + # Ends recording of an active group call. # Requires groupCall.can_be_managed group call flag. # @@ -1302,10 +2325,20 @@ def end_group_call_recording(group_call_id:) 'group_call_id' => group_call_id) end + # Ends screen sharing in a joined group call. + # + # @param group_call_id [Integer] Group call identifier. + # @return [TD::Types::Ok] + def end_group_call_screen_sharing(group_call_id:) + broadcast('@type' => 'endGroupCallScreenSharing', + 'group_call_id' => group_call_id) + end + # Finishes the file generation. # # @param generation_id [Integer] The identifier of the generation process. - # @param error [TD::Types::Error] If set, means that file generation has failed and should be terminated. + # @param error [TD::Types::Error] If passed, the file generation has failed and must be terminated; pass null if the + # file generation succeeded. # @return [TD::Types::Ok] def finish_file_generation(generation_id:, error:) broadcast('@type' => 'finishFileGeneration', @@ -1318,25 +2351,29 @@ def finish_file_generation(generation_id:, error:) # If a message can't be forwarded, null will be returned instead of the message. # # @param chat_id [Integer] Identifier of the chat to which to forward messages. + # @param message_thread_id [Integer] If not 0, the message thread identifier in which the message will be sent; for + # forum threads only. # @param from_chat_id [Integer] Identifier of the chat from which to forward messages. # @param message_ids [Array] Identifiers of the messages to forward. # Message identifiers must be in a strictly increasing order. # At most 100 messages can be forwarded simultaneously. - # @param options [TD::Types::MessageSendOptions] Options to be used to send the messages. - # @param send_copy [Boolean] True, if content of the messages needs to be copied without links to the original - # messages. - # Always true if the messages are forwarded to a secret chat. - # @param remove_caption [Boolean] True, if media caption of message copies needs to be removed. + # A message can be forwarded only if messageProperties.can_be_forwarded. + # @param options [TD::Types::MessageSendOptions] Options to be used to send the messages; pass null to use default + # options. + # @param send_copy [Boolean] Pass true to copy content of the messages without reference to the original sender. + # Always true if the messages are forwarded to a secret chat or are local. + # @param remove_caption [Boolean] Pass true to remove media captions of message copies. # Ignored if send_copy is false. # @return [TD::Types::Messages] - def forward_messages(chat_id:, from_chat_id:, message_ids:, options:, send_copy:, remove_caption:) - broadcast('@type' => 'forwardMessages', - 'chat_id' => chat_id, - 'from_chat_id' => from_chat_id, - 'message_ids' => message_ids, - 'options' => options, - 'send_copy' => send_copy, - 'remove_caption' => remove_caption) + def forward_messages(chat_id:, message_thread_id:, from_chat_id:, message_ids:, options:, send_copy:, remove_caption:) + broadcast('@type' => 'forwardMessages', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id, + 'from_chat_id' => from_chat_id, + 'message_ids' => message_ids, + 'options' => options, + 'send_copy' => send_copy, + 'remove_caption' => remove_caption) end # Returns the period of inactivity after which the account of the current user will automatically be deleted. @@ -1346,14 +2383,6 @@ def get_account_ttl broadcast('@type' => 'getAccountTtl') end - # Returns all active live locations that should be updated by the application. - # The list is persistent across application restarts only if the message database is used. - # - # @return [TD::Types::Messages] - def get_active_live_location_messages - broadcast('@type' => 'getActiveLiveLocationMessages') - end - # Returns all active sessions of the current user. # # @return [TD::Types::Sessions] @@ -1363,13 +2392,40 @@ def get_active_sessions # Returns all available Telegram Passport elements. # - # @param password [TD::Types::String] Password of the current user. + # @param password [TD::Types::String] The 2-step verification password of the current user. # @return [TD::Types::PassportElements] def get_all_passport_elements(password:) broadcast('@type' => 'getAllPassportElements', 'password' => password) end + # Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, + # chat_id). + # + # @param sticker_type [TD::Types::StickerType] Type of the stickers to search for. + # @param query [TD::Types::String] Search query. + # @param chat_id [Integer] Chat identifier for which to find stickers. + # @param return_only_main_emoji [Boolean] Pass true if only main emoji for each found sticker must be included in the + # result. + # @return [TD::Types::Emojis] + def get_all_sticker_emojis(sticker_type:, query:, chat_id:, return_only_main_emoji:) + broadcast('@type' => 'getAllStickerEmojis', + 'sticker_type' => sticker_type, + 'query' => query, + 'chat_id' => chat_id, + 'return_only_main_emoji' => return_only_main_emoji) + end + + # Returns an animated emoji corresponding to a given emoji. + # Returns a 404 error if the emoji has no animated emoji. + # + # @param emoji [TD::Types::String] The emoji. + # @return [TD::Types::AnimatedEmoji] + def get_animated_emoji(emoji:) + broadcast('@type' => 'getAnimatedEmoji', + 'emoji' => emoji) + end + # Returns application config, provided by the server. # Can be called before authorization. # @@ -1378,21 +2434,37 @@ def get_application_config broadcast('@type' => 'getApplicationConfig') end + # Returns the link for downloading official Telegram application to be used when the current user invites friends to + # Telegram. + # + # @return [TD::Types::HttpUrl] + def get_application_download_link + broadcast('@type' => 'getApplicationDownloadLink') + end + + # Returns settings for automatic moving of chats to and from the Archive chat lists. + # + # @return [TD::Types::ArchiveChatListSettings] + def get_archive_chat_list_settings + broadcast('@type' => 'getArchiveChatListSettings') + end + # Returns a list of archived sticker sets. # - # @param is_masks [Boolean] Pass true to return mask stickers sets; pass false to return ordinary sticker sets. - # @param offset_sticker_set_id [Integer] Identifier of the sticker set from which to return the result. - # @param limit [Integer] The maximum number of sticker sets to return. + # @param sticker_type [TD::Types::StickerType] Type of the sticker sets to return. + # @param offset_sticker_set_id [Integer] Identifier of the sticker set from which to return the result; use 0 to get + # results from the beginning. + # @param limit [Integer] The maximum number of sticker sets to return; up to 100. # @return [TD::Types::StickerSets] - def get_archived_sticker_sets(is_masks:, offset_sticker_set_id:, limit:) + def get_archived_sticker_sets(sticker_type:, offset_sticker_set_id:, limit:) broadcast('@type' => 'getArchivedStickerSets', - 'is_masks' => is_masks, + 'sticker_type' => sticker_type, 'offset_sticker_set_id' => offset_sticker_set_id, 'limit' => limit) end - # Returns a list of sticker sets attached to a file. - # Currently only photos and videos can have attached sticker sets. + # Returns a list of sticker sets attached to a file, including regular, mask, and emoji sticker sets. + # Currently, only animations, photos, and videos can have attached sticker sets. # # @param file_id [Integer] File identifier. # @return [TD::Types::StickerSets] @@ -1401,6 +2473,15 @@ def get_attached_sticker_sets(file_id:) 'file_id' => file_id) end + # Returns information about a bot that can be added to attachment or side menu. + # + # @param bot_user_id [Integer] Bot's user identifier. + # @return [TD::Types::AttachmentMenuBot] + def get_attachment_menu_bot(bot_user_id:) + broadcast('@type' => 'getAttachmentMenuBot', + 'bot_user_id' => bot_user_id) + end + # Returns the current authorization state; this is an offline request. # For informational purposes only. # Use updateAuthorizationState instead to maintain the current authorization state. @@ -1418,10 +2499,24 @@ def get_auto_download_settings_presets broadcast('@type' => 'getAutoDownloadSettingsPresets') end + # Returns autosave settings for the current user. + # + # @return [TD::Types::AutosaveSettings] + def get_autosave_settings + broadcast('@type' => 'getAutosaveSettings') + end + + # Returns the list of available chat boost slots for the current user. + # + # @return [TD::Types::ChatBoostSlots] + def get_available_chat_boost_slots + broadcast('@type' => 'getAvailableChatBoostSlots') + end + # Constructs a persistent HTTP URL for a background. # # @param name [TD::Types::String] Background name. - # @param type [TD::Types::BackgroundType] Background type. + # @param type [TD::Types::BackgroundType] Background type; {TD::Types::BackgroundType::ChatTheme} isn't supported. # @return [TD::Types::HttpUrl] def get_background_url(name:, type:) broadcast('@type' => 'getBackgroundUrl', @@ -1429,15 +2524,6 @@ def get_background_url(name:, type:) 'type' => type) end - # Returns backgrounds installed by the user. - # - # @param for_dark_theme [Boolean] True, if the backgrounds must be ordered for dark theme. - # @return [TD::Types::Backgrounds] - def get_backgrounds(for_dark_theme:) - broadcast('@type' => 'getBackgrounds', - 'for_dark_theme' => for_dark_theme) - end - # Returns information about a bank card. # # @param bank_card_number [TD::Types::String] The bank card number. @@ -1468,20 +2554,127 @@ def get_basic_group_full_info(basic_group_id:) # Returns users and chats that were blocked by the current user. # + # @param block_list [TD::Types::BlockList] Block list from which to return users. # @param offset [Integer] Number of users and chats to skip in the result; must be non-negative. # @param limit [Integer] The maximum number of users and chats to return; up to 100. # @return [TD::Types::MessageSenders] - def get_blocked_message_senders(offset:, limit:) - broadcast('@type' => 'getBlockedMessageSenders', - 'offset' => offset, - 'limit' => limit) + def get_blocked_message_senders(block_list:, offset:, limit:) + broadcast('@type' => 'getBlockedMessageSenders', + 'block_list' => block_list, + 'offset' => offset, + 'limit' => limit) end - # Sends a callback query to a bot and returns an answer. - # Returns an error with code 502 if the bot fails to answer the query before the query timeout expires. + # Returns the text shown in the chat with a bot if the chat is empty in the given language. + # Can be called only if userTypeBot.can_be_edited == true. # - # @param chat_id [Integer] Identifier of the chat with the message. + # @param bot_user_id [Integer] Identifier of the target bot. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code or an empty string. + # @return [TD::Types::Text] + def get_bot_info_description(bot_user_id:, language_code:) + broadcast('@type' => 'getBotInfoDescription', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code) + end + + # Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the + # given language. + # Can be called only if userTypeBot.can_be_edited == true. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code or an empty string. + # @return [TD::Types::Text] + def get_bot_info_short_description(bot_user_id:, language_code:) + broadcast('@type' => 'getBotInfoShortDescription', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code) + end + + # Returns the list of media previews for the given language and the list of languages for which the bot has dedicated + # previews. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # The bot must be owned and must have the main Web App. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code for which to get previews. + # If empty, then default previews are returned. + # @return [TD::Types::BotMediaPreviewInfo] + def get_bot_media_preview_info(bot_user_id:, language_code:) + broadcast('@type' => 'getBotMediaPreviewInfo', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code) + end + + # Returns the list of media previews of a bot. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # The bot must have the main Web App. + # @return [TD::Types::BotMediaPreviews] + def get_bot_media_previews(bot_user_id:) + broadcast('@type' => 'getBotMediaPreviews', + 'bot_user_id' => bot_user_id) + end + + # Returns the name of a bot in the given language. + # Can be called only if userTypeBot.can_be_edited == true. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code or an empty string. + # @return [TD::Types::Text] + def get_bot_name(bot_user_id:, language_code:) + broadcast('@type' => 'getBotName', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code) + end + + # Returns information about a business chat link. + # + # @param link_name [TD::Types::String] Name of the link. + # @return [TD::Types::BusinessChatLinkInfo] + def get_business_chat_link_info(link_name:) + broadcast('@type' => 'getBusinessChatLinkInfo', + 'link_name' => link_name) + end + + # Returns business chat links created for the current account. + # + # @return [TD::Types::BusinessChatLinks] + def get_business_chat_links + broadcast('@type' => 'getBusinessChatLinks') + end + + # Returns the business bot that is connected to the current user account. + # Returns a 404 error if there is no connected bot. + # + # @return [TD::Types::BusinessConnectedBot] + def get_business_connected_bot + broadcast('@type' => 'getBusinessConnectedBot') + end + + # Returns information about a business connection by its identifier; for bots only. + # + # @param connection_id [TD::Types::String] Identifier of the business connection to return. + # @return [TD::Types::BusinessConnection] + def get_business_connection(connection_id:) + broadcast('@type' => 'getBusinessConnection', + 'connection_id' => connection_id) + end + + # Returns information about features, available to Business users. + # + # @param source [TD::Types::BusinessFeature] Source of the request; pass null if the method is called from settings + # or some non-standard source. + # @return [TD::Types::BusinessFeatures] + def get_business_features(source:) + broadcast('@type' => 'getBusinessFeatures', + 'source' => source) + end + + # Sends a callback query to a bot and returns an answer. + # Returns an error with code 502 if the bot fails to answer the query before the query timeout expires. + # + # @param chat_id [Integer] Identifier of the chat with the message. # @param message_id [Integer] Identifier of the message from which the query originated. + # The message must not be scheduled. # @param payload [TD::Types::CallbackQueryPayload] Query payload. # @return [TD::Types::CallbackQueryAnswer] def get_callback_query_answer(chat_id:, message_id:, payload:) @@ -1504,7 +2697,7 @@ def get_callback_query_message(chat_id:, message_id:, callback_query_id:) 'callback_query_id' => callback_query_id) end - # Returns information about a chat by its identifier, this is an offline request if the current user is not a bot. + # Returns information about a chat by its identifier; this is an offline request if the current user is not a bot. # # @param chat_id [Integer] Chat identifier. # @return [TD::Types::Chat] @@ -1513,6 +2706,15 @@ def get_chat(chat_id:) 'chat_id' => chat_id) end + # Returns the list of active stories posted by the given chat. + # + # @param chat_id [Integer] Chat identifier. + # @return [TD::Types::ChatActiveStories] + def get_chat_active_stories(chat_id:) + broadcast('@type' => 'getChatActiveStories', + 'chat_id' => chat_id) + end + # Returns a list of administrators of the chat with their custom titles. # # @param chat_id [Integer] Chat identifier. @@ -1522,19 +2724,112 @@ def get_chat_administrators(chat_id:) 'chat_id' => chat_id) end + # Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. + # The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). + # For optimal performance, the number of returned stories is chosen by TDLib. + # + # @param chat_id [Integer] Chat identifier. + # @param from_story_id [Integer] Identifier of the story starting from which stories must be returned; use 0 to get + # results from the last story. + # @param limit [Integer] The maximum number of stories to be returned For optimal performance, the number of returned + # stories is chosen by TDLib and can be smaller than the specified limit. + # @return [TD::Types::Stories] + def get_chat_archived_stories(chat_id:, from_story_id:, limit:) + broadcast('@type' => 'getChatArchivedStories', + 'chat_id' => chat_id, + 'from_story_id' => from_story_id, + 'limit' => limit) + end + + # Returns the list of message sender identifiers, which can be used to send messages in a chat. + # + # @param chat_id [Integer] Chat identifier. + # @return [TD::Types::ChatMessageSenders] + def get_chat_available_message_senders(chat_id:) + broadcast('@type' => 'getChatAvailableMessageSenders', + 'chat_id' => chat_id) + end + + # Returns the list of features available for different chat boost levels; this is an offline request. + # + # @param is_channel [Boolean] Pass true to get the list of features for channels; pass false to get the list of + # features for supergroups. + # @return [TD::Types::ChatBoostFeatures] + def get_chat_boost_features(is_channel:) + broadcast('@type' => 'getChatBoostFeatures', + 'is_channel' => is_channel) + end + + # Returns the list of features available on the specific chat boost level; this is an offline request. + # + # @param is_channel [Boolean] Pass true to get the list of features for channels; pass false to get the list of + # features for supergroups. + # @param level [Integer] Chat boost level. + # @return [TD::Types::ChatBoostLevelFeatures] + def get_chat_boost_level_features(is_channel:, level:) + broadcast('@type' => 'getChatBoostLevelFeatures', + 'is_channel' => is_channel, + 'level' => level) + end + + # Returns an HTTPS link to boost the specified supergroup or channel chat. + # + # @param chat_id [Integer] Identifier of the chat. + # @return [TD::Types::ChatBoostLink] + def get_chat_boost_link(chat_id:) + broadcast('@type' => 'getChatBoostLink', + 'chat_id' => chat_id) + end + + # Returns information about a link to boost a chat. + # Can be called for any internal link of the type internalLinkTypeChatBoost. + # + # @param url [TD::Types::String] The link to boost a chat. + # @return [TD::Types::ChatBoostLinkInfo] + def get_chat_boost_link_info(url:) + broadcast('@type' => 'getChatBoostLinkInfo', + 'url' => url) + end + + # Returns the current boost status for a supergroup or a channel chat. + # + # @param chat_id [Integer] Identifier of the chat. + # @return [TD::Types::ChatBoostStatus] + def get_chat_boost_status(chat_id:) + broadcast('@type' => 'getChatBoostStatus', + 'chat_id' => chat_id) + end + + # Returns the list of boosts applied to a chat; requires administrator rights in the chat. + # + # @param chat_id [Integer] Identifier of the chat. + # @param only_gift_codes [Boolean] Pass true to receive only boosts received from gift codes and giveaways created by + # the chat. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of boosts to be returned; up to 100. + # For optimal performance, the number of returned boosts can be smaller than the specified limit. + # @return [TD::Types::FoundChatBoosts] + def get_chat_boosts(chat_id:, only_gift_codes:, offset:, limit:) + broadcast('@type' => 'getChatBoosts', + 'chat_id' => chat_id, + 'only_gift_codes' => only_gift_codes, + 'offset' => offset, + 'limit' => limit) + end + # Returns a list of service actions taken by chat members and administrators in the last 48 hours. # Available only for supergroups and channels. # Requires administrator rights. - # Returns results in reverse chronological order (i. - # e., in order of decreasing event_id). + # Returns results in reverse chronological order (i.e., in order of decreasing event_id). # # @param chat_id [Integer] Chat identifier. # @param query [TD::Types::String] Search query by which to filter events. # @param from_event_id [Integer] Identifier of an event from which to return results. # Use 0 to get results from the latest events. # @param limit [Integer] The maximum number of events to return; up to 100. - # @param filters [TD::Types::ChatEventLogFilters] The types of events to return. - # By default, all types will be returned. + # @param filters [TD::Types::ChatEventLogFilters] The types of events to return; pass null to get chat events of all + # types. # @param user_ids [Array] User identifiers by which to filter events. # By default, events relating to all users will be returned. # @return [TD::Types::ChatEvents] @@ -1548,42 +2843,81 @@ def get_chat_event_log(chat_id:, query:, from_event_id:, limit:, filters:, user_ 'user_ids' => user_ids) end - # Returns information about a chat filter by its identifier. + # Returns information about a chat folder by its identifier. # - # @param chat_filter_id [Integer] Chat filter identifier. - # @return [TD::Types::ChatFilter] - def get_chat_filter(chat_filter_id:) - broadcast('@type' => 'getChatFilter', - 'chat_filter_id' => chat_filter_id) + # @param chat_folder_id [Integer] Chat folder identifier. + # @return [TD::Types::ChatFolder] + def get_chat_folder(chat_folder_id:) + broadcast('@type' => 'getChatFolder', + 'chat_folder_id' => chat_folder_id) + end + + # Returns approximate number of chats in a being created chat folder. + # Main and archive chat lists must be fully preloaded for this function to work correctly. + # + # @param folder [TD::Types::ChatFolder] The new chat folder. + # @return [TD::Types::Count] + def get_chat_folder_chat_count(folder:) + broadcast('@type' => 'getChatFolderChatCount', + 'folder' => folder) + end + + # Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the + # chat folder is deleted. + # + # @param chat_folder_id [Integer] Chat folder identifier. + # @return [TD::Types::Chats] + def get_chat_folder_chats_to_leave(chat_folder_id:) + broadcast('@type' => 'getChatFolderChatsToLeave', + 'chat_folder_id' => chat_folder_id) end - # Returns default icon name for a filter. + # Returns default icon name for a folder. # Can be called synchronously. # - # @param filter [TD::Types::ChatFilter] Chat filter. - # @return [TD::Types::Text] - def get_chat_filter_default_icon_name(filter:) - broadcast('@type' => 'getChatFilterDefaultIconName', - 'filter' => filter) + # @param folder [TD::Types::ChatFolder] Chat folder. + # @return [TD::Types::ChatFolderIcon] + def get_chat_folder_default_icon_name(folder:) + broadcast('@type' => 'getChatFolderDefaultIconName', + 'folder' => folder) + end + + # Returns invite links created by the current user for a shareable chat folder. + # + # @param chat_folder_id [Integer] Chat folder identifier. + # @return [TD::Types::ChatFolderInviteLinks] + def get_chat_folder_invite_links(chat_folder_id:) + broadcast('@type' => 'getChatFolderInviteLinks', + 'chat_folder_id' => chat_folder_id) + end + + # Returns new chats added to a shareable chat folder by its owner. + # The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat + # folder. + # + # @param chat_folder_id [Integer] Chat folder identifier. + # @return [TD::Types::Chats] + def get_chat_folder_new_chats(chat_folder_id:) + broadcast('@type' => 'getChatFolderNewChats', + 'chat_folder_id' => chat_folder_id) end # Returns messages in a chat. - # The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). - # For optimal performance the number of returned messages is chosen by the library. + # The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). + # For optimal performance, the number of returned messages is chosen by TDLib. # This is an offline request if only_local is true. # # @param chat_id [Integer] Chat identifier. # @param from_message_id [Integer] Identifier of the message starting from which history must be fetched; use 0 to # get results from the last message. - # @param offset [Integer] Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to - # get additionally some newer messages. + # @param offset [Integer] Specify 0 to get results from exactly the message from_message_id or a negative offset up + # to 99 to get additionally some newer messages. # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than # 100. # If the offset is negative, the limit must be greater than or equal to -offset. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. - # @param only_local [Boolean] If true, returns only messages that are available locally without sending network - # requests. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @param only_local [Boolean] Pass true to get only messages that are available without sending network requests. # @return [TD::Types::Messages] def get_chat_history(chat_id:, from_message_id:, offset:, limit:, only_local:) broadcast('@type' => 'getChatHistory', @@ -1607,7 +2941,7 @@ def get_chat_invite_link(chat_id:, invite_link:) 'invite_link' => invite_link) end - # Returns list of chat administrators with number of their invite links. + # Returns the list of chat administrators with number of their invite links. # Requires owner privileges in the chat. # # @param chat_id [Integer] Chat identifier. @@ -1617,22 +2951,25 @@ def get_chat_invite_link_counts(chat_id:) 'chat_id' => chat_id) end - # Returns chat members joined a chat by an invite link. + # Returns chat members joined a chat via an invite link. # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for # other links. # # @param chat_id [Integer] Chat identifier. # @param invite_link [TD::Types::String] Invite link for which to return chat members. - # @param offset_member [TD::Types::ChatInviteLinkMember] A chat member from which to return next chat members; use + # @param only_with_expired_subscription [Boolean] Pass true if the link is a subscription link and only members with + # expired subscription must be returned. + # @param offset_member [TD::Types::ChatInviteLinkMember] A chat member from which to return next chat members; pass # null to get results from the beginning. - # @param limit [Integer] The maximum number of chat members to return. + # @param limit [Integer] The maximum number of chat members to return; up to 100. # @return [TD::Types::ChatInviteLinkMembers] - def get_chat_invite_link_members(chat_id:, invite_link:, offset_member:, limit:) - broadcast('@type' => 'getChatInviteLinkMembers', - 'chat_id' => chat_id, - 'invite_link' => invite_link, - 'offset_member' => offset_member, - 'limit' => limit) + def get_chat_invite_link_members(chat_id:, invite_link:, only_with_expired_subscription:, offset_member:, limit:) + broadcast('@type' => 'getChatInviteLinkMembers', + 'chat_id' => chat_id, + 'invite_link' => invite_link, + 'only_with_expired_subscription' => only_with_expired_subscription, + 'offset_member' => offset_member, + 'limit' => limit) end # Returns invite links for a chat created by specified administrator. @@ -1647,7 +2984,7 @@ def get_chat_invite_link_members(chat_id:, invite_link:, offset_member:, limit:) # get results from the beginning. # @param offset_invite_link [TD::Types::String] Invite link starting after which to return invite links; use empty # string to get results from the beginning. - # @param limit [Integer] The maximum number of invite links to return. + # @param limit [Integer] The maximum number of invite links to return; up to 100. # @return [TD::Types::ChatInviteLinks] def get_chat_invite_links(chat_id:, creator_user_id:, is_revoked:, offset_date:, offset_invite_link:, limit:) broadcast('@type' => 'getChatInviteLinks', @@ -1659,6 +2996,28 @@ def get_chat_invite_links(chat_id:, creator_user_id:, is_revoked:, offset_date:, 'limit' => limit) end + # Returns pending join requests in a chat. + # + # @param chat_id [Integer] Chat identifier. + # @param invite_link [TD::Types::String] Invite link for which to return join requests. + # If empty, all join requests will be returned. + # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for + # other links. + # @param query [TD::Types::String] A query to search for in the first names, last names and usernames of the users to + # return. + # @param offset_request [TD::Types::ChatJoinRequest] A chat join request from which to return next requests; pass + # null to get results from the beginning. + # @param limit [Integer] The maximum number of requests to join the chat to return. + # @return [TD::Types::ChatJoinRequests] + def get_chat_join_requests(chat_id:, invite_link:, query:, offset_request:, limit:) + broadcast('@type' => 'getChatJoinRequests', + 'chat_id' => chat_id, + 'invite_link' => invite_link, + 'query' => query, + 'offset_request' => offset_request, + 'limit' => limit) + end + # Returns chat lists to which the chat can be added. # This is an offline request. # @@ -1691,26 +3050,74 @@ def get_chat_message_by_date(chat_id:, date:) 'date' => date) end + # Returns information about the next messages of the specified type in the chat split by days. + # Returns the results in reverse chronological order. + # Can return partial result for the last returned day. + # Behavior of this method depends on the value of the option "utc_time_offset". + # + # @param chat_id [Integer] Identifier of the chat in which to return information about messages. + # @param filter [TD::Types::SearchMessagesFilter] Filter for message content. + # Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and + # {TD::Types::SearchMessagesFilter::UnreadReaction} are unsupported in this function. + # @param from_message_id [Integer] The message identifier from which to return information about messages; use 0 to + # get results from the last message. + # @param saved_messages_topic_id [Integer] If not0, only messages in the specified Saved Messages topic will be + # considered; pass 0 to consider all messages, or for chats other than Saved Messages. + # @return [TD::Types::MessageCalendar] + def get_chat_message_calendar(chat_id:, filter:, from_message_id:, saved_messages_topic_id:) + broadcast('@type' => 'getChatMessageCalendar', + 'chat_id' => chat_id, + 'filter' => filter, + 'from_message_id' => from_message_id, + 'saved_messages_topic_id' => saved_messages_topic_id) + end + # Returns approximate number of messages of the specified type in the chat. # # @param chat_id [Integer] Identifier of the chat in which to count messages. # @param filter [TD::Types::SearchMessagesFilter] Filter for message content; # {TD::Types::SearchMessagesFilter::Empty} is unsupported in this function. - # @param return_local [Boolean] If true, returns count that is available locally without sending network requests, - # returning -1 if the number of messages is unknown. + # @param saved_messages_topic_id [Integer] If not 0, only messages in the specified Saved Messages topic will be + # counted; pass 0 to count all messages, or for chats other than Saved Messages. + # @param return_local [Boolean] Pass true to get the number of messages without sending network requests, or -1 if + # the number of messages is unknown locally. # @return [TD::Types::Count] - def get_chat_message_count(chat_id:, filter:, return_local:) - broadcast('@type' => 'getChatMessageCount', - 'chat_id' => chat_id, - 'filter' => filter, - 'return_local' => return_local) + def get_chat_message_count(chat_id:, filter:, saved_messages_topic_id:, return_local:) + broadcast('@type' => 'getChatMessageCount', + 'chat_id' => chat_id, + 'filter' => filter, + 'saved_messages_topic_id' => saved_messages_topic_id, + 'return_local' => return_local) end - # Returns list of chats with non-default notification settings. + # Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the + # chat. + # Cannot be used in secret chats. # - # @param scope [TD::Types::NotificationSettingsScope] If specified, only chats from the specified scope will be - # returned. - # @param compare_sound [Boolean] If true, also chats with non-default sound will be returned. + # @param chat_id [Integer] Identifier of the chat in which to find message position. + # @param message_id [Integer] Message identifier. + # @param filter [TD::Types::SearchMessagesFilter] Filter for message content; searchMessagesFilterEmpty, + # searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and + # {TD::Types::SearchMessagesFilter::FailedToSend} are unsupported in this function. + # @param message_thread_id [Integer] If not 0, only messages in the specified thread will be considered; supergroups + # only. + # @param saved_messages_topic_id [Integer] If not 0, only messages in the specified Saved Messages topic will be + # considered; pass 0 to consider all relevant messages, or for chats other than Saved Messages. + # @return [TD::Types::Count] + def get_chat_message_position(chat_id:, message_id:, filter:, message_thread_id:, saved_messages_topic_id:) + broadcast('@type' => 'getChatMessagePosition', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'filter' => filter, + 'message_thread_id' => message_thread_id, + 'saved_messages_topic_id' => saved_messages_topic_id) + end + + # Returns the list of chats with non-default notification settings for new messages. + # + # @param scope [TD::Types::NotificationSettingsScope] If specified, only chats from the scope will be returned; pass + # null to return chats from all scopes. + # @param compare_sound [Boolean] Pass true to include in the response chats with only non-default sound. # @return [TD::Types::Chats] def get_chat_notification_settings_exceptions(scope:, compare_sound:) broadcast('@type' => 'getChatNotificationSettingsExceptions', @@ -1727,8 +3134,65 @@ def get_chat_pinned_message(chat_id:) 'chat_id' => chat_id) end + # Returns the list of stories that posted by the given chat to its chat page. + # If from_story_id == 0, then pinned stories are returned first. + # Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id). + # For optimal performance, the number of returned stories is chosen by TDLib. + # + # @param chat_id [Integer] Chat identifier. + # @param from_story_id [Integer] Identifier of the story starting from which stories must be returned; use 0 to get + # results from pinned and the newest story. + # @param limit [Integer] The maximum number of stories to be returned For optimal performance, the number of returned + # stories is chosen by TDLib and can be smaller than the specified limit. + # @return [TD::Types::Stories] + def get_chat_posted_to_chat_page_stories(chat_id:, from_story_id:, limit:) + broadcast('@type' => 'getChatPostedToChatPageStories', + 'chat_id' => chat_id, + 'from_story_id' => from_story_id, + 'limit' => limit) + end + + # Returns detailed revenue statistics about a chat. + # Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true. + # + # @param chat_id [Integer] Chat identifier. + # @param is_dark [Boolean] Pass true if a dark theme is used by the application. + # @return [TD::Types::ChatRevenueStatistics] + def get_chat_revenue_statistics(chat_id:, is_dark:) + broadcast('@type' => 'getChatRevenueStatistics', + 'chat_id' => chat_id, + 'is_dark' => is_dark) + end + + # Returns the list of revenue transactions for a chat. + # Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true. + # + # @param chat_id [Integer] Chat identifier. + # @param offset [Integer] Number of transactions to skip. + # @param limit [Integer] The maximum number of transactions to be returned; up to 200. + # @return [TD::Types::ChatRevenueTransactions] + def get_chat_revenue_transactions(chat_id:, offset:, limit:) + broadcast('@type' => 'getChatRevenueTransactions', + 'chat_id' => chat_id, + 'offset' => offset, + 'limit' => limit) + end + + # Returns a URL for chat revenue withdrawal; requires owner privileges in the chat. + # Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true and + # getOption("can_withdraw_chat_revenue"). + # + # @param chat_id [Integer] Chat identifier. + # @param password [TD::Types::String] The 2-step verification password of the current user. + # @return [TD::Types::HttpUrl] + def get_chat_revenue_withdrawal_url(chat_id:, password:) + broadcast('@type' => 'getChatRevenueWithdrawalUrl', + 'chat_id' => chat_id, + 'password' => password) + end + # Returns all scheduled messages in a chat. - # The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). + # The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). # # @param chat_id [Integer] Chat identifier. # @return [TD::Types::Messages] @@ -1737,9 +3201,63 @@ def get_chat_scheduled_messages(chat_id:) 'chat_id' => chat_id) end + # Returns approximate number of chats similar to the given chat. + # + # @param chat_id [Integer] Identifier of the target chat; must be an identifier of a channel chat. + # @param return_local [Boolean] Pass true to get the number of chats without sending network requests, or -1 if the + # number of chats is unknown locally. + # @return [TD::Types::Count] + def get_chat_similar_chat_count(chat_id:, return_local:) + broadcast('@type' => 'getChatSimilarChatCount', + 'chat_id' => chat_id, + 'return_local' => return_local) + end + + # Returns a list of chats similar to the given chat. + # + # @param chat_id [Integer] Identifier of the target chat; must be an identifier of a channel chat. + # @return [TD::Types::Chats] + def get_chat_similar_chats(chat_id:) + broadcast('@type' => 'getChatSimilarChats', + 'chat_id' => chat_id) + end + + # Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll + # implementation. + # Returns the results in reverse chronological order (i.e., in order of decreasing message_id). + # Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database. + # + # @param chat_id [Integer] Identifier of the chat in which to return information about message positions. + # @param filter [TD::Types::SearchMessagesFilter] Filter for message content. + # Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and + # {TD::Types::SearchMessagesFilter::UnreadReaction} are unsupported in this function. + # @param from_message_id [Integer] The message identifier from which to return information about message positions. + # @param limit [Integer] The expected number of message positions to be returned; 50-2000. + # A smaller number of positions can be returned, if there are not enough appropriate messages. + # @param saved_messages_topic_id [Integer] If not 0, only messages in the specified Saved Messages topic will be + # considered; pass 0 to consider all messages, or for chats other than Saved Messages. + # @return [TD::Types::MessagePositions] + def get_chat_sparse_message_positions(chat_id:, filter:, from_message_id:, limit:, saved_messages_topic_id:) + broadcast('@type' => 'getChatSparseMessagePositions', + 'chat_id' => chat_id, + 'filter' => filter, + 'from_message_id' => from_message_id, + 'limit' => limit, + 'saved_messages_topic_id' => saved_messages_topic_id) + end + + # Returns sponsored messages to be shown in a chat; for channel chats only. + # + # @param chat_id [Integer] Identifier of the chat. + # @return [TD::Types::SponsoredMessages] + def get_chat_sponsored_messages(chat_id:) + broadcast('@type' => 'getChatSponsoredMessages', + 'chat_id' => chat_id) + end + # Returns detailed statistics about a chat. - # Currently this method can be used only for supergroups and channels. - # Can be used only if SupergroupFullInfo.can_get_statistics == true. + # Currently, this method can be used only for supergroups and channels. + # Can be used only if supergroupFullInfo.can_get_statistics == true. # # @param chat_id [Integer] Chat identifier. # @param is_dark [Boolean] Pass true if a dark theme is used by the application. @@ -1750,38 +3268,88 @@ def get_chat_statistics(chat_id:, is_dark:) 'is_dark' => is_dark) end - # Returns an HTTP URL with the chat statistics. - # Currently this method of getting the statistics are disabled and can be deleted in the future. + # Returns interactions with a story posted in a chat. + # Can be used only if story is posted on behalf of a chat and the user is an administrator in the chat. # - # @param chat_id [Integer] Chat identifier. - # @param parameters [TD::Types::String] Parameters from "tg://statsrefresh?params=******" link. - # @param is_dark [Boolean] Pass true if a URL with the dark theme must be returned. - # @return [TD::Types::HttpUrl] - def get_chat_statistics_url(chat_id:, parameters:, is_dark:) - broadcast('@type' => 'getChatStatisticsUrl', - 'chat_id' => chat_id, - 'parameters' => parameters, - 'is_dark' => is_dark) + # @param story_sender_chat_id [Integer] The identifier of the sender of the story. + # @param story_id [Integer] Story identifier. + # @param reaction_type [TD::Types::ReactionType] Pass the default heart reaction or a suggested reaction type to + # receive only interactions with the specified reaction type; pass null to receive all interactions; + # {TD::Types::ReactionType::Paid} isn't supported. + # @param prefer_forwards [Boolean] Pass true to get forwards and reposts first, then reactions, then other views; + # pass false to get interactions sorted just by interaction date. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of story interactions to return. + # @return [TD::Types::StoryInteractions] + def get_chat_story_interactions(story_sender_chat_id:, story_id:, reaction_type:, prefer_forwards:, offset:, limit:) + broadcast('@type' => 'getChatStoryInteractions', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id, + 'reaction_type' => reaction_type, + 'prefer_forwards' => prefer_forwards, + 'offset' => offset, + 'limit' => limit) + end + + # Returns an ordered list of chats from the beginning of a chat list. + # For informational purposes only. + # Use loadChats and updates processing instead to maintain chat lists in a consistent state. + # + # @param chat_list [TD::Types::ChatList] The chat list in which to return chats; pass null to get chats from the main + # chat list. + # @param limit [Integer] The maximum number of chats to be returned. + # @return [TD::Types::Chats] + def get_chats(chat_list:, limit:) + broadcast('@type' => 'getChats', + 'chat_list' => chat_list, + 'limit' => limit) end - # Returns an ordered list of chats in a chat list. - # Chats are sorted by the pair (chat.position.order, chat.id) in descending order. - # (For example, to get a list of chats from the beginning, the offset_order should be equal to a biggest signed - # 64-bit number 9223372036854775807 == 2^63 - 1). - # For optimal performance the number of returned chats is chosen by the library. + # Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link. # - # @param chat_list [TD::Types::ChatList] The chat list in which to return chats. - # @param offset_order [Integer] Chat order to return chats from. - # @param offset_chat_id [Integer] Chat identifier to return chats from. - # @param limit [Integer] The maximum number of chats to be returned. - # It is possible that fewer chats than the limit are returned even if the end of the list is not reached. + # @param chat_folder_id [Integer] Chat folder identifier. # @return [TD::Types::Chats] - def get_chats(chat_list:, offset_order:, offset_chat_id:, limit:) - broadcast('@type' => 'getChats', - 'chat_list' => chat_list, - 'offset_order' => offset_order, - 'offset_chat_id' => offset_chat_id, - 'limit' => limit) + def get_chats_for_chat_folder_invite_link(chat_folder_id:) + broadcast('@type' => 'getChatsForChatFolderInviteLink', + 'chat_folder_id' => chat_folder_id) + end + + # Returns supergroup and channel chats in which the current user has the right to post stories. + # The chats must be rechecked with canSendStory before actually trying to post a story there. + # + # @return [TD::Types::Chats] + def get_chats_to_send_stories + broadcast('@type' => 'getChatsToSendStories') + end + + # Returns all close friends of the current user. + # + # @return [TD::Types::Users] + def get_close_friends + broadcast('@type' => 'getCloseFriends') + end + + # Returns information about a given collectible item that was purchased at https://fragment.com. + # + # @param type [TD::Types::CollectibleItemType] Type of the collectible item. + # The item must be used by a user and must be visible to the current user. + # @return [TD::Types::CollectibleItemInfo] + def get_collectible_item_info(type:) + broadcast('@type' => 'getCollectibleItemInfo', + 'type' => type) + end + + # Returns the list of commands supported by the bot for the given user scope and language; for bots only. + # + # @param scope [TD::Types::BotCommandScope] The scope to which the commands are relevant; pass null to get commands + # in the default bot command scope. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code or an empty string. + # @return [TD::Types::BotCommands] + def get_commands(scope:, language_code:) + broadcast('@type' => 'getCommands', + 'scope' => scope, + 'language_code' => language_code) end # Returns all website where the current user used Telegram to log in. @@ -1791,7 +3359,7 @@ def get_connected_websites broadcast('@type' => 'getConnectedWebsites') end - # Returns all user contacts. + # Returns all contacts of the user. # # @return [TD::Types::Users] def get_contacts @@ -1815,6 +3383,17 @@ def get_country_code broadcast('@type' => 'getCountryCode') end + # Returns an emoji for the given country. + # Returns an empty string on failure. + # Can be called synchronously. + # + # @param country_code [TD::Types::String] A two-letter ISO 3166-1 alpha-2 country code as received from getCountries. + # @return [TD::Types::Text] + def get_country_flag_emoji(country_code:) + broadcast('@type' => 'getCountryFlagEmoji', + 'country_code' => country_code) + end + # Returns a list of public chats of the specified type, owned by the user. # # @param type [TD::Types::PublicChatType] Type of the public chats to return. @@ -1825,7 +3404,7 @@ def get_created_public_chats(type:) end # Returns all updates needed to restore current TDLib state, i.e. - # all actual UpdateAuthorizationState/UpdateUser/UpdateNewChat and others. + # all actual updateAuthorizationState/updateUser/updateNewChat and others. # This is especially useful if TDLib is run in a separate process. # Can be called before initialization. # @@ -1834,6 +3413,34 @@ def get_current_state broadcast('@type' => 'getCurrentState') end + # Returns the current weather in the given location. + # + # @param location [TD::Types::Location] The location. + # @return [TD::Types::CurrentWeather] + def get_current_weather(location:) + broadcast('@type' => 'getCurrentWeather', + 'location' => location) + end + + # Returns TGS stickers with generic animations for custom emoji reactions. + # + # @return [TD::Types::Stickers] + def get_custom_emoji_reaction_animations + broadcast('@type' => 'getCustomEmojiReactionAnimations') + end + + # Returns the list of custom emoji stickers by their identifiers. + # Stickers are returned in arbitrary order. + # Only found stickers are returned. + # + # @param custom_emoji_ids [Array] Identifiers of custom emoji stickers. + # At most 200 custom emoji stickers can be received simultaneously. + # @return [TD::Types::Stickers] + def get_custom_emoji_stickers(custom_emoji_ids:) + broadcast('@type' => 'getCustomEmojiStickers', + 'custom_emoji_ids' => custom_emoji_ids) + end + # Returns database statistics. # # @return [TD::Types::DatabaseStatistics] @@ -1853,6 +3460,76 @@ def get_deep_link_info(link:) 'link' => link) end + # Returns default list of custom emoji stickers for reply background. + # + # @return [TD::Types::Stickers] + def get_default_background_custom_emoji_stickers + broadcast('@type' => 'getDefaultBackgroundCustomEmojiStickers') + end + + # Returns default emoji statuses for chats. + # + # @return [TD::Types::EmojiStatuses] + def get_default_chat_emoji_statuses + broadcast('@type' => 'getDefaultChatEmojiStatuses') + end + + # Returns default list of custom emoji stickers for placing on a chat photo. + # + # @return [TD::Types::Stickers] + def get_default_chat_photo_custom_emoji_stickers + broadcast('@type' => 'getDefaultChatPhotoCustomEmojiStickers') + end + + # Returns default emoji statuses for self status. + # + # @return [TD::Types::EmojiStatuses] + def get_default_emoji_statuses + broadcast('@type' => 'getDefaultEmojiStatuses') + end + + # Returns default message auto-delete time setting for new chats. + # + # @return [TD::Types::MessageAutoDeleteTime] + def get_default_message_auto_delete_time + broadcast('@type' => 'getDefaultMessageAutoDeleteTime') + end + + # Returns default list of custom emoji stickers for placing on a profile photo. + # + # @return [TD::Types::Stickers] + def get_default_profile_photo_custom_emoji_stickers + broadcast('@type' => 'getDefaultProfilePhotoCustomEmojiStickers') + end + + # Returns the list of emoji statuses, which can't be used as chat emoji status, even they are from a sticker set with + # is_allowed_as_chat_emoji_status == true. + # + # @return [TD::Types::EmojiStatuses] + def get_disallowed_chat_emoji_statuses + broadcast('@type' => 'getDisallowedChatEmojiStatuses') + end + + # Returns available emoji categories. + # + # @param type [TD::Types::EmojiCategoryType] Type of emoji categories to return; pass null to get default emoji + # categories. + # @return [TD::Types::EmojiCategories] + def get_emoji_categories(type:) + broadcast('@type' => 'getEmojiCategories', + 'type' => type) + end + + # Returns information about an emoji reaction. + # Returns a 404 error if the reaction is not found. + # + # @param emoji [TD::Types::String] Text representation of the reaction. + # @return [TD::Types::EmojiReaction] + def get_emoji_reaction(emoji:) + broadcast('@type' => 'getEmojiReaction', + 'emoji' => emoji) + end + # Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji # replacements. # The URL will be valid for 30 seconds after generation. @@ -1869,8 +3546,8 @@ def get_emoji_suggestions_url(language_code:) # Use the method getExternalLinkInfo to find whether a prior user confirmation is needed. # # @param link [TD::Types::String] The HTTP link. - # @param allow_write_access [Boolean] True, if the current user allowed the bot, returned in getExternalLinkInfo, to - # send them messages. + # @param allow_write_access [Boolean] Pass true if the current user allowed the bot, returned in getExternalLinkInfo, + # to send them messages. # @return [TD::Types::HttpUrl] def get_external_link(link:, allow_write_access:) broadcast('@type' => 'getExternalLink', @@ -1878,11 +3555,10 @@ def get_external_link(link:, allow_write_access:) 'allow_write_access' => allow_write_access) end - # Returns information about an action to be done when the current user clicks an HTTP link. - # This method can be used to automatically authorize the current user on a website. + # Returns information about an action to be done when the current user clicks an external link. # Don't use this method for links from secret chats if link preview is disabled in secret chats. # - # @param link [TD::Types::String] The HTTP link. + # @param link [TD::Types::String] The link. # @return [TD::Types::LoginUrlInfo] def get_external_link_info(link:) broadcast('@type' => 'getExternalLinkInfo', @@ -1905,11 +3581,11 @@ def get_file(file_id:) 'file_id' => file_id) end - # Returns file downloaded prefix size from a given offset. + # Returns file downloaded prefix size from a given offset, in bytes. # # @param file_id [Integer] Identifier of the file. - # @param offset [Integer] Offset from which downloaded prefix size should be calculated. - # @return [TD::Types::Count] + # @param offset [Integer] Offset from which downloaded prefix size needs to be calculated. + # @return [TD::Types::FileDownloadedPrefixSize] def get_file_downloaded_prefix_size(file_id:, offset:) broadcast('@type' => 'getFileDownloadedPrefixSize', 'file_id' => file_id, @@ -1938,7 +3614,62 @@ def get_file_mime_type(file_name:) 'file_name' => file_name) end - # Returns the high scores for a game and some part of the high score table in the range of the specified user; for + # Returns information about a forum topic. + # + # @param chat_id [Integer] Identifier of the chat. + # @param message_thread_id [Integer] Message thread identifier of the forum topic. + # @return [TD::Types::ForumTopic] + def get_forum_topic(chat_id:, message_thread_id:) + broadcast('@type' => 'getForumTopic', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id) + end + + # Returns the list of custom emoji, which can be used as forum topic icon by all users. + # + # @return [TD::Types::Stickers] + def get_forum_topic_default_icons + broadcast('@type' => 'getForumTopicDefaultIcons') + end + + # Returns an HTTPS link to a topic in a forum chat. + # This is an offline request. + # + # @param chat_id [Integer] Identifier of the chat. + # @param message_thread_id [Integer] Message thread identifier of the forum topic. + # @return [TD::Types::MessageLink] + def get_forum_topic_link(chat_id:, message_thread_id:) + broadcast('@type' => 'getForumTopicLink', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id) + end + + # Returns found forum topics in a forum chat. + # This is a temporary method for getting information about topic list from the server. + # + # @param chat_id [Integer] Identifier of the forum chat. + # @param query [TD::Types::String] Query to search for in the forum topic's name. + # @param offset_date [Integer] The date starting from which the results need to be fetched. + # Use 0 or any date in the future to get results from the last topic. + # @param offset_message_id [Integer] The message identifier of the last message in the last found topic, or 0 for the + # first request. + # @param offset_message_thread_id [Integer] The message thread identifier of the last found topic, or 0 for the first + # request. + # @param limit [Integer] The maximum number of forum topics to be returned; up to 100. + # For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the + # specified limit. + # @return [TD::Types::ForumTopics] + def get_forum_topics(chat_id:, query:, offset_date:, offset_message_id:, offset_message_thread_id:, limit:) + broadcast('@type' => 'getForumTopics', + 'chat_id' => chat_id, + 'query' => query, + 'offset_date' => offset_date, + 'offset_message_id' => offset_message_id, + 'offset_message_thread_id' => offset_message_thread_id, + 'limit' => limit) + end + + # Returns the high scores for a game and some part of the high score table in the range of the specified user; for # bots only. # # @param chat_id [Integer] The chat that contains the message with the game. @@ -1952,6 +3683,13 @@ def get_game_high_scores(chat_id:, message_id:, user_id:) 'user_id' => user_id) end + # Returns greeting stickers from regular sticker sets that can be used for the start page of other users. + # + # @return [TD::Types::Stickers] + def get_greeting_stickers + broadcast('@type' => 'getGreetingStickers') + end + # Returns information about a group call. # # @param group_call_id [Integer] Group call identifier. @@ -1961,11 +3699,11 @@ def get_group_call(group_call_id:) 'group_call_id' => group_call_id) end - # Returns invite link to a voice chat in a public chat. + # Returns invite link to a video chat in a public chat. # # @param group_call_id [Integer] Group call identifier. - # @param can_self_unmute [Boolean] Pass true if the invite_link should contain an invite hash, passing which to - # joinGroupCall would allow the invited user to unmute themself. + # @param can_self_unmute [Boolean] Pass true if the invite link needs to contain an invite hash, passing which to + # joinGroupCall would allow the invited user to unmute themselves. # Requires groupCall.can_be_managed group call flag. # @return [TD::Types::HttpUrl] def get_group_call_invite_link(group_call_id:, can_self_unmute:) @@ -1974,18 +3712,32 @@ def get_group_call_invite_link(group_call_id:, can_self_unmute:) 'can_self_unmute' => can_self_unmute) end - # Returns a file with a segment of a group call stream in a modified OGG format. + # Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video. # # @param group_call_id [Integer] Group call identifier. # @param time_offset [Integer] Point in time when the stream segment begins; Unix timestamp in milliseconds. # @param scale [Integer] Segment duration scale; 0-1. # Segment's duration is 1000/(2**scale) milliseconds. + # @param channel_id [Integer] Identifier of an audio/video channel to get as received from tgcalls. + # @param video_quality [TD::Types::GroupCallVideoQuality] Video quality as received from tgcalls; pass null to get + # the worst available quality. # @return [TD::Types::FilePart] - def get_group_call_stream_segment(group_call_id:, time_offset:, scale:) + def get_group_call_stream_segment(group_call_id:, time_offset:, scale:, channel_id:, video_quality:) broadcast('@type' => 'getGroupCallStreamSegment', 'group_call_id' => group_call_id, 'time_offset' => time_offset, - 'scale' => scale) + 'scale' => scale, + 'channel_id' => channel_id, + 'video_quality' => video_quality) + end + + # Returns information about available group call streams. + # + # @param group_call_id [Integer] Group call identifier. + # @return [TD::Types::GroupCallStreams] + def get_group_call_streams(group_call_id:) + broadcast('@type' => 'getGroupCallStreams', + 'group_call_id' => group_call_id) end # Returns a list of common group chats with a given user. @@ -2012,6 +3764,7 @@ def get_imported_contact_count # Returns a list of recently inactive supergroups and channels. # Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH # error. + # Also, the limit can be increased with Telegram Premium. # # @return [TD::Types::Chats] def get_inactive_supergroup_chats @@ -2032,11 +3785,13 @@ def get_inline_game_high_scores(inline_message_id:, user_id:) # Sends an inline query to a bot and returns its results. # Returns an error with code 502 if the bot fails to answer the query before the query timeout expires. # - # @param bot_user_id [Integer] The identifier of the target bot. + # @param bot_user_id [Integer] Identifier of the target bot. # @param chat_id [Integer] Identifier of the chat where the query was sent. - # @param user_location [TD::Types::Location] Location of the user, only if needed. + # @param user_location [TD::Types::Location] Location of the user; pass null if unknown or the bot doesn't need + # user's location. # @param query [TD::Types::String] Text of the query. - # @param offset [TD::Types::String] Offset of the first entry to return. + # @param offset [TD::Types::String] Offset of the first entry to return; use empty string to get the first chunk of + # results. # @return [TD::Types::InlineQueryResults] def get_inline_query_results(bot_user_id:, chat_id:, user_location:, query:, offset:) broadcast('@type' => 'getInlineQueryResults', @@ -2047,21 +3802,46 @@ def get_inline_query_results(bot_user_id:, chat_id:, user_location:, query:, off 'offset' => offset) end + # Returns backgrounds installed by the user. + # + # @param for_dark_theme [Boolean] Pass true to order returned backgrounds for a dark theme. + # @return [TD::Types::Backgrounds] + def get_installed_backgrounds(for_dark_theme:) + broadcast('@type' => 'getInstalledBackgrounds', + 'for_dark_theme' => for_dark_theme) + end + # Returns a list of installed sticker sets. # - # @param is_masks [Boolean] Pass true to return mask sticker sets; pass false to return ordinary sticker sets. + # @param sticker_type [TD::Types::StickerType] Type of the sticker sets to return. # @return [TD::Types::StickerSets] - def get_installed_sticker_sets(is_masks:) - broadcast('@type' => 'getInstalledStickerSets', - 'is_masks' => is_masks) + def get_installed_sticker_sets(sticker_type:) + broadcast('@type' => 'getInstalledStickerSets', + 'sticker_type' => sticker_type) end - # Returns the default text for invitation messages to be used as a placeholder when the current user invites friends - # to Telegram. + # Returns an HTTPS or a tg: link with the given type. + # Can be called before authorization. # - # @return [TD::Types::Text] - def get_invite_text - broadcast('@type' => 'getInviteText') + # @param type [TD::Types::InternalLinkType] Expected type of the link. + # @param is_http [Boolean] Pass true to create an HTTPS link (only available for some link types); pass false to + # create a tg: link. + # @return [TD::Types::HttpUrl] + def get_internal_link(type:, is_http:) + broadcast('@type' => 'getInternalLink', + 'type' => type, + 'is_http' => is_http) + end + + # Returns information about the type of internal link. + # Returns a 404 error if the link is not internal. + # Can be called before authorization. + # + # @param link [TD::Types::String] The link. + # @return [TD::Types::InternalLinkType] + def get_internal_link_type(link:) + broadcast('@type' => 'getInternalLinkType', + 'link' => link) end # Converts a JsonValue object to corresponding JSON-serialized string. @@ -2084,6 +3864,20 @@ def get_json_value(json:) 'json' => json) end + # Return emojis matching the keyword. + # Supported only if the file database is enabled. + # Order of results is unspecified. + # + # @param text [TD::Types::String] Text to search for. + # @param input_language_codes [Array, nil] List of possible IETF language tags of the user's input + # language; may be empty if unknown. + # @return [TD::Types::Emojis] + def get_keyword_emojis(text:, input_language_codes: nil) + broadcast('@type' => 'getKeywordEmojis', + 'text' => text, + 'input_language_codes' => input_language_codes) + end + # Returns information about a language pack. # Returned language pack identifier may be different from a provided one. # Can be called before authorization. @@ -2126,11 +3920,25 @@ def get_language_pack_strings(language_pack_id:, keys:) 'keys' => keys) end + # Returns a link preview by the text of a message. + # Do not call this function too often. + # Returns a 404 error if the text has no link preview. + # + # @param text [TD::Types::FormattedText] Message text with formatting. + # @param link_preview_options [TD::Types::LinkPreviewOptions] Options to be used for generation of the link preview; + # pass null to use default link preview options. + # @return [TD::Types::LinkPreview] + def get_link_preview(text:, link_preview_options:) + broadcast('@type' => 'getLinkPreview', + 'text' => text, + 'link_preview_options' => link_preview_options) + end + # Returns information about the current localization target. # This is an offline request if only_local is true. # Can be called before authorization. # - # @param only_local [Boolean] If true, returns only locally available information without sending network requests. + # @param only_local [Boolean] Pass true to get only locally available information without sending network requests. # @return [TD::Types::LocalizationTargetInfo] def get_localization_target_info(only_local:) broadcast('@type' => 'getLocalizationTargetInfo', @@ -2155,8 +3963,8 @@ def get_log_tag_verbosity_level(tag:) 'tag' => tag) end - # Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", - # "proxy"]. + # Returns the list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", + # "notifications", "proxy"]. # Can be called synchronously. # # @return [TD::Types::LogTags] @@ -2180,7 +3988,7 @@ def get_log_verbosity_level # @param chat_id [Integer] Chat identifier of the message with the button. # @param message_id [Integer] Message identifier of the message with the button. # @param button_id [Integer] Button identifier. - # @param allow_write_access [Boolean] True, if the user allowed the bot to send them messages. + # @param allow_write_access [Boolean] Pass true to allow the bot to send messages to the current user. # @return [TD::Types::HttpUrl] def get_login_url(chat_id:, message_id:, button_id:, allow_write_access:) broadcast('@type' => 'getLoginUrl', @@ -2195,6 +4003,7 @@ def get_login_url(chat_id:, message_id:, button_id:, allow_write_access:) # # @param chat_id [Integer] Chat identifier of the message with the button. # @param message_id [Integer] Message identifier of the message with the button. + # The message must not be scheduled. # @param button_id [Integer] Button identifier. # @return [TD::Types::LoginUrlInfo] def get_login_url_info(chat_id:, message_id:, button_id:) @@ -2204,6 +4013,24 @@ def get_login_url_info(chat_id:, message_id:, button_id:) 'button_id' => button_id) end + # Returns information needed to open the main Web App of a bot. + # + # @param chat_id [Integer] Identifier of the chat in which the Web App is opened; pass 0 if none. + # @param bot_user_id [Integer] Identifier of the target bot. + # @param start_parameter [TD::Types::String] Start parameter from internalLinkTypeMainWebApp. + # @param theme [TD::Types::ThemeParameters] Preferred Web App theme; pass null to use the default theme. + # @param application_name [TD::Types::String] Short name of the current application; 0-64 English letters, digits, + # and underscores. + # @return [TD::Types::MainWebApp] + def get_main_web_app(chat_id:, bot_user_id:, start_parameter:, theme:, application_name:) + broadcast('@type' => 'getMainWebApp', + 'chat_id' => chat_id, + 'bot_user_id' => bot_user_id, + 'start_parameter' => start_parameter, + 'theme' => theme, + 'application_name' => application_name) + end + # Returns information about a file with a map thumbnail in PNG format. # Only map thumbnail files with size less than 1MB can be downloaded. # @@ -2212,7 +4039,7 @@ def get_login_url_info(chat_id:, message_id:, button_id:) # @param width [Integer] Map width in pixels before applying scale; 16-1024. # @param height [Integer] Map height in pixels before applying scale; 16-1024. # @param scale [Integer] Map scale; 1-3. - # @param chat_id [Integer] Identifier of a chat, in which the thumbnail will be shown. + # @param chat_id [Integer] Identifier of a chat in which the thumbnail will be shown. # Use 0 if unknown. # @return [TD::Types::File] def get_map_thumbnail_file(location:, zoom:, width:, height:, scale:, chat_id:) @@ -2243,6 +4070,15 @@ def get_me broadcast('@type' => 'getMe') end + # Returns menu button set by the bot for the given user; for bots only. + # + # @param user_id [Integer] Identifier of the user or 0 to get the default menu button. + # @return [TD::Types::BotMenuButton] + def get_menu_button(user_id:) + broadcast('@type' => 'getMenuButton', + 'user_id' => user_id) + end + # Returns information about a message. # # @param chat_id [Integer] Identifier of the chat the message belongs to. @@ -2254,8 +4090,55 @@ def get_message(chat_id:, message_id:) 'message_id' => message_id) end + # Returns reactions added for a message, along with their sender. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # Use message.interaction_info.reactions.can_get_added_reactions to check whether added reactions can be received + # for the message. + # @param reaction_type [TD::Types::ReactionType] Type of the reactions to return; pass null to return all added + # reactions; {TD::Types::ReactionType::Paid} isn't supported. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of reactions to be returned; must be positive and can't be greater than + # 100. + # @return [TD::Types::AddedReactions] + def get_message_added_reactions(chat_id:, message_id:, reaction_type:, offset:, limit:) + broadcast('@type' => 'getMessageAddedReactions', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reaction_type' => reaction_type, + 'offset' => offset, + 'limit' => limit) + end + + # Returns reactions, which can be added to a message. + # The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or + # updateMessageInteractionInfo for the message. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @param row_size [Integer] Number of reaction per row, 5-25. + # @return [TD::Types::AvailableReactions] + def get_message_available_reactions(chat_id:, message_id:, row_size:) + broadcast('@type' => 'getMessageAvailableReactions', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'row_size' => row_size) + end + + # Returns information about a message effect. + # Returns a 404 error if the effect is not found. + # + # @param effect_id [Integer] Unique identifier of the effect. + # @return [TD::Types::MessageEffect] + def get_message_effect(effect_id:) + broadcast('@type' => 'getMessageEffect', + 'effect_id' => effect_id) + end + # Returns an HTML code for embedding the message. - # Available only for messages in supergroups and channels with a username. + # Available only if messageProperties.can_get_embedding_code. # # @param chat_id [Integer] Identifier of the chat to which the message belongs. # @param message_id [Integer] Identifier of the message. @@ -2268,7 +4151,7 @@ def get_message_embedding_code(chat_id:, message_id:, for_album:) 'for_album' => for_album) end - # Returns information about a file with messages exported from another app. + # Returns information about a file with messages exported from another application. # # @param message_file_head [TD::Types::String] Beginning of the message file; up to 100 first lines. # @return [TD::Types::MessageFileType] @@ -2281,7 +4164,7 @@ def get_message_file_type(message_file_head:) # # @param chat_id [Integer] Identifier of a chat to which the messages will be imported. # It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with - # can_change_info administrator right. + # can_change_info member right. # @return [TD::Types::Text] def get_message_import_confirmation_text(chat_id:) broadcast('@type' => 'getMessageImportConfirmationText', @@ -2289,34 +4172,39 @@ def get_message_import_confirmation_text(chat_id:) end # Returns an HTTPS link to a message in a chat. - # Available only for already sent messages in supergroups and channels. + # Available only if messageProperties.can_get_link, or if messageProperties.can_get_media_timestamp_links and a media + # timestamp link is generated. # This is an offline request. # # @param chat_id [Integer] Identifier of the chat to which the message belongs. # @param message_id [Integer] Identifier of the message. + # @param media_timestamp [Integer] If not 0, timestamp from which the video/audio/video note/voice note/story playing + # must start, in seconds. + # The media can be in the message content or in its link preview. # @param for_album [Boolean] Pass true to create a link for the whole media album. - # @param for_comment [Boolean] Pass true to create a link to the message as a channel post comment, or from a message - # thread. + # @param in_message_thread [Boolean] Pass true to create a link to the message as a channel post comment, in a + # message thread, or a forum topic. # @return [TD::Types::MessageLink] - def get_message_link(chat_id:, message_id:, for_album:, for_comment:) - broadcast('@type' => 'getMessageLink', - 'chat_id' => chat_id, - 'message_id' => message_id, - 'for_album' => for_album, - 'for_comment' => for_comment) + def get_message_link(chat_id:, message_id:, media_timestamp:, for_album:, in_message_thread:) + broadcast('@type' => 'getMessageLink', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'media_timestamp' => media_timestamp, + 'for_album' => for_album, + 'in_message_thread' => in_message_thread) end # Returns information about a public or private message link. + # Can be called for any internal link of the type internalLinkTypeMessage. # - # @param url [TD::Types::String] The message link in the format "https://t.me/c/...", or "tg://privatepost?...", or - # "https://t.me/username/...", or "tg://resolve?...". + # @param url [TD::Types::String] The message link. # @return [TD::Types::MessageLinkInfo] def get_message_link_info(url:) broadcast('@type' => 'getMessageLinkInfo', 'url' => url) end - # Returns information about a message, if it is available locally without sending network request. + # Returns information about a message, if it is available without sending network request. # This is an offline request. # # @param chat_id [Integer] Identifier of the chat the message belongs to. @@ -2328,17 +4216,30 @@ def get_message_locally(chat_id:, message_id:) 'message_id' => message_id) end - # Returns forwarded copies of a channel message to different public channels. - # For optimal performance the number of returned messages is chosen by the library. + # Returns properties of a message; this is an offline request. + # + # @param chat_id [Integer] Chat identifier. + # @param message_id [Integer] Identifier of the message. + # @return [TD::Types::MessageProperties] + def get_message_properties(chat_id:, message_id:) + broadcast('@type' => 'getMessageProperties', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + + # Returns forwarded copies of a channel message to different public channels and public reposts as a story. + # Can be used only if messageProperties.can_get_statistics == true. + # For optimal performance, the number of returned messages and stories is chosen by TDLib. # # @param chat_id [Integer] Chat identifier of the message. # @param message_id [Integer] Message identifier. # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use - # empty string to get first chunk of results. - # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than - # 100. - # Fewer messages may be returned than specified by the limit, even if the end of the list has not been reached. - # @return [TD::Types::FoundMessages] + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of messages and stories to be returned; must be positive and can't be + # greater than 100. + # For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::PublicForwards] def get_message_public_forwards(chat_id:, message_id:, offset:, limit:) broadcast('@type' => 'getMessagePublicForwards', 'chat_id' => chat_id, @@ -2347,8 +4248,20 @@ def get_message_public_forwards(chat_id:, message_id:, offset:, limit:) 'limit' => limit) end + # Returns read date of a recent outgoing message in a private chat. + # The method can be called if messageProperties.can_get_read_date == true. + # + # @param chat_id [Integer] Chat identifier. + # @param message_id [Integer] Identifier of the message. + # @return [TD::Types::MessageReadDate] + def get_message_read_date(chat_id:, message_id:) + broadcast('@type' => 'getMessageReadDate', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + # Returns detailed statistics about a message. - # Can be used only if Message.can_get_statistics == true. + # Can be used only if messageProperties.can_get_statistics == true. # # @param chat_id [Integer] Chat identifier. # @param message_id [Integer] Message identifier. @@ -2362,7 +4275,7 @@ def get_message_statistics(chat_id:, message_id:, is_dark:) end # Returns information about a message thread. - # Can be used only if message.can_get_message_thread == true. + # Can be used only if messageProperties.can_get_message_thread == true. # # @param chat_id [Integer] Chat identifier. # @param message_id [Integer] Identifier of the message. @@ -2374,22 +4287,22 @@ def get_message_thread(chat_id:, message_id:) end # Returns messages in a message thread of a message. - # Can be used only if message.can_get_message_thread == true. + # Can be used only if messageProperties.can_get_message_thread == true. # Message thread of a channel message is in the channel's linked supergroup. - # The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). - # For optimal performance the number of returned messages is chosen by the library. + # The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). + # For optimal performance, the number of returned messages is chosen by TDLib. # # @param chat_id [Integer] Chat identifier. # @param message_id [Integer] Message identifier, which thread history needs to be returned. # @param from_message_id [Integer] Identifier of the message starting from which history must be fetched; use 0 to # get results from the last message. - # @param offset [Integer] Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to - # get additionally some newer messages. + # @param offset [Integer] Specify 0 to get results from exactly the message from_message_id or a negative offset up + # to 99 to get additionally some newer messages. # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than # 100. # If the offset is negative, the limit must be greater than or equal to -offset. - # Fewer messages may be returned than specified by the limit, even if the end of the message thread history has not - # been reached. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. # @return [TD::Types::Messages] def get_message_thread_history(chat_id:, message_id:, from_message_id:, offset:, limit:) broadcast('@type' => 'getMessageThreadHistory', @@ -2400,6 +4313,19 @@ def get_message_thread_history(chat_id:, message_id:, from_message_id:, offset:, 'limit' => limit) end + # Returns viewers of a recent outgoing message in a basic group or a supergroup chat. + # For video notes and voice notes only users, opened content of the message, are returned. + # The method can be called if messageProperties.can_get_viewers == true. + # + # @param chat_id [Integer] Chat identifier. + # @param message_id [Integer] Identifier of the message. + # @return [TD::Types::MessageViewers] + def get_message_viewers(chat_id:, message_id:) + broadcast('@type' => 'getMessageViewers', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + # Returns information about messages. # If a message is not found, returns null on the corresponding position of the result. # @@ -2415,16 +4341,24 @@ def get_messages(chat_id:, message_ids:) # Returns network data usage statistics. # Can be called before authorization. # - # @param only_current [Boolean] If true, returns only data for the current library launch. + # @param only_current [Boolean] Pass true to get statistics only for the current library launch. # @return [TD::Types::NetworkStatistics] def get_network_statistics(only_current:) broadcast('@type' => 'getNetworkStatistics', 'only_current' => only_current) end + # Returns privacy settings for new chat creation. + # + # @return [TD::Types::NewChatPrivacySettings] + def get_new_chat_privacy_settings + broadcast('@type' => 'getNewChatPrivacySettings') + end + # Returns the value of an option by its name. # (Check the list of available options on https://core.telegram.org/tdlib/options.) Can be called before # authorization. + # Can be called synchronously for options "version" and "commit_hash". # # @param name [TD::Types::String] The name of the option. # @return [TD::Types::OptionValue] @@ -2433,12 +4367,27 @@ def get_option(name:) 'name' => name) end + # Returns sticker sets owned by the current user. + # + # @param offset_sticker_set_id [Integer] Identifier of the sticker set from which to return owned sticker sets; use 0 + # to get results from the beginning. + # @param limit [Integer] The maximum number of sticker sets to be returned; must be positive and can't be greater + # than 100. + # For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::StickerSets] + def get_owned_sticker_sets(offset_sticker_set_id:, limit:) + broadcast('@type' => 'getOwnedStickerSets', + 'offset_sticker_set_id' => offset_sticker_set_id, + 'limit' => limit) + end + # Returns a Telegram Passport authorization form for sharing data with a service. # # @param bot_user_id [Integer] User identifier of the service's bot. # @param scope [TD::Types::String] Telegram Passport element types requested by the service. - # @param public_key [TD::Types::String] Service's public_key. - # @param nonce [TD::Types::String] Authorization form nonce provided by the service. + # @param public_key [TD::Types::String] Service's public key. + # @param nonce [TD::Types::String] Unique request identifier provided by the service. # @return [TD::Types::PassportAuthorizationForm] def get_passport_authorization_form(bot_user_id:, scope:, public_key:, nonce:) broadcast('@type' => 'getPassportAuthorizationForm', @@ -2452,19 +4401,19 @@ def get_passport_authorization_form(bot_user_id:, scope:, public_key:, nonce:) # form. # Result can be received only once for each authorization form. # - # @param autorization_form_id [Integer] Authorization form identifier. - # @param password [TD::Types::String] Password of the current user. + # @param authorization_form_id [Integer] Authorization form identifier. + # @param password [TD::Types::String] The 2-step verification password of the current user. # @return [TD::Types::PassportElementsWithErrors] - def get_passport_authorization_form_available_elements(autorization_form_id:, password:) - broadcast('@type' => 'getPassportAuthorizationFormAvailableElements', - 'autorization_form_id' => autorization_form_id, - 'password' => password) + def get_passport_authorization_form_available_elements(authorization_form_id:, password:) + broadcast('@type' => 'getPassportAuthorizationFormAvailableElements', + 'authorization_form_id' => authorization_form_id, + 'password' => password) end # Returns one of the available Telegram Passport elements. # # @param type [TD::Types::PassportElementType] Telegram Passport element type. - # @param password [TD::Types::String] Password of the current user. + # @param password [TD::Types::String] The 2-step verification password of the current user. # @return [TD::Types::PassportElement] def get_passport_element(type:, password:) broadcast('@type' => 'getPassportElement', @@ -2480,22 +4429,21 @@ def get_password_state end # Returns an invoice payment form. - # This method should be called when the user presses inlineKeyboardButtonBuy. + # This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy, or wants to + # buy access to media in a messagePaidMedia message. # - # @param chat_id [Integer] Chat identifier of the Invoice message. - # @param message_id [Integer] Message identifier. - # @param theme [TD::Types::PaymentFormTheme] Preferred payment form theme. + # @param input_invoice [TD::Types::InputInvoice] The invoice. + # @param theme [TD::Types::ThemeParameters] Preferred payment form theme; pass null to use the default theme. # @return [TD::Types::PaymentForm] - def get_payment_form(chat_id:, message_id:, theme:) - broadcast('@type' => 'getPaymentForm', - 'chat_id' => chat_id, - 'message_id' => message_id, - 'theme' => theme) + def get_payment_form(input_invoice:, theme:) + broadcast('@type' => 'getPaymentForm', + 'input_invoice' => input_invoice, + 'theme' => theme) end # Returns information about a successful payment. # - # @param chat_id [Integer] Chat identifier of the PaymentSuccessful message. + # @param chat_id [Integer] Chat identifier of the {TD::Types::MessageContent::PaymentSuccessful} message. # @param message_id [Integer] Message identifier. # @return [TD::Types::PaymentReceipt] def get_payment_receipt(chat_id:, message_id:) @@ -2514,16 +4462,31 @@ def get_phone_number_info(phone_number_prefix:) 'phone_number_prefix' => phone_number_prefix) end - # Returns users voted for the specified option in a non-anonymous polls. - # For the optimal performance the number of returned users is chosen by the library. + # Returns information about a phone number by its prefix synchronously. + # getCountries must be called at least once after changing localization to the specified language if properly + # localized country information is expected. + # Can be called synchronously. + # + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code for country information localization. + # @param phone_number_prefix [TD::Types::String] The phone number prefix. + # @return [TD::Types::PhoneNumberInfo] + def get_phone_number_info_sync(language_code:, phone_number_prefix:) + broadcast('@type' => 'getPhoneNumberInfoSync', + 'language_code' => language_code, + 'phone_number_prefix' => phone_number_prefix) + end + + # Returns message senders voted for the specified option in a non-anonymous polls. + # For optimal performance, the number of returned users is chosen by TDLib. # # @param chat_id [Integer] Identifier of the chat to which the poll belongs. # @param message_id [Integer] Identifier of the message containing the poll. # @param option_id [Integer] 0-based identifier of the answer option. - # @param offset [Integer] Number of users to skip in the result; must be non-negative. - # @param limit [Integer] The maximum number of users to be returned; must be positive and can't be greater than 50. - # Fewer users may be returned than specified by the limit, even if the end of the voter list has not been reached. - # @return [TD::Types::Users] + # @param offset [Integer] Number of voters to skip in the result; must be non-negative. + # @param limit [Integer] The maximum number of voters to be returned; must be positive and can't be greater than 50. + # For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified + # limit, even if the end of the voter list has not been reached. + # @return [TD::Types::MessageSenders] def get_poll_voters(chat_id:, message_id:, option_id:, offset:, limit:) broadcast('@type' => 'getPollVoters', 'chat_id' => chat_id, @@ -2533,8 +4496,20 @@ def get_poll_voters(chat_id:, message_id:, option_id:, offset:, limit:) 'limit' => limit) end - # Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields - # in Telegram Passport personal details. + # Returns popular Web App bots. + # + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of bots to be returned; up to 100. + # @return [TD::Types::FoundUsers] + def get_popular_web_app_bots(offset:, limit:) + broadcast('@type' => 'getPopularWebAppBots', + 'offset' => offset, + 'limit' => limit) + end + + # Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in + # Telegram Passport personal details. # Returns a 404 error if unknown. # # @param country_code [TD::Types::String] A two-letter ISO 3166-1 alpha-2 country code. @@ -2544,7 +4519,71 @@ def get_preferred_country_language(country_code:) 'country_code' => country_code) end - # Returns list of proxies that are currently set up. + # Returns information about features, available to Premium users. + # + # @param source [TD::Types::PremiumSource] Source of the request; pass null if the method is called from some + # non-standard source. + # @return [TD::Types::PremiumFeatures] + def get_premium_features(source:) + broadcast('@type' => 'getPremiumFeatures', + 'source' => source) + end + + # Returns available options for Telegram Premium gift code or giveaway creation. + # + # @param boosted_chat_id [Integer] Identifier of the supergroup or channel chat, which will be automatically boosted + # by receivers of the gift codes and which is administered by the user; 0 if none. + # @return [TD::Types::PremiumGiftCodePaymentOptions] + def get_premium_gift_code_payment_options(boosted_chat_id:) + broadcast('@type' => 'getPremiumGiftCodePaymentOptions', + 'boosted_chat_id' => boosted_chat_id) + end + + # Returns information about a Telegram Premium giveaway. + # + # @param chat_id [Integer] Identifier of the channel chat which started the giveaway. + # @param message_id [Integer] Identifier of the giveaway or a giveaway winners message in the chat. + # @return [TD::Types::PremiumGiveawayInfo] + def get_premium_giveaway_info(chat_id:, message_id:) + broadcast('@type' => 'getPremiumGiveawayInfo', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + + # Returns information about a limit, increased for Premium users. + # Returns a 404 error if the limit is unknown. + # + # @param limit_type [TD::Types::PremiumLimitType] Type of the limit. + # @return [TD::Types::PremiumLimit] + def get_premium_limit(limit_type:) + broadcast('@type' => 'getPremiumLimit', + 'limit_type' => limit_type) + end + + # Returns state of Telegram Premium subscription and promotion videos for Premium features. + # + # @return [TD::Types::PremiumState] + def get_premium_state + broadcast('@type' => 'getPremiumState') + end + + # Returns examples of premium stickers for demonstration purposes. + # + # @return [TD::Types::Stickers] + def get_premium_sticker_examples + broadcast('@type' => 'getPremiumStickerExamples') + end + + # Returns premium stickers from regular sticker sets. + # + # @param limit [Integer] The maximum number of stickers to be returned; 0-100. + # @return [TD::Types::Stickers] + def get_premium_stickers(limit:) + broadcast('@type' => 'getPremiumStickers', + 'limit' => limit) + end + + # Returns the list of proxies that are currently set up. # Can be called before authorization. # # @return [TD::Types::Proxies] @@ -2574,6 +4613,20 @@ def get_push_receiver_id(payload:) 'payload' => payload) end + # Returns privacy settings for message read date. + # + # @return [TD::Types::ReadDatePrivacySettings] + def get_read_date_privacy_settings + broadcast('@type' => 'getReadDatePrivacySettings') + end + + # Returns recent emoji statuses for self status. + # + # @return [TD::Types::EmojiStatuses] + def get_recent_emoji_statuses + broadcast('@type' => 'getRecentEmojiStatuses') + end + # Returns up to 20 recently used inline bots in the order of their last usage. # # @return [TD::Types::Users] @@ -2591,6 +4644,16 @@ def get_recent_stickers(is_attached:) 'is_attached' => is_attached) end + # Returns recently opened chats; this is an offline request. + # Returns chats in the order of last opening. + # + # @param limit [Integer] The maximum number of chats to be returned. + # @return [TD::Types::Chats] + def get_recently_opened_chats(limit:) + broadcast('@type' => 'getRecentlyOpenedChats', + 'limit' => limit) + end + # Returns t.me URLs recently visited by a newly registered user. # # @param referrer [TD::Types::String] Google Play referrer to identify the user. @@ -2600,31 +4663,38 @@ def get_recently_visited_t_me_urls(referrer:) 'referrer' => referrer) end - # Returns recommended chat filters for the current user. + # Returns recommended chat folders for the current user. # - # @return [TD::Types::RecommendedChatFilters] - def get_recommended_chat_filters - broadcast('@type' => 'getRecommendedChatFilters') + # @return [TD::Types::RecommendedChatFolders] + def get_recommended_chat_folders + broadcast('@type' => 'getRecommendedChatFolders') + end + + # Returns a list of channel chats recommended to the current user. + # + # @return [TD::Types::Chats] + def get_recommended_chats + broadcast('@type' => 'getRecommendedChats') end # Returns a 2-step verification recovery email address that was previously set up. # This method can be used to verify a password provided by the user. # - # @param password [TD::Types::String] The password for the current user. + # @param password [TD::Types::String] The 2-step verification password for the current user. # @return [TD::Types::RecoveryEmailAddress] def get_recovery_email_address(password:) broadcast('@type' => 'getRecoveryEmailAddress', 'password' => password) end - # Returns information about a file by its remote ID; this is an offline request. + # Returns information about a file by its remote identifier; this is an offline request. # Can be used to register a URL as a file for further uploading, or sending as a message. # Even the request succeeds, the file can be used only if it is still accessible to the user. # For example, if the file is from a message, then the message must be not deleted and accessible to the user. # If the file database is disabled, then the corresponding object with the file must be preloaded by the application. # # @param remote_file_id [TD::Types::String] Remote identifier of the file to get. - # @param file_type [TD::Types::FileType] File type, if known. + # @param file_type [TD::Types::FileType] File type; pass null if unknown. # @return [TD::Types::File] def get_remote_file(remote_file_id:, file_type:) broadcast('@type' => 'getRemoteFile', @@ -2632,12 +4702,14 @@ def get_remote_file(remote_file_id:, file_type:) 'file_type' => file_type) end - # Returns information about a message that is replied by a given message. - # Also returns the pinned message, the game message, and the invoice message for messages of the types - # messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively. + # Returns information about a non-bundled message that is replied by a given message. + # Also, returns the pinned message, the game message, the invoice message, the message with a previously set same + # background, the giveaway message, and the topic creation message for messages of the types messagePinMessage, + # messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messagePremiumGiveawayCompleted and topic + # messages without non-bundled replied message respectively. # # @param chat_id [Integer] Identifier of the chat the message belongs to. - # @param message_id [Integer] Identifier of the message reply to which to get. + # @param message_id [Integer] Identifier of the reply message. # @return [TD::Types::Message] def get_replied_message(chat_id:, message_id:) broadcast('@type' => 'getRepliedMessage', @@ -2652,7 +4724,69 @@ def get_saved_animations broadcast('@type' => 'getSavedAnimations') end - # Returns saved order info, if any. + # Returns tags used in Saved Messages or a Saved Messages topic. + # + # @param saved_messages_topic_id [Integer] Identifier of Saved Messages topic which tags will be returned; pass 0 to + # get all Saved Messages tags. + # @return [TD::Types::SavedMessagesTags] + def get_saved_messages_tags(saved_messages_topic_id:) + broadcast('@type' => 'getSavedMessagesTags', + 'saved_messages_topic_id' => saved_messages_topic_id) + end + + # Returns messages in a Saved Messages topic. + # The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). + # + # @param saved_messages_topic_id [Integer] Identifier of Saved Messages topic which messages will be fetched. + # @param from_message_id [Integer] Identifier of the message starting from which messages must be fetched; use 0 to + # get results from the last message. + # @param offset [Integer] Specify 0 to get results from exactly the message from_message_id or a negative offset up + # to 99 to get additionally some newer messages. + # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than + # 100. + # If the offset is negative, the limit must be greater than or equal to -offset. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::Messages] + def get_saved_messages_topic_history(saved_messages_topic_id:, from_message_id:, offset:, limit:) + broadcast('@type' => 'getSavedMessagesTopicHistory', + 'saved_messages_topic_id' => saved_messages_topic_id, + 'from_message_id' => from_message_id, + 'offset' => offset, + 'limit' => limit) + end + + # Returns the last message sent in a Saved Messages topic no later than the specified date. + # + # @param saved_messages_topic_id [Integer] Identifier of Saved Messages topic which message will be returned. + # @param date [Integer] Point in time (Unix timestamp) relative to which to search for messages. + # @return [TD::Types::Message] + def get_saved_messages_topic_message_by_date(saved_messages_topic_id:, date:) + broadcast('@type' => 'getSavedMessagesTopicMessageByDate', + 'saved_messages_topic_id' => saved_messages_topic_id, + 'date' => date) + end + + # Returns saved notification sound by its identifier. + # Returns a 404 error if there is no saved notification sound with the specified identifier. + # + # @param notification_sound_id [Integer] Identifier of the notification sound. + # @return [TD::Types::NotificationSounds] + def get_saved_notification_sound(notification_sound_id:) + broadcast('@type' => 'getSavedNotificationSound', + 'notification_sound_id' => notification_sound_id) + end + + # Returns the list of saved notification sounds. + # If a sound isn't in the list, then default sound needs to be used. + # + # @return [TD::Types::NotificationSounds] + def get_saved_notification_sounds + broadcast('@type' => 'getSavedNotificationSounds') + end + + # Returns saved order information. + # Returns a 404 error if there is no saved order information. # # @return [TD::Types::OrderInfo] def get_saved_order_info @@ -2669,6 +4803,17 @@ def get_scope_notification_settings(scope:) 'scope' => scope) end + # Returns recently searched for hashtags or cashtags by their prefix. + # + # @param tag_prefix [TD::Types::String] Prefix of hashtags or cashtags to return. + # @param limit [Integer] The maximum number of items to be returned. + # @return [TD::Types::Hashtags] + def get_searched_for_tags(tag_prefix:, limit:) + broadcast('@type' => 'getSearchedForTags', + 'tag_prefix' => tag_prefix, + 'limit' => limit) + end + # Returns information about a secret chat by its identifier. # This is an offline request. # @@ -2679,6 +4824,96 @@ def get_secret_chat(secret_chat_id:) 'secret_chat_id' => secret_chat_id) end + # Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for the chat paid in the + # owned Telegram Stars. + # + # @param owner_id [TD::Types::MessageSender] Identifier of the owner of the Telegram Stars; can be identifier of an + # owned bot, or identifier of an owned channel chat. + # @return [TD::Types::HttpUrl] + def get_star_ad_account_url(owner_id:) + broadcast('@type' => 'getStarAdAccountUrl', + 'owner_id' => owner_id) + end + + # Returns available options for Telegram Stars gifting. + # + # @param user_id [Integer] Identifier of the user that will receive Telegram Stars; pass 0 to get options for an + # unspecified user. + # @return [TD::Types::StarPaymentOptions] + def get_star_gift_payment_options(user_id:) + broadcast('@type' => 'getStarGiftPaymentOptions', + 'user_id' => user_id) + end + + # Returns available options for Telegram Stars purchase. + # + # @return [TD::Types::StarPaymentOptions] + def get_star_payment_options + broadcast('@type' => 'getStarPaymentOptions') + end + + # Returns detailed Telegram Star revenue statistics. + # + # @param owner_id [TD::Types::MessageSender] Identifier of the owner of the Telegram Stars; can be identifier of an + # owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true. + # @param is_dark [Boolean] Pass true if a dark theme is used by the application. + # @return [TD::Types::StarRevenueStatistics] + def get_star_revenue_statistics(owner_id:, is_dark:) + broadcast('@type' => 'getStarRevenueStatistics', + 'owner_id' => owner_id, + 'is_dark' => is_dark) + end + + # Returns the list of Telegram Star subscriptions for the current user. + # + # @param only_expiring [Boolean] Pass true to receive only expiring subscriptions for which there are no enough + # Telegram Stars to extend. + # @param offset [TD::Types::String] Offset of the first subscription to return as received from the previous request; + # use empty string to get the first chunk of results. + # @return [TD::Types::StarSubscriptions] + def get_star_subscriptions(only_expiring:, offset:) + broadcast('@type' => 'getStarSubscriptions', + 'only_expiring' => only_expiring, + 'offset' => offset) + end + + # Returns the list of Telegram Star transactions for the specified owner. + # + # @param owner_id [TD::Types::MessageSender] Identifier of the owner of the Telegram Stars; can be the identifier of + # the current user, identifier of an owned bot, or identifier of a channel chat with + # supergroupFullInfo.can_get_star_revenue_statistics == true. + # @param subscription_id [TD::Types::String] If non-empty, only transactions related to the Star Subscription will be + # returned. + # @param direction [TD::Types::StarTransactionDirection] Direction of the transactions to receive; pass null to get + # all transactions. + # @param offset [TD::Types::String] Offset of the first transaction to return as received from the previous request; + # use empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of transactions to return. + # @return [TD::Types::StarTransactions] + def get_star_transactions(owner_id:, subscription_id:, direction:, offset:, limit:) + broadcast('@type' => 'getStarTransactions', + 'owner_id' => owner_id, + 'subscription_id' => subscription_id, + 'direction' => direction, + 'offset' => offset, + 'limit' => limit) + end + + # Returns a URL for Telegram Star withdrawal. + # + # @param owner_id [TD::Types::MessageSender] Identifier of the owner of the Telegram Stars; can be identifier of an + # owned bot, or identifier of an owned channel chat. + # @param star_count [Integer] The number of Telegram Stars to withdraw. + # Must be at least getOption("star_withdrawal_count_min"). + # @param password [TD::Types::String] The 2-step verification password of the current user. + # @return [TD::Types::HttpUrl] + def get_star_withdrawal_url(owner_id:, star_count:, password:) + broadcast('@type' => 'getStarWithdrawalUrl', + 'owner_id' => owner_id, + 'star_count' => star_count, + 'password' => password) + end + # Loads an asynchronous or a zoomed in statistical graph. # # @param chat_id [Integer] Chat identifier. @@ -2712,24 +4947,30 @@ def get_sticker_set(set_id:) 'set_id' => set_id) end - # Returns stickers from the installed sticker sets that correspond to a given emoji. - # If the emoji is not empty, favorite and recently used stickers may also be returned. + # Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by + # sticker-specific keywords. + # If the query is non-empty, then favorite, recently used or trending stickers may also be returned. # - # @param emoji [TD::Types::String] String representation of emoji. + # @param sticker_type [TD::Types::StickerType] Type of the stickers to return. + # @param query [TD::Types::String, nil] Search query; a space-separated list of emojis or a keyword prefix. # If empty, returns all known installed stickers. # @param limit [Integer] The maximum number of stickers to be returned. + # @param chat_id [Integer] Chat identifier for which to return stickers. + # Available custom emoji stickers may be different for different chats. # @return [TD::Types::Stickers] - def get_stickers(emoji:, limit:) - broadcast('@type' => 'getStickers', - 'emoji' => emoji, - 'limit' => limit) + def get_stickers(sticker_type:, query: nil, limit:, chat_id:) + broadcast('@type' => 'getStickers', + 'sticker_type' => sticker_type, + 'query' => query, + 'limit' => limit, + 'chat_id' => chat_id) end # Returns storage usage statistics. # Can be called before authorization. # # @param chat_limit [Integer] The maximum number of chats with the largest storage usage for which separate - # statistics should be returned. + # statistics need to be returned. # All other chats will be grouped in entries with chat_id == 0. # If the chat info database is not used, the chat_limit is ignored and is always set to 0. # @return [TD::Types::StorageStatistics] @@ -2746,24 +4987,144 @@ def get_storage_statistics_fast broadcast('@type' => 'getStorageStatisticsFast') end - # Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. - # Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. - # To set a returned supergroup as a discussion group, access to its old messages must be enabled using - # toggleSupergroupIsAllHistoryAvailable first. + # Returns a story. # - # @return [TD::Types::Chats] - def get_suitable_discussion_chats - broadcast('@type' => 'getSuitableDiscussionChats') + # @param story_sender_chat_id [Integer] Identifier of the chat that posted the story. + # @param story_id [Integer] Story identifier. + # @param only_local [Boolean] Pass true to get only locally available information without sending network requests. + # @return [TD::Types::Story] + def get_story(story_sender_chat_id:, story_id:, only_local:) + broadcast('@type' => 'getStory', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id, + 'only_local' => only_local) end - # Returns information about a supergroup or a channel by its identifier. - # This is an offline request if the current user is not a bot. + # Returns reactions, which can be chosen for a story. # - # @param supergroup_id [Integer] Supergroup or channel identifier. - # @return [TD::Types::Supergroup] - def get_supergroup(supergroup_id:) - broadcast('@type' => 'getSupergroup', - 'supergroup_id' => supergroup_id) + # @param row_size [Integer] Number of reaction per row, 5-25. + # @return [TD::Types::AvailableReactions] + def get_story_available_reactions(row_size:) + broadcast('@type' => 'getStoryAvailableReactions', + 'row_size' => row_size) + end + + # Returns interactions with a story. + # The method can be called only for stories posted on behalf of the current user. + # + # @param story_id [Integer] Story identifier. + # @param query [TD::Types::String, nil] Query to search for in names, usernames and titles; may be empty to get all + # relevant interactions. + # @param only_contacts [Boolean] Pass true to get only interactions by contacts; pass false to get all relevant + # interactions. + # @param prefer_forwards [Boolean] Pass true to get forwards and reposts first, then reactions, then other views; + # pass false to get interactions sorted just by interaction date. + # @param prefer_with_reaction [Boolean] Pass true to get interactions with reaction first; pass false to get + # interactions sorted just by interaction date. + # Ignored if prefer_forwards == true. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of story interactions to return. + # @return [TD::Types::StoryInteractions] + def get_story_interactions(story_id:, query: nil, only_contacts:, prefer_forwards:, prefer_with_reaction:, offset:, + limit:) + broadcast('@type' => 'getStoryInteractions', + 'story_id' => story_id, + 'query' => query, + 'only_contacts' => only_contacts, + 'prefer_forwards' => prefer_forwards, + 'prefer_with_reaction' => prefer_with_reaction, + 'offset' => offset, + 'limit' => limit) + end + + # Returns the list of chats with non-default notification settings for stories. + # + # @return [TD::Types::Chats] + def get_story_notification_settings_exceptions + broadcast('@type' => 'getStoryNotificationSettingsExceptions') + end + + # Returns forwards of a story as a message to public chats and reposts by public channels. + # Can be used only if the story is posted on behalf of the current user or story.can_get_statistics == true. + # For optimal performance, the number of returned messages and stories is chosen by TDLib. + # + # @param story_sender_chat_id [Integer] The identifier of the sender of the story. + # @param story_id [Integer] The identifier of the story. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of messages and stories to be returned; must be positive and can't be + # greater than 100. + # For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::PublicForwards] + def get_story_public_forwards(story_sender_chat_id:, story_id:, offset:, limit:) + broadcast('@type' => 'getStoryPublicForwards', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id, + 'offset' => offset, + 'limit' => limit) + end + + # Returns detailed statistics about a story. + # Can be used only if story.can_get_statistics == true. + # + # @param chat_id [Integer] Chat identifier. + # @param story_id [Integer] Story identifier. + # @param is_dark [Boolean] Pass true if a dark theme is used by the application. + # @return [TD::Types::StoryStatistics] + def get_story_statistics(chat_id:, story_id:, is_dark:) + broadcast('@type' => 'getStoryStatistics', + 'chat_id' => chat_id, + 'story_id' => story_id, + 'is_dark' => is_dark) + end + + # Returns suggested name for saving a file in a given directory. + # + # @param file_id [Integer] Identifier of the file. + # @param directory [TD::Types::String] Directory in which the file is supposed to be saved. + # @return [TD::Types::Text] + def get_suggested_file_name(file_id:, directory:) + broadcast('@type' => 'getSuggestedFileName', + 'file_id' => file_id, + 'directory' => directory) + end + + # Returns a suggested name for a new sticker set with a given title. + # + # @param title [TD::Types::String] Sticker set title; 1-64 characters. + # @return [TD::Types::Text] + def get_suggested_sticker_set_name(title:) + broadcast('@type' => 'getSuggestedStickerSetName', + 'title' => title) + end + + # Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. + # Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. + # To set a returned supergroup as a discussion group, access to its old messages must be enabled using + # toggleSupergroupIsAllHistoryAvailable first. + # + # @return [TD::Types::Chats] + def get_suitable_discussion_chats + broadcast('@type' => 'getSuitableDiscussionChats') + end + + # Returns a list of channel chats, which can be used as a personal chat. + # + # @return [TD::Types::Chats] + def get_suitable_personal_chats + broadcast('@type' => 'getSuitablePersonalChats') + end + + # Returns information about a supergroup or a channel by its identifier. + # This is an offline request if the current user is not a bot. + # + # @param supergroup_id [Integer] Supergroup or channel identifier. + # @return [TD::Types::Supergroup] + def get_supergroup(supergroup_id:) + broadcast('@type' => 'getSupergroup', + 'supergroup_id' => supergroup_id) end # Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute. @@ -2776,14 +5137,14 @@ def get_supergroup_full_info(supergroup_id:) end # Returns information about members or banned users in a supergroup or channel. - # Can be used only if SupergroupFullInfo.can_get_members == true; additionally, administrator privileges may be + # Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be # required for some filters. # # @param supergroup_id [Integer] Identifier of the supergroup or channel. - # @param filter [TD::Types::SupergroupMembersFilter] The type of users to return. - # By default, supergroupMembersFilterRecent. + # @param filter [TD::Types::SupergroupMembersFilter] The type of users to return; pass null to use + # supergroupMembersFilterRecent. # @param offset [Integer] Number of users to skip. - # @param limit [Integer] The maximum number of users be returned; up to 200. + # @param limit [Integer] The maximum number of users to be returned; up to 200. # @return [TD::Types::ChatMembers] def get_supergroup_members(supergroup_id:, filter:, offset:, limit:) broadcast('@type' => 'getSupergroupMembers', @@ -2793,6 +5154,13 @@ def get_supergroup_members(supergroup_id:, filter:, offset:, limit:) 'limit' => limit) end + # Returns localized name of the Telegram support user; for Telegram support only. + # + # @return [TD::Types::Text] + def get_support_name + broadcast('@type' => 'getSupportName') + end + # Returns a user that can be contacted to get support. # # @return [TD::Types::User] @@ -2808,18 +5176,49 @@ def get_temporary_password_state end # Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) - # contained in the text. + # found in the text. # Can be called synchronously. # - # @param text [TD::Types::String] The text in which to look for entites. + # @param text [TD::Types::String] The text in which to look for entities. # @return [TD::Types::TextEntities] def get_text_entities(text:) broadcast('@type' => 'getTextEntities', 'text' => text) end + # Converts a themeParameters object to corresponding JSON-serialized string. + # Can be called synchronously. + # + # @param theme [TD::Types::ThemeParameters] Theme parameters to convert to JSON. + # @return [TD::Types::Text] + def get_theme_parameters_json_string(theme:) + broadcast('@type' => 'getThemeParametersJsonString', + 'theme' => theme) + end + + # Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats. + # + # @return [TD::Types::EmojiStatuses] + def get_themed_chat_emoji_statuses + broadcast('@type' => 'getThemedChatEmojiStatuses') + end + + # Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list + # for self status. + # + # @return [TD::Types::EmojiStatuses] + def get_themed_emoji_statuses + broadcast('@type' => 'getThemedEmojiStatuses') + end + + # Returns the list of supported time zones. + # + # @return [TD::Types::TimeZones] + def get_time_zones + broadcast('@type' => 'getTimeZones') + end + # Returns a list of frequently used chats. - # Supported only if the chat info database is enabled. # # @param category [TD::Types::TopChatCategory] Category of chats to be returned. # @param limit [Integer] The maximum number of chats to be returned; up to 30. @@ -2831,16 +5230,19 @@ def get_top_chats(category:, limit:) end # Returns a list of trending sticker sets. - # For the optimal performance the number of returned sticker sets is chosen by the library. + # For optimal performance, the number of returned sticker sets is chosen by TDLib. # + # @param sticker_type [TD::Types::StickerType] Type of the sticker sets to return. # @param offset [Integer] The offset from which to return the sticker sets; must be non-negative. - # @param limit [Integer] The maximum number of sticker sets to be returned; must be non-negative. - # Fewer sticker sets may be returned than specified by the limit, even if the end of the list has not been reached. - # @return [TD::Types::StickerSets] - def get_trending_sticker_sets(offset:, limit:) - broadcast('@type' => 'getTrendingStickerSets', - 'offset' => offset, - 'limit' => limit) + # @param limit [Integer] The maximum number of sticker sets to be returned; up to 100. + # For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the + # specified limit, even if the end of the list has not been reached. + # @return [TD::Types::TrendingStickerSets] + def get_trending_sticker_sets(sticker_type:, offset:, limit:) + broadcast('@type' => 'getTrendingStickerSets', + 'sticker_type' => sticker_type, + 'offset' => offset, + 'limit' => limit) end # Returns information about a user by their identifier. @@ -2853,6 +5255,18 @@ def get_user(user_id:) 'user_id' => user_id) end + # Returns the list of boosts applied to a chat by a given user; requires administrator rights in the chat; for bots + # only. + # + # @param chat_id [Integer] Identifier of the chat. + # @param user_id [Integer] Identifier of the user. + # @return [TD::Types::FoundChatBoosts] + def get_user_chat_boosts(chat_id:, user_id:) + broadcast('@type' => 'getUserChatBoosts', + 'chat_id' => chat_id, + 'user_id' => user_id) + end + # Returns full information about a user by their identifier. # # @param user_id [Integer] User identifier. @@ -2862,6 +5276,13 @@ def get_user_full_info(user_id:) 'user_id' => user_id) end + # Returns an HTTPS link, which can be used to get information about the current user. + # + # @return [TD::Types::UserLink] + def get_user_link + broadcast('@type' => 'getUserLink') + end + # Returns the current privacy settings. # # @param setting [TD::Types::UserPrivacySetting] The privacy setting. @@ -2872,7 +5293,7 @@ def get_user_privacy_setting_rules(setting:) end # Returns the profile photos of a user. - # The result of this query may be outdated: some photos might have been deleted already. + # Personal and public photo aren't returned. # # @param user_id [Integer] User identifier. # @param offset [Integer] The number of photos to skip; must be non-negative. @@ -2885,20 +5306,79 @@ def get_user_profile_photos(user_id:, offset:, limit:) 'limit' => limit) end - # Returns list of participant identifiers, which can be used to join voice chats in a chat. + # Returns support information for the given user; for Telegram support only. + # + # @param user_id [Integer] User identifier. + # @return [TD::Types::UserSupportInfo] + def get_user_support_info(user_id:) + broadcast('@type' => 'getUserSupportInfo', + 'user_id' => user_id) + end + + # Returns the list of participant identifiers, on whose behalf a video chat in the chat can be joined. # # @param chat_id [Integer] Chat identifier. # @return [TD::Types::MessageSenders] - def get_voice_chat_available_participants(chat_id:) - broadcast('@type' => 'getVoiceChatAvailableParticipants', + def get_video_chat_available_participants(chat_id:) + broadcast('@type' => 'getVideoChatAvailableParticipants', + 'chat_id' => chat_id) + end + + # Returns RTMP URL for streaming to the chat; requires owner privileges. + # + # @param chat_id [Integer] Chat identifier. + # @return [TD::Types::RtmpUrl] + def get_video_chat_rtmp_url(chat_id:) + broadcast('@type' => 'getVideoChatRtmpUrl', 'chat_id' => chat_id) end + # Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked. + # + # @param chat_id [Integer] Identifier of the chat in which the link was clicked; pass 0 if none. + # @param bot_user_id [Integer] Identifier of the target bot. + # @param web_app_short_name [TD::Types::String] Short name of the Web App. + # @param start_parameter [TD::Types::String] Start parameter from internalLinkTypeWebApp. + # @param theme [TD::Types::ThemeParameters] Preferred Web App theme; pass null to use the default theme. + # @param application_name [TD::Types::String] Short name of the current application; 0-64 English letters, digits, + # and underscores. + # @param allow_write_access [Boolean] Pass true if the current user allowed the bot to send them messages. + # @return [TD::Types::HttpUrl] + def get_web_app_link_url(chat_id:, bot_user_id:, web_app_short_name:, start_parameter:, theme:, application_name:, + allow_write_access:) + broadcast('@type' => 'getWebAppLinkUrl', + 'chat_id' => chat_id, + 'bot_user_id' => bot_user_id, + 'web_app_short_name' => web_app_short_name, + 'start_parameter' => start_parameter, + 'theme' => theme, + 'application_name' => application_name, + 'allow_write_access' => allow_write_access) + end + + # Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an + # inlineQueryResultsButtonTypeWebApp button. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param url [TD::Types::String] The URL from a {TD::Types::KeyboardButtonType::WebApp} button, + # {TD::Types::InlineQueryResultsButtonType::WebApp} button, or an empty string when the bot is opened from the side menu. + # @param theme [TD::Types::ThemeParameters] Preferred Web App theme; pass null to use the default theme. + # @param application_name [TD::Types::String] Short name of the current application; 0-64 English letters, digits, + # and underscores. + # @return [TD::Types::HttpUrl] + def get_web_app_url(bot_user_id:, url:, theme:, application_name:) + broadcast('@type' => 'getWebAppUrl', + 'bot_user_id' => bot_user_id, + 'url' => url, + 'theme' => theme, + 'application_name' => application_name) + end + # Returns an instant view version of a web page if available. # Returns a 404 error if the web page has no instant view page. # # @param url [TD::Types::String] The web page URL. - # @param force_full [Boolean] If true, the full instant view for the web page will be returned. + # @param force_full [Boolean] Pass true to get full instant view for the web page. # @return [TD::Types::WebPageInstantView] def get_web_page_instant_view(url:, force_full:) broadcast('@type' => 'getWebPageInstantView', @@ -2906,15 +5386,11 @@ def get_web_page_instant_view(url:, force_full:) 'force_full' => force_full) end - # Returns a web page preview by the text of the message. - # Do not call this function too often. - # Returns a 404 error if the web page has no preview. + # Hides the list of contacts that have close birthdays for 24 hours. # - # @param text [TD::Types::FormattedText] Message text with formatting. - # @return [TD::Types::WebPage] - def get_web_page_preview(text:) - broadcast('@type' => 'getWebPagePreview', - 'text' => text) + # @return [TD::Types::Ok] + def hide_contact_close_birthdays + broadcast('@type' => 'hideContactCloseBirthdays') end # Hides a suggested action. @@ -2940,7 +5416,7 @@ def import_contacts(contacts:) # # @param chat_id [Integer] Identifier of a chat to which the messages will be imported. # It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with - # can_change_info administrator right. + # can_change_info member right. # @param message_file [TD::Types::InputFile] File with messages to import. # Only {TD::Types::InputFile::Local} and {TD::Types::InputFile::Generated} are supported. # The file must not be previously uploaded. @@ -2956,7 +5432,7 @@ def import_messages(chat_id:, message_file:, attached_files:) end # Invites users to an active group call. - # Sends a service message of type messageInviteToGroupCall for voice chats. + # Sends a service message of type messageInviteVideoChatParticipants for video chats. # # @param group_call_id [Integer] Group call identifier. # @param user_ids [Array] User identifiers. @@ -2970,6 +5446,7 @@ def invite_group_call_participants(group_call_id:, user_ids:) # Adds the current user as a new member to a chat. # Private and secret chats can't be joined using this method. + # May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created. # # @param chat_id [Integer] Chat identifier. # @return [TD::Types::Ok] @@ -2979,9 +5456,9 @@ def join_chat(chat_id:) end # Uses an invite link to add the current user to the chat if possible. + # May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created. # - # @param invite_link [TD::Types::String] Invite link to import; must have URL "t.me", "telegram.me", or - # "telegram.dog" and query beginning with "/joinchat/" or "/+". + # @param invite_link [TD::Types::String] Invite link to use. # @return [TD::Types::Chat] def join_chat_by_invite_link(invite_link:) broadcast('@type' => 'joinChatByInviteLink', @@ -2989,24 +5466,39 @@ def join_chat_by_invite_link(invite_link:) end # Joins an active group call. + # Returns join response payload for tgcalls. # # @param group_call_id [Integer] Group call identifier. # @param participant_id [TD::Types::MessageSender] Identifier of a group call participant, which will be used to join - # the call; voice chats only. - # @param payload [TD::Types::GroupCallPayload] Group join payload; received from tgcalls. - # @param source [Integer] Caller synchronization source identifier; received from tgcalls. - # @param is_muted [Boolean] True, if the user's microphone is muted. + # the call; pass null to join as self; video chats only. + # @param audio_source_id [Integer] Caller audio channel synchronization source identifier; received from tgcalls. + # @param payload [TD::Types::String] Group call join payload; received from tgcalls. + # @param is_muted [Boolean] Pass true to join the call with muted microphone. + # @param is_my_video_enabled [Boolean] Pass true if the user's video is enabled. # @param invite_hash [TD::Types::String] If non-empty, invite hash to be used to join the group call without being # muted by administrators. - # @return [TD::Types::GroupCallJoinResponse] - def join_group_call(group_call_id:, participant_id:, payload:, source:, is_muted:, invite_hash:) - broadcast('@type' => 'joinGroupCall', - 'group_call_id' => group_call_id, - 'participant_id' => participant_id, - 'payload' => payload, - 'source' => source, - 'is_muted' => is_muted, - 'invite_hash' => invite_hash) + # @return [TD::Types::Text] + def join_group_call(group_call_id:, participant_id:, audio_source_id:, payload:, is_muted:, is_my_video_enabled:, + invite_hash:) + broadcast('@type' => 'joinGroupCall', + 'group_call_id' => group_call_id, + 'participant_id' => participant_id, + 'audio_source_id' => audio_source_id, + 'payload' => payload, + 'is_muted' => is_muted, + 'is_my_video_enabled' => is_my_video_enabled, + 'invite_hash' => invite_hash) + end + + # Launches a prepaid Telegram Premium giveaway. + # + # @param giveaway_id [Integer] Unique identifier of the prepaid giveaway. + # @param parameters [TD::Types::PremiumGiveawayParameters] Giveaway parameters. + # @return [TD::Types::Ok] + def launch_prepaid_premium_giveaway(giveaway_id:, parameters:) + broadcast('@type' => 'launchPrepaidPremiumGiveaway', + 'giveaway_id' => giveaway_id, + 'parameters' => parameters) end # Removes the current user from chat members. @@ -3028,13 +5520,43 @@ def leave_group_call(group_call_id:) 'group_call_id' => group_call_id) end + # Loads more active stories from a story list. + # The loaded stories will be sent through updates. + # Active stories are sorted by the pair (active_stories.order, active_stories.story_sender_chat_id) in descending + # order. + # Returns a 404 error if all active stories have been loaded. + # + # @param story_list [TD::Types::StoryList] The story list in which to load active stories. + # @return [TD::Types::Ok] + def load_active_stories(story_list:) + broadcast('@type' => 'loadActiveStories', + 'story_list' => story_list) + end + + # Loads more chats from a chat list. + # The loaded chats and their positions in the chat list will be sent through updates. + # Chats are sorted by the pair (chat.position.order, chat.id) in descending order. + # Returns a 404 error if all chats have been loaded. + # + # @param chat_list [TD::Types::ChatList] The chat list in which to load chats; pass null to load chats from the main + # chat list. + # @param limit [Integer] The maximum number of chats to be loaded. + # For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified + # limit, even if the end of the list is not reached. + # @return [TD::Types::Ok] + def load_chats(chat_list:, limit:) + broadcast('@type' => 'loadChats', + 'chat_list' => chat_list, + 'limit' => limit) + end + # Loads more participants of a group call. # The loaded participants will be received through updates. - # Use the field groupCall.loaded_all_participants to check whether all participants has already been loaded. + # Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded. # # @param group_call_id [Integer] Group call identifier. # The group call must be previously received through getGroupCall and must be joined or being joined. - # @param limit [Integer] The maximum number of participants to load. + # @param limit [Integer] The maximum number of participants to load; up to 100. # @return [TD::Types::Ok] def load_group_call_participants(group_call_id:, limit:) broadcast('@type' => 'loadGroupCallParticipants', @@ -3042,6 +5564,38 @@ def load_group_call_participants(group_call_id:, limit:) 'limit' => limit) end + # Loads quick reply messages that can be sent by a given quick reply shortcut. + # The loaded messages will be sent through updateQuickReplyShortcutMessages. + # + # @param shortcut_id [Integer] Unique identifier of the quick reply shortcut. + # @return [TD::Types::Ok] + def load_quick_reply_shortcut_messages(shortcut_id:) + broadcast('@type' => 'loadQuickReplyShortcutMessages', + 'shortcut_id' => shortcut_id) + end + + # Loads quick reply shortcuts created by the current user. + # The loaded topics will be sent through updateQuickReplyShortcuts. + # + # @return [TD::Types::Ok] + def load_quick_reply_shortcuts + broadcast('@type' => 'loadQuickReplyShortcuts') + end + + # Loads more Saved Messages topics. + # The loaded topics will be sent through updateSavedMessagesTopic. + # Topics are sorted by their topic.order in descending order. + # Returns a 404 error if all topics have been loaded. + # + # @param limit [Integer] The maximum number of topics to be loaded. + # For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified + # limit, even if the end of the list is not reached. + # @return [TD::Types::Ok] + def load_saved_messages_topics(limit:) + broadcast('@type' => 'loadSavedMessagesTopics', + 'limit' => limit) + end + # Closes the TDLib instance after a proper logout. # Requires an available network connection. # All local data will be destroyed. @@ -3063,6 +5617,18 @@ def open_chat(chat_id:) 'chat_id' => chat_id) end + # Informs TDLib that a chat was opened from the list of similar chats. + # The method is independent of openChat and closeChat methods. + # + # @param chat_id [Integer] Identifier of the original chat, which similar chats were requested. + # @param opened_chat_id [Integer] Identifier of the opened chat. + # @return [TD::Types::Ok] + def open_chat_similar_chat(chat_id:, opened_chat_id:) + broadcast('@type' => 'openChatSimilarChat', + 'chat_id' => chat_id, + 'opened_chat_id' => opened_chat_id) + end + # Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, # location or venue, or has listened to an audio file or voice note message). # An updateMessageContentOpened update will be generated if something has changed. @@ -3076,25 +5642,64 @@ def open_message_content(chat_id:, message_id:) 'message_id' => message_id) end + # Informs TDLib that a story is opened and is being viewed by the user. + # + # @param story_sender_chat_id [Integer] The identifier of the sender of the opened story. + # @param story_id [Integer] The identifier of the story. + # @return [TD::Types::Ok] + def open_story(story_sender_chat_id:, story_id:) + broadcast('@type' => 'openStory', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id) + end + + # Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an + # internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. + # For each bot, a confirmation alert about data sent to the bot must be shown once. + # + # @param chat_id [Integer] Identifier of the chat in which the Web App is opened. + # The Web App can't be opened in secret chats. + # @param bot_user_id [Integer] Identifier of the bot, providing the Web App. + # @param url [TD::Types::String] The URL from an {TD::Types::InlineKeyboardButtonType::WebApp} button, a + # {TD::Types::BotMenuButton} button, an {TD::Types::InternalLinkType::AttachmentMenuBot} link, or an empty string + # otherwise. + # @param theme [TD::Types::ThemeParameters] Preferred Web App theme; pass null to use the default theme. + # @param application_name [TD::Types::String] Short name of the current application; 0-64 English letters, digits, + # and underscores. + # @param message_thread_id [Integer] If not 0, the message thread identifier in which the message will be sent. + # @param reply_to [TD::Types::InputMessageReplyTo] Information about the message or story to be replied in the + # message sent by the Web App; pass null if none. + # @return [TD::Types::WebAppInfo] + def open_web_app(chat_id:, bot_user_id:, url:, theme:, application_name:, message_thread_id:, reply_to:) + broadcast('@type' => 'openWebApp', + 'chat_id' => chat_id, + 'bot_user_id' => bot_user_id, + 'url' => url, + 'theme' => theme, + 'application_name' => application_name, + 'message_thread_id' => message_thread_id, + 'reply_to' => reply_to) + end + # Optimizes storage usage, i.e. # deletes some files and returns new storage usage statistics. # Secret thumbnails can't be deleted. # - # @param size [Integer] Limit on the total size of files after deletion. + # @param size [Integer] Limit on the total size of files after deletion, in bytes. # Pass -1 to use the default limit. # @param ttl [Integer] Limit on the time that has passed since the last time a file was accessed (or creation time # for some filesystems). # Pass -1 to use the default limit. - # @param count [Integer] Limit on the total count of files after deletion. + # @param count [Integer] Limit on the total number of files after deletion. # Pass -1 to use the default limit. # @param immunity_delay [Integer] The amount of time after the creation of a file during which it can't be deleted, # in seconds. # Pass -1 to use the default value. - # @param file_types [Array] If not empty, only files with the given type(s) are considered. + # @param file_types [Array] If non-empty, only files with the given types are considered. # By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted. - # @param chat_ids [Array] If not empty, only files from the given chats are considered. + # @param chat_ids [Array] If non-empty, only files from the given chats are considered. # Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos). - # @param exclude_chat_ids [Array] If not empty, files from the given chats are excluded. + # @param exclude_chat_ids [Array] If non-empty, files from the given chats are excluded. # Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos). # @param return_deleted_file_statistics [Boolean] Pass true if statistics about the files that were deleted must be # returned instead of the whole storage usage statistics. @@ -3120,16 +5725,16 @@ def optimize_storage(size:, ttl:, count:, immunity_delay:, file_types:, chat_ids # Can be called synchronously. # # @param text [TD::Types::FormattedText] The text to parse. - # For example, "__italic__ ~~strikethrough~~ **bold** `code` ```pre``` __[italic__ text_url](telegram.org) - # __italic**bold italic__bold**". + # For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ + # text_url](telegram.org) __italic**bold italic__bold**". # @return [TD::Types::FormattedText] def parse_markdown(text:) broadcast('@type' => 'parseMarkdown', 'text' => text) end - # Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in - # the text. + # Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, + # PreCode, TextUrl and MentionName entities from a marked-up text. # Can be called synchronously. # # @param text [TD::Types::String] The text to parse. @@ -3141,13 +5746,14 @@ def parse_text_entities(text:, parse_mode:) 'parse_mode' => parse_mode) end - # Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel. + # Pins a message in a chat. + # A message can be pinned only if messageProperties.can_be_pinned. # # @param chat_id [Integer] Identifier of the chat. # @param message_id [Integer] Identifier of the new pinned message. - # @param disable_notification [Boolean] True, if there should be no notification about the pinned message. + # @param disable_notification [Boolean] Pass true to disable notification about the pinned message. # Notifications are always disabled in channels and private chats. - # @param only_for_self [Boolean] True, if the message needs to be pinned for one side only; private chats only. + # @param only_for_self [Boolean] Pass true to pin the message only for self; private chats only. # @return [TD::Types::Ok] def pin_chat_message(chat_id:, message_id:, disable_notification:, only_for_self:) broadcast('@type' => 'pinChatMessage', @@ -3168,6 +5774,67 @@ def ping_proxy(proxy_id:) 'proxy_id' => proxy_id) end + # Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being + # recorded voice and video notes. + # In all other cases there is no need to preliminary upload a file. + # Updates updateFile will be used to notify about upload progress. + # The upload will not be completed until the file is sent in a message. + # + # @param file [TD::Types::InputFile] File to upload. + # @param file_type [TD::Types::FileType] File type; pass null if unknown. + # @param priority [Integer] Priority of the upload (1-32). + # The higher the priority, the earlier the file will be uploaded. + # If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be + # uploaded first. + # @return [TD::Types::File] + def preliminary_upload_file(file:, file_type:, priority:) + broadcast('@type' => 'preliminaryUploadFile', + 'file' => file, + 'file_type' => file_type, + 'priority' => priority) + end + + # Process new chats added to a shareable chat folder by its owner. + # + # @param chat_folder_id [Integer] Chat folder identifier. + # @param added_chat_ids [Array] Identifiers of the new chats, which are added to the chat folder. + # The chats are automatically joined if they aren't joined yet. + # @return [TD::Types::Ok] + def process_chat_folder_new_chats(chat_folder_id:, added_chat_ids:) + broadcast('@type' => 'processChatFolderNewChats', + 'chat_folder_id' => chat_folder_id, + 'added_chat_ids' => added_chat_ids) + end + + # Handles a pending join request in a chat. + # + # @param chat_id [Integer] Chat identifier. + # @param user_id [Integer] Identifier of the user that sent the request. + # @param approve [Boolean] Pass true to approve the request; pass false to decline it. + # @return [TD::Types::Ok] + def process_chat_join_request(chat_id:, user_id:, approve:) + broadcast('@type' => 'processChatJoinRequest', + 'chat_id' => chat_id, + 'user_id' => user_id, + 'approve' => approve) + end + + # Handles all pending join requests for a given link in a chat. + # + # @param chat_id [Integer] Chat identifier. + # @param invite_link [TD::Types::String] Invite link for which to process join requests. + # If empty, all join requests will be processed. + # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for + # other links. + # @param approve [Boolean] Pass true to approve all requests; pass false to decline them. + # @return [TD::Types::Ok] + def process_chat_join_requests(chat_id:, invite_link:, approve:) + broadcast('@type' => 'processChatJoinRequests', + 'chat_id' => chat_id, + 'invite_link' => invite_link, + 'approve' => approve) + end + # Handles a push notification. # Returns error with code 406 if the push notification is not supported and connection to the server is required to # fetch new data. @@ -3181,6 +5848,19 @@ def process_push_notification(payload:) 'payload' => payload) end + # Rates recognized speech in a video note or a voice note message. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @param is_good [Boolean] Pass true if the speech recognition is good. + # @return [TD::Types::Ok] + def rate_speech_recognition(chat_id:, message_id:, is_good:) + broadcast('@type' => 'rateSpeechRecognition', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'is_good' => is_good) + end + # Marks all mentions in a chat as read. # # @param chat_id [Integer] Chat identifier. @@ -3190,6 +5870,46 @@ def read_all_chat_mentions(chat_id:) 'chat_id' => chat_id) end + # Marks all reactions in a chat or a forum topic as read. + # + # @param chat_id [Integer] Chat identifier. + # @return [TD::Types::Ok] + def read_all_chat_reactions(chat_id:) + broadcast('@type' => 'readAllChatReactions', + 'chat_id' => chat_id) + end + + # Marks all mentions in a forum topic as read. + # + # @param chat_id [Integer] Chat identifier. + # @param message_thread_id [Integer] Message thread identifier in which mentions are marked as read. + # @return [TD::Types::Ok] + def read_all_message_thread_mentions(chat_id:, message_thread_id:) + broadcast('@type' => 'readAllMessageThreadMentions', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id) + end + + # Marks all reactions in a forum topic as read. + # + # @param chat_id [Integer] Chat identifier. + # @param message_thread_id [Integer] Message thread identifier in which reactions are marked as read. + # @return [TD::Types::Ok] + def read_all_message_thread_reactions(chat_id:, message_thread_id:) + broadcast('@type' => 'readAllMessageThreadReactions', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id) + end + + # Traverse all chats in a chat list and marks all messages in the chats as read. + # + # @param chat_list [TD::Types::ChatList] Chat list in which to mark all chats as read. + # @return [TD::Types::Ok] + def read_chat_list(chat_list:) + broadcast('@type' => 'readChatList', + 'chat_list' => chat_list) + end + # Reads a part of a file from the TDLib file cache and returns read bytes. # This method is intended to be used only if the application has no direct access to TDLib's file system, because it # is usually slower than a direct read from the file. @@ -3208,23 +5928,75 @@ def read_file_part(file_id:, offset:, count:) 'count' => count) end - # Recovers the password with a password recovery code sent to an email address that was previously set up. + # Readds quick reply messages which failed to add. + # Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in + # messageSendingStateFailed.retry_after time passed. + # If a message is readded, the corresponding failed to send message is deleted. + # Returns the sent messages in the same order as the message identifiers passed in message_ids. + # If a message can't be readded, null will be returned instead of the message. + # + # @param shortcut_name [TD::Types::String] Name of the target shortcut. + # @param message_ids [Array] Identifiers of the quick reply messages to readd. + # Message identifiers must be in a strictly increasing order. + # @return [TD::Types::QuickReplyMessages] + def readd_quick_reply_shortcut_messages(shortcut_name:, message_ids:) + broadcast('@type' => 'readdQuickReplyShortcutMessages', + 'shortcut_name' => shortcut_name, + 'message_ids' => message_ids) + end + + # Recognizes speech in a video note or a voice note message. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # Use messageProperties.can_recognize_speech to check whether the message is suitable. + # @return [TD::Types::Ok] + def recognize_speech(chat_id:, message_id:) + broadcast('@type' => 'recognizeSpeech', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + + # Recovers the 2-step verification password with a password recovery code sent to an email address that was + # previously set up. # Works only when the current authorization state is authorizationStateWaitPassword. # # @param recovery_code [TD::Types::String] Recovery code to check. + # @param new_password [TD::Types::String, nil] New 2-step verification password of the user; may be empty to remove + # the password. + # @param new_hint [TD::Types::String, nil] New password hint; may be empty. # @return [TD::Types::Ok] - def recover_authentication_password(recovery_code:) + def recover_authentication_password(recovery_code:, new_password: nil, new_hint: nil) broadcast('@type' => 'recoverAuthenticationPassword', - 'recovery_code' => recovery_code) + 'recovery_code' => recovery_code, + 'new_password' => new_password, + 'new_hint' => new_hint) end - # Recovers the password using a recovery code sent to an email address that was previously set up. + # Recovers the 2-step verification password using a recovery code sent to an email address that was previously set + # up. # # @param recovery_code [TD::Types::String] Recovery code to check. + # @param new_password [TD::Types::String, nil] New 2-step verification password of the user; may be empty to remove + # the password. + # @param new_hint [TD::Types::String, nil] New password hint; may be empty. # @return [TD::Types::PasswordState] - def recover_password(recovery_code:) + def recover_password(recovery_code:, new_password: nil, new_hint: nil) broadcast('@type' => 'recoverPassword', - 'recovery_code' => recovery_code) + 'recovery_code' => recovery_code, + 'new_password' => new_password, + 'new_hint' => new_hint) + end + + # Refunds a previously done payment in Telegram Stars. + # + # @param user_id [Integer] Identifier of the user that did the payment. + # @param telegram_payment_charge_id [TD::Types::String] Telegram payment identifier. + # @return [TD::Types::Ok] + def refund_star_payment(user_id:, telegram_payment_charge_id:) + broadcast('@type' => 'refundStarPayment', + 'user_id' => user_id, + 'telegram_payment_charge_id' => telegram_payment_charge_id) end # Registers the currently used device for receiving push notifications. @@ -3244,20 +6016,36 @@ def register_device(device_token:, other_user_ids:) # # @param first_name [TD::Types::String] The first name of the user; 1-64 characters. # @param last_name [TD::Types::String] The last name of the user; 0-64 characters. + # @param disable_notification [Boolean] Pass true to disable notification about the current user joining Telegram for + # other users that added them to contact list. # @return [TD::Types::Ok] - def register_user(first_name:, last_name:) - broadcast('@type' => 'registerUser', - 'first_name' => first_name, - 'last_name' => last_name) + def register_user(first_name:, last_name:, disable_notification:) + broadcast('@type' => 'registerUser', + 'first_name' => first_name, + 'last_name' => last_name, + 'disable_notification' => disable_notification) end - # Removes background from the list of installed backgrounds. + # Removes all files from the file download list. # - # @param background_id [Integer] The background identifier. + # @param only_active [Boolean] Pass true to remove only active downloads, including paused. + # @param only_completed [Boolean] Pass true to remove only completed downloads. + # @param delete_from_cache [Boolean] Pass true to delete the file from the TDLib file cache. # @return [TD::Types::Ok] - def remove_background(background_id:) - broadcast('@type' => 'removeBackground', - 'background_id' => background_id) + def remove_all_files_from_downloads(only_active:, only_completed:, delete_from_cache:) + broadcast('@type' => 'removeAllFilesFromDownloads', + 'only_active' => only_active, + 'only_completed' => only_completed, + 'delete_from_cache' => delete_from_cache) + end + + # Removes the connected business bot from a specific chat by adding the chat to businessRecipients.excluded_chat_ids. + # + # @param chat_id [Integer] Chat identifier. + # @return [TD::Types::Ok] + def remove_business_connected_bot_from_chat(chat_id:) + broadcast('@type' => 'removeBusinessConnectedBotFromChat', + 'chat_id' => chat_id) end # Removes a chat action bar without any other action. @@ -3287,30 +6075,77 @@ def remove_favorite_sticker(sticker:) 'sticker' => sticker) end - # Removes an active notification from notification list. - # Needs to be called only if the notification is removed by the current user. + # Removes a file from the file download list. # - # @param notification_group_id [Integer] Identifier of notification group to which the notification belongs. - # @param notification_id [Integer] Identifier of removed notification. + # @param file_id [Integer] Identifier of the downloaded file. + # @param delete_from_cache [Boolean] Pass true to delete the file from the TDLib file cache. # @return [TD::Types::Ok] - def remove_notification(notification_group_id:, notification_id:) - broadcast('@type' => 'removeNotification', - 'notification_group_id' => notification_group_id, - 'notification_id' => notification_id) + def remove_file_from_downloads(file_id:, delete_from_cache:) + broadcast('@type' => 'removeFileFromDownloads', + 'file_id' => file_id, + 'delete_from_cache' => delete_from_cache) end - # Removes a group of active notifications. - # Needs to be called only if the notification group is removed by the current user. + # Removes background from the list of installed backgrounds. # - # @param notification_group_id [Integer] Notification group identifier. - # @param max_notification_id [Integer] The maximum identifier of removed notifications. + # @param background_id [Integer] The background identifier. # @return [TD::Types::Ok] - def remove_notification_group(notification_group_id:, max_notification_id:) + def remove_installed_background(background_id:) + broadcast('@type' => 'removeInstalledBackground', + 'background_id' => background_id) + end + + # Removes a reaction from a message. + # A chosen reaction can always be removed. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @param reaction_type [TD::Types::ReactionType] Type of the reaction to remove. + # The paid reaction can't be removed. + # @return [TD::Types::Ok] + def remove_message_reaction(chat_id:, message_id:, reaction_type:) + broadcast('@type' => 'removeMessageReaction', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reaction_type' => reaction_type) + end + + # Removes an active notification from notification list. + # Needs to be called only if the notification is removed by the current user. + # + # @param notification_group_id [Integer] Identifier of notification group to which the notification belongs. + # @param notification_id [Integer] Identifier of removed notification. + # @return [TD::Types::Ok] + def remove_notification(notification_group_id:, notification_id:) + broadcast('@type' => 'removeNotification', + 'notification_group_id' => notification_group_id, + 'notification_id' => notification_id) + end + + # Removes a group of active notifications. + # Needs to be called only if the notification group is removed by the current user. + # + # @param notification_group_id [Integer] Notification group identifier. + # @param max_notification_id [Integer] The maximum identifier of removed notifications. + # @return [TD::Types::Ok] + def remove_notification_group(notification_group_id:, max_notification_id:) broadcast('@type' => 'removeNotificationGroup', 'notification_group_id' => notification_group_id, 'max_notification_id' => max_notification_id) end + # Removes all pending paid reactions on a message. + # Can be called within 5 seconds after the last addPaidMessageReaction call. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @return [TD::Types::Ok] + def remove_pending_paid_message_reactions(chat_id:, message_id:) + broadcast('@type' => 'removePendingPaidMessageReactions', + 'chat_id' => chat_id, + 'message_id' => message_id) + end + # Removes a proxy server. # Can be called before authorization. # @@ -3360,10 +6195,28 @@ def remove_saved_animation(animation:) 'animation' => animation) end - # Removes a sticker from the set to which it belongs; for bots only. - # The sticker set must have been created by the bot. + # Removes a notification sound from the list of saved notification sounds. # - # @param sticker [TD::Types::InputFile] Sticker. + # @param notification_sound_id [Integer] Identifier of the notification sound. + # @return [TD::Types::Ok] + def remove_saved_notification_sound(notification_sound_id:) + broadcast('@type' => 'removeSavedNotificationSound', + 'notification_sound_id' => notification_sound_id) + end + + # Removes a hashtag or a cashtag from the list of recently searched for hashtags or cashtags. + # + # @param tag [TD::Types::String] Hashtag or cashtag to delete. + # @return [TD::Types::Ok] + def remove_searched_for_tag(tag:) + broadcast('@type' => 'removeSearchedForTag', + 'tag' => tag) + end + + # Removes a sticker from the set to which it belongs. + # The sticker set must be owned by the current user. + # + # @param sticker [TD::Types::InputFile] Sticker to remove from the set. # @return [TD::Types::Ok] def remove_sticker_from_set(sticker:) broadcast('@type' => 'removeStickerFromSet', @@ -3382,27 +6235,88 @@ def remove_top_chat(category:, chat_id:) 'chat_id' => chat_id) end - # Changes the order of chat filters. + # Changes order of active usernames of the current user. + # + # @param usernames [Array] The new order of active usernames. + # All currently active usernames must be specified. + # @return [TD::Types::Ok] + def reorder_active_usernames(usernames:) + broadcast('@type' => 'reorderActiveUsernames', + 'usernames' => usernames) + end + + # Changes order of active usernames of a bot. + # Can be called only if userTypeBot.can_be_edited == true. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param usernames [Array] The new order of active usernames. + # All currently active usernames must be specified. + # @return [TD::Types::Ok] + def reorder_bot_active_usernames(bot_user_id:, usernames:) + broadcast('@type' => 'reorderBotActiveUsernames', + 'bot_user_id' => bot_user_id, + 'usernames' => usernames) + end + + # Changes order of media previews in the list of media previews of a bot. # - # @param chat_filter_ids [Array] Identifiers of chat filters in the new correct order. + # @param bot_user_id [Integer] Identifier of the target bot. + # The bot must be owned and must have the main Web App. + # @param language_code [TD::Types::String] Language code of the media previews to reorder. + # @param file_ids [Array] File identifiers of the media in the new order. # @return [TD::Types::Ok] - def reorder_chat_filters(chat_filter_ids:) - broadcast('@type' => 'reorderChatFilters', - 'chat_filter_ids' => chat_filter_ids) + def reorder_bot_media_previews(bot_user_id:, language_code:, file_ids:) + broadcast('@type' => 'reorderBotMediaPreviews', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code, + 'file_ids' => file_ids) + end + + # Changes the order of chat folders. + # + # @param chat_folder_ids [Array] Identifiers of chat folders in the new correct order. + # @param main_chat_list_position [Integer] Position of the main chat list among chat folders, 0-based. + # Can be non-zero only for Premium users. + # @return [TD::Types::Ok] + def reorder_chat_folders(chat_folder_ids:, main_chat_list_position:) + broadcast('@type' => 'reorderChatFolders', + 'chat_folder_ids' => chat_folder_ids, + 'main_chat_list_position' => main_chat_list_position) end # Changes the order of installed sticker sets. # - # @param is_masks [Boolean] Pass true to change the order of mask sticker sets; pass false to change the order of - # ordinary sticker sets. + # @param sticker_type [TD::Types::StickerType] Type of the sticker sets to reorder. # @param sticker_set_ids [Array] Identifiers of installed sticker sets in the new correct order. # @return [TD::Types::Ok] - def reorder_installed_sticker_sets(is_masks:, sticker_set_ids:) + def reorder_installed_sticker_sets(sticker_type:, sticker_set_ids:) broadcast('@type' => 'reorderInstalledStickerSets', - 'is_masks' => is_masks, + 'sticker_type' => sticker_type, 'sticker_set_ids' => sticker_set_ids) end + # Changes the order of quick reply shortcuts. + # + # @param shortcut_ids [Array] The new order of quick reply shortcuts. + # @return [TD::Types::Ok] + def reorder_quick_reply_shortcuts(shortcut_ids:) + broadcast('@type' => 'reorderQuickReplyShortcuts', + 'shortcut_ids' => shortcut_ids) + end + + # Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or + # channel. + # + # @param supergroup_id [Integer] Identifier of the supergroup or channel. + # @param usernames [Array] The new order of active usernames. + # All currently active usernames must be specified. + # @return [TD::Types::Ok] + def reorder_supergroup_active_usernames(supergroup_id:, usernames:) + broadcast('@type' => 'reorderSupergroupActiveUsernames', + 'supergroup_id' => supergroup_id, + 'usernames' => usernames) + end + # Replaces current primary invite link for a chat with a new primary invite link. # Available for basic groups, supergroups, and channels. # Requires administrator privileges and can_invite_users right. @@ -3414,16 +6328,52 @@ def replace_primary_chat_invite_link(chat_id:) 'chat_id' => chat_id) end + # Replaces existing sticker in a set. + # The function is equivalent to removeStickerFromSet, then addStickerToSet, then setStickerPositionInSet. + # + # @param user_id [Integer] Sticker set owner; ignored for regular users. + # @param name [TD::Types::String] Sticker set name. + # The sticker set must be owned by the current user. + # @param old_sticker [TD::Types::InputFile] Sticker to remove from the set. + # @param new_sticker [TD::Types::InputSticker] Sticker to add to the set. + # @return [TD::Types::Ok] + def replace_sticker_in_set(user_id:, name:, old_sticker:, new_sticker:) + broadcast('@type' => 'replaceStickerInSet', + 'user_id' => user_id, + 'name' => name, + 'old_sticker' => old_sticker, + 'new_sticker' => new_sticker) + end + + # Replaces the current RTMP URL for streaming to the chat; requires owner privileges. + # + # @param chat_id [Integer] Chat identifier. + # @return [TD::Types::RtmpUrl] + def replace_video_chat_rtmp_url(chat_id:) + broadcast('@type' => 'replaceVideoChatRtmpUrl', + 'chat_id' => chat_id) + end + + # Reports that authentication code wasn't delivered via SMS; for official mobile applications only. + # Works only when the current authorization state is authorizationStateWaitCode. + # + # @param mobile_network_code [TD::Types::String] Current mobile network code. + # @return [TD::Types::Ok] + def report_authentication_code_missing(mobile_network_code:) + broadcast('@type' => 'reportAuthenticationCodeMissing', + 'mobile_network_code' => mobile_network_code) + end + # Reports a chat to the Telegram moderators. - # A chat can be reported only from the chat action bar, or if this is a private chat with a bot, a private chat with - # a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators. + # A chat can be reported only from the chat action bar, or if chat.can_be_reported. # # @param chat_id [Integer] Chat identifier. - # @param message_ids [Array] Identifiers of reported messages, if any. - # @param reason [TD::Types::ChatReportReason] The reason for reporting the chat. + # @param message_ids [Array, nil] Identifiers of reported messages; may be empty to report the whole chat. + # Use messageProperties.can_be_reported to check whether the message can be reported. + # @param reason [TD::Types::ReportReason] The reason for reporting the chat. # @param text [TD::Types::String] Additional report details; 0-1024 characters. # @return [TD::Types::Ok] - def report_chat(chat_id:, message_ids:, reason:, text:) + def report_chat(chat_id:, message_ids: nil, reason:, text:) broadcast('@type' => 'reportChat', 'chat_id' => chat_id, 'message_ids' => message_ids, @@ -3432,13 +6382,12 @@ def report_chat(chat_id:, message_ids:, reason:, text:) end # Reports a chat photo to the Telegram moderators. - # A chat photo can be reported only if this is a private chat with a bot, a private chat with a user sharing their - # location, a supergroup, or a channel, since other chats can't be checked by moderators. + # A chat photo can be reported only if chat.can_be_reported. # # @param chat_id [Integer] Chat identifier. # @param file_id [Integer] Identifier of the photo to report. # Only full photos from {TD::Types::ChatPhoto} can be reported. - # @param reason [TD::Types::ChatReportReason] The reason for reporting the chat photo. + # @param reason [TD::Types::ReportReason] The reason for reporting the chat photo. # @param text [TD::Types::String] Additional report details; 0-1024 characters. # @return [TD::Types::Ok] def report_chat_photo(chat_id:, file_id:, reason:, text:) @@ -3449,21 +6398,84 @@ def report_chat_photo(chat_id:, file_id:, reason:, text:) 'text' => text) end - # Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup. + # Reports a sponsored message to Telegram moderators. + # + # @param chat_id [Integer] Chat identifier of the sponsored message. + # @param message_id [Integer] Identifier of the sponsored message. + # @param option_id [String, nil] Option identifier chosen by the user; leave empty for the initial request. + # @return [TD::Types::ReportChatSponsoredMessageResult] + def report_chat_sponsored_message(chat_id:, message_id:, option_id: nil) + broadcast('@type' => 'reportChatSponsoredMessage', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'option_id' => option_id) + end + + # Reports reactions set on a message to the Telegram moderators. + # Reactions on a message can be reported only if messageProperties.can_report_reactions. + # + # @param chat_id [Integer] Chat identifier. + # @param message_id [Integer] Message identifier. + # @param sender_id [TD::Types::MessageSender] Identifier of the sender, which added the reaction. + # @return [TD::Types::Ok] + def report_message_reactions(chat_id:, message_id:, sender_id:) + broadcast('@type' => 'reportMessageReactions', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'sender_id' => sender_id) + end + + # Reports that authentication code wasn't delivered via SMS to the specified phone number; for official mobile + # applications only. + # + # @param mobile_network_code [TD::Types::String] Current mobile network code. + # @return [TD::Types::Ok] + def report_phone_number_code_missing(mobile_network_code:) + broadcast('@type' => 'reportPhoneNumberCodeMissing', + 'mobile_network_code' => mobile_network_code) + end + + # Reports a story to the Telegram moderators. + # + # @param story_sender_chat_id [Integer] The identifier of the sender of the story to report. + # @param story_id [Integer] The identifier of the story to report. + # @param reason [TD::Types::ReportReason] The reason for reporting the story. + # @param text [TD::Types::String] Additional report details; 0-1024 characters. + # @return [TD::Types::Ok] + def report_story(story_sender_chat_id:, story_id:, reason:, text:) + broadcast('@type' => 'reportStory', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id, + 'reason' => reason, + 'text' => text) + end + + # Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the + # supergroup. + # Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true. # # @param supergroup_id [Integer] Supergroup identifier. - # @param user_id [Integer] User identifier. - # @param message_ids [Array] Identifiers of messages sent in the supergroup by the user. - # This list must be non-empty. + # @param message_id [Integer] Identifier of the erroneously deleted message from chatEventMessageDeleted. + # @return [TD::Types::Ok] + def report_supergroup_anti_spam_false_positive(supergroup_id:, message_id:) + broadcast('@type' => 'reportSupergroupAntiSpamFalsePositive', + 'supergroup_id' => supergroup_id, + 'message_id' => message_id) + end + + # Reports messages in a supergroup as spam; requires administrator rights in the supergroup. + # + # @param supergroup_id [Integer] Supergroup identifier. + # @param message_ids [Array] Identifiers of messages to report. + # Use messageProperties.can_be_reported to check whether the message can be reported. # @return [TD::Types::Ok] - def report_supergroup_spam(supergroup_id:, user_id:, message_ids:) + def report_supergroup_spam(supergroup_id:, message_ids:) broadcast('@type' => 'reportSupergroupSpam', 'supergroup_id' => supergroup_id, - 'user_id' => user_id, 'message_ids' => message_ids) end - # Requests to send a password recovery code to an email address that was previously set up. + # Requests to send a 2-step verification password recovery code to an email address that was previously set up. # Works only when the current authorization state is authorizationStateWaitPassword. # # @return [TD::Types::Ok] @@ -3471,7 +6483,7 @@ def request_authentication_password_recovery broadcast('@type' => 'requestAuthenticationPasswordRecovery') end - # Requests to send a password recovery code to an email address that was previously set up. + # Requests to send a 2-step verification password recovery code to an email address that was previously set up. # # @return [TD::Types::EmailAddressAuthenticationCodeInfo] def request_password_recovery @@ -3480,8 +6492,9 @@ def request_password_recovery # Requests QR code authentication by scanning a QR code on another logged in device. # Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending - # authentication query and the current authorization state is authorizationStateWaitCode, - # authorizationStateWaitRegistration, or authorizationStateWaitPassword. + # authentication query and the current authorization state is authorizationStateWaitEmailAddress, + # authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or + # authorizationStateWaitPassword. # # @param other_user_ids [Array] List of user identifiers of other users currently using the application. # @return [TD::Types::Ok] @@ -3490,28 +6503,30 @@ def request_qr_code_authentication(other_user_ids:) 'other_user_ids' => other_user_ids) end - # Re-sends an authentication code to the user. - # Works only when the current authorization state is authorizationStateWaitCode and the next_code_type of the result - # is not null. + # Resends an authentication code to the user. + # Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is + # not null and the server-specified timeout has passed, or when the current authorization state is + # authorizationStateWaitEmailCode. # + # @param reason [TD::Types::ResendCodeReason] Reason of code resending; pass null if unknown. # @return [TD::Types::Ok] - def resend_authentication_code - broadcast('@type' => 'resendAuthenticationCode') + def resend_authentication_code(reason:) + broadcast('@type' => 'resendAuthenticationCode', + 'reason' => reason) end - # Re-sends the authentication code sent to confirm a new phone number for the user. - # Works only if the previously received authenticationCodeInfo next_code_type was not null. + # Resends the code to verify an email address to be added to a user's Telegram Passport. # - # @return [TD::Types::AuthenticationCodeInfo] - def resend_change_phone_number_code - broadcast('@type' => 'resendChangePhoneNumberCode') + # @return [TD::Types::EmailAddressAuthenticationCodeInfo] + def resend_email_address_verification_code + broadcast('@type' => 'resendEmailAddressVerificationCode') end - # Re-sends the code to verify an email address to be added to a user's Telegram Passport. + # Resends the login email address verification code. # # @return [TD::Types::EmailAddressAuthenticationCodeInfo] - def resend_email_address_verification_code - broadcast('@type' => 'resendEmailAddressVerificationCode') + def resend_login_email_address_code + broadcast('@type' => 'resendLoginEmailAddressCode') end # Resends messages which failed to send. @@ -3524,25 +6539,26 @@ def resend_email_address_verification_code # @param chat_id [Integer] Identifier of the chat to send messages. # @param message_ids [Array] Identifiers of the messages to resend. # Message identifiers must be in a strictly increasing order. + # @param quote [TD::Types::InputTextQuote] New manually chosen quote from the message to be replied; pass null if + # none. + # Ignored if more than one message is re-sent, or if messageSendingStateFailed.need_another_reply_quote == false. # @return [TD::Types::Messages] - def resend_messages(chat_id:, message_ids:) + def resend_messages(chat_id:, message_ids:, quote:) broadcast('@type' => 'resendMessages', 'chat_id' => chat_id, - 'message_ids' => message_ids) - end - - # Resends phone number confirmation code. - # - # @return [TD::Types::AuthenticationCodeInfo] - def resend_phone_number_confirmation_code - broadcast('@type' => 'resendPhoneNumberConfirmationCode') + 'message_ids' => message_ids, + 'quote' => quote) end - # Re-sends the code to verify a phone number to be added to a user's Telegram Passport. + # Resends the authentication code sent to a phone number. + # Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified + # timeout has passed. # + # @param reason [TD::Types::ResendCodeReason] Reason of code resending; pass null if unknown. # @return [TD::Types::AuthenticationCodeInfo] - def resend_phone_number_verification_code - broadcast('@type' => 'resendPhoneNumberVerificationCode') + def resend_phone_number_code(reason:) + broadcast('@type' => 'resendPhoneNumberCode', + 'reason' => reason) end # Resends the 2-step verification recovery email address verification code. @@ -3552,19 +6568,29 @@ def resend_recovery_email_address_code broadcast('@type' => 'resendRecoveryEmailAddressCode') end - # Resets all notification settings to their default values. - # By default, all chats are unmuted, the sound is set to "default" and message previews are shown. + # Resets all chat and scope notification settings to their default values. + # By default, all chats are unmuted and message previews are shown. # # @return [TD::Types::Ok] def reset_all_notification_settings broadcast('@type' => 'resetAllNotificationSettings') end + # Resets the login email address. + # May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending. + # Works only when the current authorization state is authorizationStateWaitEmailCode and + # authorization_state.can_reset_email_address == true. + # + # @return [TD::Types::Ok] + def reset_authentication_email_address + broadcast('@type' => 'resetAuthenticationEmailAddress') + end + # Resets list of installed backgrounds to its default value. # # @return [TD::Types::Ok] - def reset_backgrounds - broadcast('@type' => 'resetBackgrounds') + def reset_installed_backgrounds + broadcast('@type' => 'resetInstalledBackgrounds') end # Resets all network data usage statistics to zero. @@ -3575,6 +6601,23 @@ def reset_network_statistics broadcast('@type' => 'resetNetworkStatistics') end + # Removes 2-step verification password without previous password and access to recovery email address. + # The password can't be reset immediately and the request needs to be repeated after the specified time. + # + # @return [TD::Types::ResetPasswordResult] + def reset_password + broadcast('@type' => 'resetPassword') + end + + # Reuses an active subscription and joins the subscribed chat again. + # + # @param subscription_id [TD::Types::String] Identifier of the subscription. + # @return [TD::Types::Ok] + def reuse_star_subscription(subscription_id:) + broadcast('@type' => 'reuseStarSubscription', + 'subscription_id' => subscription_id) + end + # Revokes invite link for a chat. # Available for basic groups, supergroups, and channels. # Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for @@ -3624,32 +6667,31 @@ def search_background(name:) end # Searches for call messages. - # Returns the results in reverse chronological order (i. - # e., in order of decreasing message_id). - # For optimal performance the number of returned messages is chosen by the library. + # Returns the results in reverse chronological order (i.e., in order of decreasing message_id). + # For optimal performance, the number of returned messages is chosen by TDLib. # - # @param from_message_id [Integer] Identifier of the message from which to search; use 0 to get results from the last - # message. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. # @param limit [Integer] The maximum number of messages to be returned; up to 100. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. - # @param only_missed [Boolean] If true, returns only messages with missed calls. - # @return [TD::Types::Messages] - def search_call_messages(from_message_id:, limit:, only_missed:) - broadcast('@type' => 'searchCallMessages', - 'from_message_id' => from_message_id, - 'limit' => limit, - 'only_missed' => only_missed) + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @param only_missed [Boolean] Pass true to search only for messages with missed/declined calls. + # @return [TD::Types::FoundMessages] + def search_call_messages(offset:, limit:, only_missed:) + broadcast('@type' => 'searchCallMessages', + 'offset' => offset, + 'limit' => limit, + 'only_missed' => only_missed) end - # Searches for a specified query in the first name, last name and username of the members of a specified chat. - # Requires administrator rights in channels. + # Searches for a specified query in the first name, last name and usernames of the members of a specified chat. + # Requires administrator rights if the chat is a channel. # # @param chat_id [Integer] Chat identifier. # @param query [TD::Types::String] Query to search for. - # @param limit [Integer] The maximum number of users to be returned. - # @param filter [TD::Types::ChatMembersFilter] The type of users to return. - # By default, chatMembersFilterMembers. + # @param limit [Integer] The maximum number of users to be returned; up to 200. + # @param filter [TD::Types::ChatMembersFilter] The type of users to search for; pass null to search among all chat + # members. # @return [TD::Types::ChatMembers] def search_chat_members(chat_id:, query:, limit:, filter:) broadcast('@type' => 'searchChatMembers', @@ -3662,37 +6704,46 @@ def search_chat_members(chat_id:, query:, limit:, filter:) # Searches for messages with given words in the chat. # Returns the results in reverse chronological order, i.e. # in order of decreasing message_id. - # Cannot be used in secret chats with a non-empty query (searchSecretMessages should be used instead), or without an + # Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used instead), or without an # enabled message database. - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only + # if it is required for Telegram official application implementation. # # @param chat_id [Integer] Identifier of the chat in which to search messages. # @param query [TD::Types::String] Query to search for. - # @param sender [TD::Types::MessageSender] If not null, only messages sent by the specified sender will be returned. + # @param sender_id [TD::Types::MessageSender] Identifier of the sender of messages to search for; pass null to search + # for messages from any sender. # Not supported in secret chats. # @param from_message_id [Integer] Identifier of the message starting from which history must be fetched; use 0 to # get results from the last message. - # @param offset [Integer] Specify 0 to get results from exactly the from_message_id or a negative offset to get the - # specified message and some newer messages. + # @param offset [Integer] Specify 0 to get results from exactly the message from_message_id or a negative offset to + # get the specified message and some newer messages. # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than # 100. # If the offset is negative, the limit must be greater than -offset. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. - # @param filter [TD::Types::SearchMessagesFilter] Filter for message content in the search results. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @param filter [TD::Types::SearchMessagesFilter] Additional filter for messages to search; pass null to search for + # all messages. # @param message_thread_id [Integer] If not 0, only messages in the specified thread will be returned; supergroups # only. - # @return [TD::Types::Messages] - def search_chat_messages(chat_id:, query:, sender:, from_message_id:, offset:, limit:, filter:, message_thread_id:) - broadcast('@type' => 'searchChatMessages', - 'chat_id' => chat_id, - 'query' => query, - 'sender' => sender, - 'from_message_id' => from_message_id, - 'offset' => offset, - 'limit' => limit, - 'filter' => filter, - 'message_thread_id' => message_thread_id) + # @param saved_messages_topic_id [Integer] If not 0, only messages in the specified Saved Messages topic will be + # returned; pass 0 to return all messages, or for chats other than Saved Messages. + # @return [TD::Types::FoundChatMessages] + def search_chat_messages(chat_id:, query:, sender_id:, from_message_id:, offset:, limit:, filter:, message_thread_id:, + saved_messages_topic_id:) + broadcast('@type' => 'searchChatMessages', + 'chat_id' => chat_id, + 'query' => query, + 'sender_id' => sender_id, + 'from_message_id' => from_message_id, + 'offset' => offset, + 'limit' => limit, + 'filter' => filter, + 'message_thread_id' => message_thread_id, + 'saved_messages_topic_id' => saved_messages_topic_id) end # Returns information about the recent locations of chat members that were sent to the chat. @@ -3707,11 +6758,11 @@ def search_chat_recent_location_messages(chat_id:, limit:) 'limit' => limit) end - # Searches for the specified query in the title and username of already known chats, this is an offline request. + # Searches for the specified query in the title and username of already known chats; this is an offline request. # Returns chats in the order seen in the main chat list. # # @param query [TD::Types::String] Query to search for. - # If the query is empty, returns up to 20 recently found chats. + # If the query is empty, returns up to 50 recently found chats. # @param limit [Integer] The maximum number of chats to be returned. # @return [TD::Types::Chats] def search_chats(query:, limit:) @@ -3722,7 +6773,7 @@ def search_chats(query:, limit:) # Returns a list of users and location-based supergroups nearby. # The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby. - # The request should be sent again every 25 seconds with adjusted location to not miss new chats. + # The request must be sent again every 25 seconds with adjusted location to not miss new chats. # # @param location [TD::Types::Location] Current user location. # @return [TD::Types::ChatsNearby] @@ -3756,19 +6807,36 @@ def search_contacts(query: nil, limit:) # Searches for emojis by keywords. # Supported only if the file database is enabled. + # Order of results is unspecified. # # @param text [TD::Types::String] Text to search for. - # @param exact_match [Boolean] True, if only emojis, which exactly match text needs to be returned. # @param input_language_codes [Array, nil] List of possible IETF language tags of the user's input # language; may be empty if unknown. - # @return [TD::Types::Emojis] - def search_emojis(text:, exact_match:, input_language_codes: nil) + # @return [TD::Types::EmojiKeywords] + def search_emojis(text:, input_language_codes: nil) broadcast('@type' => 'searchEmojis', 'text' => text, - 'exact_match' => exact_match, 'input_language_codes' => input_language_codes) end + # Searches for files in the file download list or recently downloaded files from the list. + # + # @param query [TD::Types::String, nil] Query to search for; may be empty to return all downloaded files. + # @param only_active [Boolean] Pass true to search only for active downloads, including paused. + # @param only_completed [Boolean] Pass true to search only for completed downloads. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of files to be returned. + # @return [TD::Types::FoundFileDownloads] + def search_file_downloads(query: nil, only_active:, only_completed:, offset:, limit:) + broadcast('@type' => 'searchFileDownloads', + 'query' => query, + 'only_active' => only_active, + 'only_completed' => only_completed, + 'offset' => offset, + 'limit' => limit) + end + # Searches for recently used hashtags by their prefix. # # @param prefix [TD::Types::String] Hashtag prefix to search for. @@ -3782,56 +6850,66 @@ def search_hashtags(prefix:, limit:) # Searches for installed sticker sets by looking for specified query in their title and name. # - # @param is_masks [Boolean] Pass true to return mask sticker sets; pass false to return ordinary sticker sets. + # @param sticker_type [TD::Types::StickerType] Type of the sticker sets to search for. # @param query [TD::Types::String] Query to search for. # @param limit [Integer] The maximum number of sticker sets to return. # @return [TD::Types::StickerSets] - def search_installed_sticker_sets(is_masks:, query:, limit:) - broadcast('@type' => 'searchInstalledStickerSets', - 'is_masks' => is_masks, - 'query' => query, - 'limit' => limit) + def search_installed_sticker_sets(sticker_type:, query:, limit:) + broadcast('@type' => 'searchInstalledStickerSets', + 'sticker_type' => sticker_type, + 'query' => query, + 'limit' => limit) end # Searches for messages in all chats except secret chats. # Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)). - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. # # @param chat_list [TD::Types::ChatList] Chat list in which to search messages; pass null to search in all chats # regardless of their chat list. # Only Main and Archive chat lists are supported. + # @param only_in_channels [Boolean] Pass true to search only for messages in channels. # @param query [TD::Types::String] Query to search for. - # @param offset_date [Integer] The date of the message starting from which the results should be fetched. - # Use 0 or any date in the future to get results from the last message. - # @param offset_chat_id [Integer] The chat identifier of the last found message, or 0 for the first request. - # @param offset_message_id [Integer] The message identifier of the last found message, or 0 for the first request. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. # @param limit [Integer] The maximum number of messages to be returned; up to 100. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. - # @param filter [TD::Types::SearchMessagesFilter] Filter for message content in the search results; - # searchMessagesFilterCall, searchMessagesFilterMissedCall, searchMessagesFilterMention, - # searchMessagesFilterUnreadMention, {TD::Types::SearchMessagesFilter::FailedToSend} and - # {TD::Types::SearchMessagesFilter::Pinned} are unsupported in this function. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @param filter [TD::Types::SearchMessagesFilter] Additional filter for messages to search; pass null to search for + # all messages. + # Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, + # searchMessagesFilterFailedToSend, and {TD::Types::SearchMessagesFilter::Pinned} are unsupported in this function. # @param min_date [Integer] If not 0, the minimum date of the messages to return. # @param max_date [Integer] If not 0, the maximum date of the messages to return. - # @return [TD::Types::Messages] - def search_messages(chat_list:, query:, offset_date:, offset_chat_id:, offset_message_id:, limit:, filter:, min_date:, - max_date:) - broadcast('@type' => 'searchMessages', - 'chat_list' => chat_list, - 'query' => query, - 'offset_date' => offset_date, - 'offset_chat_id' => offset_chat_id, - 'offset_message_id' => offset_message_id, - 'limit' => limit, - 'filter' => filter, - 'min_date' => min_date, - 'max_date' => max_date) + # @return [TD::Types::FoundMessages] + def search_messages(chat_list:, only_in_channels:, query:, offset:, limit:, filter:, min_date:, max_date:) + broadcast('@type' => 'searchMessages', + 'chat_list' => chat_list, + 'only_in_channels' => only_in_channels, + 'query' => query, + 'offset' => offset, + 'limit' => limit, + 'filter' => filter, + 'min_date' => min_date, + 'max_date' => max_date) + end + + # Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. + # Returns the results in reverse chronological order. + # + # @param query [TD::Types::String] Query to search for in document file name and message caption. + # @param limit [Integer] The maximum number of messages to be returned; up to 100. + # @return [TD::Types::FoundMessages] + def search_outgoing_document_messages(query:, limit:) + broadcast('@type' => 'searchOutgoingDocumentMessages', + 'query' => query, + 'limit' => limit) end # Searches a public chat by its username. - # Currently only private chats, supergroups and channels can be public. - # Returns the chat if found; otherwise an error is returned. + # Currently, only private chats, supergroups and channels can be public. + # Returns the chat if found; otherwise, an error is returned. # # @param username [TD::Types::String] Username to be resolved. # @return [TD::Types::Chat] @@ -3841,9 +6919,8 @@ def search_public_chat(username:) end # Searches public chats by looking for specified query in their username and title. - # Currently only private chats, supergroups and channels can be public. + # Currently, only private chats, supergroups and channels can be public. # Returns a meaningful number of results. - # Returns nothing if the length of the searched username prefix is less than 5. # Excludes private chats with contacts and chats from the chat list from the results. # # @param query [TD::Types::String] Query to search for. @@ -3853,20 +6930,153 @@ def search_public_chats(query:) 'query' => query) end + # Searches for public channel posts containing the given hashtag or cashtag. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # + # @param tag [TD::Types::String] Hashtag or cashtag to search for. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of messages to be returned; up to 100. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::FoundMessages] + def search_public_messages_by_tag(tag:, offset:, limit:) + broadcast('@type' => 'searchPublicMessagesByTag', + 'tag' => tag, + 'offset' => offset, + 'limit' => limit) + end + + # Searches for public stories by the given address location. + # For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified + # limit. + # + # @param address [TD::Types::LocationAddress] Address of the location. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of stories to be returned; up to 100. + # For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::FoundStories] + def search_public_stories_by_location(address:, offset:, limit:) + broadcast('@type' => 'searchPublicStoriesByLocation', + 'address' => address, + 'offset' => offset, + 'limit' => limit) + end + + # Searches for public stories containing the given hashtag or cashtag. + # For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified + # limit. + # + # @param tag [TD::Types::String] Hashtag or cashtag to search for. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of stories to be returned; up to 100. + # For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::FoundStories] + def search_public_stories_by_tag(tag:, offset:, limit:) + broadcast('@type' => 'searchPublicStoriesByTag', + 'tag' => tag, + 'offset' => offset, + 'limit' => limit) + end + + # Searches for public stories from the given venue. + # For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified + # limit. + # + # @param venue_provider [TD::Types::String] Provider of the venue. + # @param venue_id [TD::Types::String] Identifier of the venue in the provider database. + # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use + # empty string to get the first chunk of results. + # @param limit [Integer] The maximum number of stories to be returned; up to 100. + # For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::FoundStories] + def search_public_stories_by_venue(venue_provider:, venue_id:, offset:, limit:) + broadcast('@type' => 'searchPublicStoriesByVenue', + 'venue_provider' => venue_provider, + 'venue_id' => venue_id, + 'offset' => offset, + 'limit' => limit) + end + + # Searches for a given quote in a text. + # Returns found quote start position in UTF-16 code units. + # Returns a 404 error if the quote is not found. + # Can be called synchronously. + # + # @param text [TD::Types::FormattedText] Text in which to search for the quote. + # @param quote [TD::Types::FormattedText] Quote to search for. + # @param quote_position [Integer] Approximate quote position in UTF-16 code units. + # @return [TD::Types::FoundPosition] + def search_quote(text:, quote:, quote_position:) + broadcast('@type' => 'searchQuote', + 'text' => text, + 'quote' => quote, + 'quote_position' => quote_position) + end + + # Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline + # request. + # + # @param query [TD::Types::String] Query to search for. + # @param limit [Integer] The maximum number of chats to be returned. + # @return [TD::Types::Chats] + def search_recently_found_chats(query:, limit:) + broadcast('@type' => 'searchRecentlyFoundChats', + 'query' => query, + 'limit' => limit) + end + + # Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for + # Telegram Premium users only. + # Returns the results in reverse chronological order, i.e. + # in order of decreasing message_id For optimal performance, the number of returned messages is chosen by TDLib and + # can be smaller than the specified limit. + # + # @param saved_messages_topic_id [Integer] If not 0, only messages in the specified Saved Messages topic will be + # considered; pass 0 to consider all messages. + # @param tag [TD::Types::ReactionType] Tag to search for; pass null to return all suitable messages. + # @param query [TD::Types::String] Query to search for. + # @param from_message_id [Integer] Identifier of the message starting from which messages must be fetched; use 0 to + # get results from the last message. + # @param offset [Integer] Specify 0 to get results from exactly the message from_message_id or a negative offset to + # get the specified message and some newer messages. + # @param limit [Integer] The maximum number of messages to be returned; must be positive and can't be greater than + # 100. + # If the offset is negative, the limit must be greater than -offset. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @return [TD::Types::FoundChatMessages] + def search_saved_messages(saved_messages_topic_id:, tag:, query:, from_message_id:, offset:, limit:) + broadcast('@type' => 'searchSavedMessages', + 'saved_messages_topic_id' => saved_messages_topic_id, + 'tag' => tag, + 'query' => query, + 'from_message_id' => from_message_id, + 'offset' => offset, + 'limit' => limit) + end + # Searches for messages in secret chats. # Returns the results in reverse chronological order. - # For optimal performance the number of returned messages is chosen by the library. + # For optimal performance, the number of returned messages is chosen by TDLib. # # @param chat_id [Integer] Identifier of the chat in which to search. # Specify 0 to search in all secret chats. # @param query [TD::Types::String] Query to search for. - # If empty, searchChatMessages should be used instead. + # If empty, searchChatMessages must be used instead. # @param offset [TD::Types::String] Offset of the first entry to return as received from the previous request; use - # empty string to get first chunk of results. + # empty string to get the first chunk of results. # @param limit [Integer] The maximum number of messages to be returned; up to 100. - # Fewer messages may be returned than specified by the limit, even if the end of the message history has not been - # reached. - # @param filter [TD::Types::SearchMessagesFilter] A filter for message content in the search results. + # For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified + # limit. + # @param filter [TD::Types::SearchMessagesFilter] Additional filter for messages to search; pass null to search for + # all messages. # @return [TD::Types::FoundMessages] def search_secret_messages(chat_id:, query:, offset:, limit:, filter:) broadcast('@type' => 'searchSecretMessages', @@ -3886,28 +7096,95 @@ def search_sticker_set(name:) 'name' => name) end - # Searches for ordinary sticker sets by looking for specified query in their title and name. + # Searches for sticker sets by looking for specified query in their title and name. # Excludes installed sticker sets from the results. # + # @param sticker_type [TD::Types::StickerType] Type of the sticker sets to return. # @param query [TD::Types::String] Query to search for. # @return [TD::Types::StickerSets] - def search_sticker_sets(query:) - broadcast('@type' => 'searchStickerSets', - 'query' => query) + def search_sticker_sets(sticker_type:, query:) + broadcast('@type' => 'searchStickerSets', + 'sticker_type' => sticker_type, + 'query' => query) end - # Searches for stickers from public sticker sets that correspond to a given emoji. + # Searches for stickers from public sticker sets that correspond to any of the given emoji. # - # @param emoji [TD::Types::String] String representation of emoji; must be non-empty. - # @param limit [Integer, nil] The maximum number of stickers to be returned. + # @param sticker_type [TD::Types::StickerType, nil] Type of the stickers to return. + # @param emojis [TD::Types::String] Space-separated list of emojis to search for; must be non-empty. + # @param limit [Integer, nil] The maximum number of stickers to be returned; 0-100. # @return [TD::Types::Stickers] - def search_stickers(emoji:, limit: nil) - broadcast('@type' => 'searchStickers', - 'emoji' => emoji, - 'limit' => limit) + def search_stickers(sticker_type: nil, emojis:, limit: nil) + broadcast('@type' => 'searchStickers', + 'sticker_type' => sticker_type, + 'emojis' => emojis, + 'limit' => limit) + end + + # Searches specified query by word prefixes in the provided strings. + # Returns 0-based positions of strings that matched. + # Can be called synchronously. + # + # @param strings [Array] The strings to search in for the query. + # @param query [TD::Types::String] Query to search for. + # @param limit [Integer] The maximum number of objects to return. + # @param return_none_for_empty_query [Boolean] Pass true to receive no results for an empty query. + # @return [TD::Types::FoundPositions] + def search_strings_by_prefix(strings:, query:, limit:, return_none_for_empty_query:) + broadcast('@type' => 'searchStringsByPrefix', + 'strings' => strings, + 'query' => query, + 'limit' => limit, + 'return_none_for_empty_query' => return_none_for_empty_query) + end + + # Searches a user by their phone number. + # Returns a 404 error if the user can't be found. + # + # @param phone_number [TD::Types::String] Phone number to search for. + # @param only_local [Boolean] Pass true to get only locally available information without sending network requests. + # @return [TD::Types::User] + def search_user_by_phone_number(phone_number:, only_local:) + broadcast('@type' => 'searchUserByPhoneNumber', + 'phone_number' => phone_number, + 'only_local' => only_local) + end + + # Searches a user by a token from the user's link. + # + # @param token [TD::Types::String] Token to search for. + # @return [TD::Types::User] + def search_user_by_token(token:) + broadcast('@type' => 'searchUserByToken', + 'token' => token) + end + + # Returns information about a Web App by its short name. + # Returns a 404 error if the Web App is not found. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param web_app_short_name [TD::Types::String] Short name of the Web App. + # @return [TD::Types::FoundWebApp] + def search_web_app(bot_user_id:, web_app_short_name:) + broadcast('@type' => 'searchWebApp', + 'bot_user_id' => bot_user_id, + 'web_app_short_name' => web_app_short_name) + end + + # Sends Firebase Authentication SMS to the phone number of the user. + # Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the + # type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos. + # + # @param token [TD::Types::String] Play Integrity API or SafetyNet Attestation API token for the Android application, + # or secret from push notification for the iOS application. + # @return [TD::Types::Ok] + def send_authentication_firebase_sms(token:) + broadcast('@type' => 'sendAuthenticationFirebaseSms', + 'token' => token) end - # Invites a bot to a chat (if it is not yet a member) and sends it the /start command. + # Invites a bot to a chat (if it is not yet a member) and sends it the /start command; requires can_invite_users + # member right. # Bots can't be invited to a private chat other than the chat with the bot. # Bots can't be invited to channels (although they can be added as admins) and secret chats. # Returns the sent message. @@ -3924,18 +7201,86 @@ def send_bot_start_message(bot_user_id:, chat_id:, parameter:) 'parameter' => parameter) end - # Sends debug information for a call. + # Sends a message on behalf of a business account; for bots only. + # Returns the message after it was sent. # - # @param call_id [Integer] Call identifier. - # @param debug_information [TD::Types::String] Debug information in application-specific format. - # @return [TD::Types::Ok] - def send_call_debug_information(call_id:, debug_information:) - broadcast('@type' => 'sendCallDebugInformation', - 'call_id' => call_id, - 'debug_information' => debug_information) + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which to + # send the request. + # @param chat_id [Integer] Target chat. + # @param reply_to [TD::Types::InputMessageReplyTo] Information about the message to be replied; pass null if none. + # @param disable_notification [Boolean] Pass true to disable notification for the message. + # @param protect_content [Boolean] Pass true if the content of the message must be protected from forwarding and + # saving. + # @param effect_id [Integer] Identifier of the effect to apply to the message. + # @param reply_markup [TD::Types::ReplyMarkup] Markup for replying to the message; pass null if none. + # @param input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. + # @return [TD::Types::BusinessMessage] + def send_business_message(business_connection_id:, chat_id:, reply_to:, disable_notification:, protect_content:, + effect_id:, reply_markup:, input_message_content:) + broadcast('@type' => 'sendBusinessMessage', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'reply_to' => reply_to, + 'disable_notification' => disable_notification, + 'protect_content' => protect_content, + 'effect_id' => effect_id, + 'reply_markup' => reply_markup, + 'input_message_content' => input_message_content) end - # Sends a call rating. + # Sends 2-10 messages grouped together into an album on behalf of a business account; for bots only. + # Currently, only audio, document, photo and video messages can be grouped into an album. + # Documents and audio files can be only grouped in an album with messages of the same type. + # Returns sent messages. + # + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which to + # send the request. + # @param chat_id [Integer] Target chat. + # @param reply_to [TD::Types::InputMessageReplyTo] Information about the message to be replied; pass null if none. + # @param disable_notification [Boolean] Pass true to disable notification for the message. + # @param protect_content [Boolean] Pass true if the content of the message must be protected from forwarding and + # saving. + # @param effect_id [Integer] Identifier of the effect to apply to the message. + # @param input_message_contents [Array] Contents of messages to be sent. + # At most 10 messages can be added to an album. + # All messages must have the same value of show_caption_above_media. + # @return [TD::Types::BusinessMessages] + def send_business_message_album(business_connection_id:, chat_id:, reply_to:, disable_notification:, protect_content:, + effect_id:, input_message_contents:) + broadcast('@type' => 'sendBusinessMessageAlbum', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'reply_to' => reply_to, + 'disable_notification' => disable_notification, + 'protect_content' => protect_content, + 'effect_id' => effect_id, + 'input_message_contents' => input_message_contents) + end + + # Sends debug information for a call to Telegram servers. + # + # @param call_id [Integer] Call identifier. + # @param debug_information [TD::Types::String] Debug information in application-specific format. + # @return [TD::Types::Ok] + def send_call_debug_information(call_id:, debug_information:) + broadcast('@type' => 'sendCallDebugInformation', + 'call_id' => call_id, + 'debug_information' => debug_information) + end + + # Sends log file for a call to Telegram servers. + # + # @param call_id [Integer] Call identifier. + # @param log_file [TD::Types::InputFile] Call log file. + # Only {TD::Types::InputFile::Local} and {TD::Types::InputFile::Generated} are supported. + # @return [TD::Types::Ok] + def send_call_log(call_id:, log_file:) + broadcast('@type' => 'sendCallLog', + 'call_id' => call_id, + 'log_file' => log_file) + end + + # Sends a call rating. # # @param call_id [Integer] Call identifier. # @param rating [Integer] Call rating; 1-5. @@ -3965,24 +7310,17 @@ def send_call_signaling_data(call_id:, data:) # Sends a notification about user activity in a chat. # # @param chat_id [Integer] Chat identifier. - # @param message_thread_id [Integer] If not 0, a message thread identifier in which the action was performed. - # @param action [TD::Types::ChatAction] The action description. - # @return [TD::Types::Ok] - def send_chat_action(chat_id:, message_thread_id:, action:) - broadcast('@type' => 'sendChatAction', - 'chat_id' => chat_id, - 'message_thread_id' => message_thread_id, - 'action' => action) - end - - # Sends a notification about a screenshot taken in a chat. - # Supported only in private and secret chats. - # - # @param chat_id [Integer] Chat identifier. + # @param message_thread_id [Integer] If not 0, the message thread identifier in which the action was performed. + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which to + # send the request; for bots only. + # @param action [TD::Types::ChatAction] The action description; pass null to cancel the currently active action. # @return [TD::Types::Ok] - def send_chat_screenshot_taken_notification(chat_id:) - broadcast('@type' => 'sendChatScreenshotTakenNotification', - 'chat_id' => chat_id) + def send_chat_action(chat_id:, message_thread_id:, business_connection_id:, action:) + broadcast('@type' => 'sendChatAction', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id, + 'business_connection_id' => business_connection_id, + 'action' => action) end # Sends a custom request; for bots only. @@ -4010,64 +7348,71 @@ def send_email_address_verification_code(email_address:) # Always clears a chat draft message. # # @param chat_id [Integer] Target chat. - # @param message_thread_id [Integer] If not 0, a message thread identifier in which the message will be sent. - # @param reply_to_message_id [Integer] Identifier of a message to reply to or 0. - # @param options [TD::Types::MessageSendOptions] Options to be used to send the message. + # @param message_thread_id [Integer] If not 0, the message thread identifier in which the message will be sent. + # @param reply_to [TD::Types::InputMessageReplyTo] Information about the message or story to be replied; pass null if + # none. + # @param options [TD::Types::MessageSendOptions] Options to be used to send the message; pass null to use default + # options. # @param query_id [Integer] Identifier of the inline query. - # @param result_id [TD::Types::String] Identifier of the inline result. - # @param hide_via_bot [Boolean] If true, there will be no mention of a bot, via which the message is sent. - # Can be used only for bots GetOption("animation_search_bot_username"), GetOption("photo_search_bot_username") and - # GetOption("venue_search_bot_username"). + # @param result_id [TD::Types::String] Identifier of the inline query result. + # @param hide_via_bot [Boolean] Pass true to hide the bot, via which the message is sent. + # Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and + # getOption("venue_search_bot_username"). # @return [TD::Types::Message] - def send_inline_query_result_message(chat_id:, message_thread_id:, reply_to_message_id:, options:, query_id:, - result_id:, hide_via_bot:) - broadcast('@type' => 'sendInlineQueryResultMessage', - 'chat_id' => chat_id, - 'message_thread_id' => message_thread_id, - 'reply_to_message_id' => reply_to_message_id, - 'options' => options, - 'query_id' => query_id, - 'result_id' => result_id, - 'hide_via_bot' => hide_via_bot) + def send_inline_query_result_message(chat_id:, message_thread_id:, reply_to:, options:, query_id:, result_id:, + hide_via_bot:) + broadcast('@type' => 'sendInlineQueryResultMessage', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id, + 'reply_to' => reply_to, + 'options' => options, + 'query_id' => query_id, + 'result_id' => result_id, + 'hide_via_bot' => hide_via_bot) end # Sends a message. # Returns the sent message. # # @param chat_id [Integer] Target chat. - # @param message_thread_id [Integer] If not 0, a message thread identifier in which the message will be sent. - # @param reply_to_message_id [Integer] Identifier of the message to reply to or 0. - # @param options [TD::Types::MessageSendOptions] Options to be used to send the message. - # @param reply_markup [TD::Types::ReplyMarkup] Markup for replying to the message; for bots only. + # @param message_thread_id [Integer] If not 0, the message thread identifier in which the message will be sent. + # @param reply_to [TD::Types::InputMessageReplyTo] Information about the message or story to be replied; pass null if + # none. + # @param options [TD::Types::MessageSendOptions] Options to be used to send the message; pass null to use default + # options. + # @param reply_markup [TD::Types::ReplyMarkup] Markup for replying to the message; pass null if none; for bots only. # @param input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # @return [TD::Types::Message] - def send_message(chat_id:, message_thread_id:, reply_to_message_id:, options:, reply_markup:, input_message_content:) + def send_message(chat_id:, message_thread_id:, reply_to:, options:, reply_markup:, input_message_content:) broadcast('@type' => 'sendMessage', 'chat_id' => chat_id, 'message_thread_id' => message_thread_id, - 'reply_to_message_id' => reply_to_message_id, + 'reply_to' => reply_to, 'options' => options, 'reply_markup' => reply_markup, 'input_message_content' => input_message_content) end # Sends 2-10 messages grouped together into an album. - # Currently only audio, document, photo and video messages can be grouped into an album. + # Currently, only audio, document, photo and video messages can be grouped into an album. # Documents and audio files can be only grouped in an album with messages of the same type. # Returns sent messages. # # @param chat_id [Integer] Target chat. - # @param message_thread_id [Integer] If not 0, a message thread identifier in which the messages will be sent. - # @param reply_to_message_id [Integer] Identifier of a message to reply to or 0. - # @param options [TD::Types::MessageSendOptions] Options to be used to send the messages. + # @param message_thread_id [Integer] If not 0, the message thread identifier in which the messages will be sent. + # @param reply_to [TD::Types::InputMessageReplyTo] Information about the message or story to be replied; pass null if + # none. + # @param options [TD::Types::MessageSendOptions] Options to be used to send the messages; pass null to use default + # options. # @param input_message_contents [Array] Contents of messages to be sent. # At most 10 messages can be added to an album. + # All messages must have the same value of show_caption_above_media. # @return [TD::Types::Messages] - def send_message_album(chat_id:, message_thread_id:, reply_to_message_id:, options:, input_message_contents:) + def send_message_album(chat_id:, message_thread_id:, reply_to:, options:, input_message_contents:) broadcast('@type' => 'sendMessageAlbum', 'chat_id' => chat_id, 'message_thread_id' => message_thread_id, - 'reply_to_message_id' => reply_to_message_id, + 'reply_to' => reply_to, 'options' => options, 'input_message_contents' => input_message_contents) end @@ -4076,31 +7421,29 @@ def send_message_album(chat_id:, message_thread_id:, reply_to_message_id:, optio # This method must be called after getPassportAuthorizationFormAvailableElements if some previously available # elements are going to be reused. # - # @param autorization_form_id [Integer] Authorization form identifier. + # @param authorization_form_id [Integer] Authorization form identifier. # @param types [Array] Types of Telegram Passport elements chosen by user to complete # the authorization form. # @return [TD::Types::Ok] - def send_passport_authorization_form(autorization_form_id:, types:) - broadcast('@type' => 'sendPassportAuthorizationForm', - 'autorization_form_id' => autorization_form_id, - 'types' => types) + def send_passport_authorization_form(authorization_form_id:, types:) + broadcast('@type' => 'sendPassportAuthorizationForm', + 'authorization_form_id' => authorization_form_id, + 'types' => types) end # Sends a filled-out payment form to the bot for final verification. # - # @param chat_id [Integer] Chat identifier of the Invoice message. - # @param message_id [Integer] Message identifier. + # @param input_invoice [TD::Types::InputInvoice] The invoice. # @param payment_form_id [Integer] Payment form identifier returned by getPaymentForm. # @param order_info_id [TD::Types::String] Identifier returned by validateOrderInfo, or an empty string. # @param shipping_option_id [TD::Types::String] Identifier of a chosen shipping option, if applicable. - # @param credentials [TD::Types::InputCredentials] The credentials chosen by user for payment. + # @param credentials [TD::Types::InputCredentials] The credentials chosen by user for payment; pass null for a + # payment in Telegram Stars. # @param tip_amount [Integer] Chosen by the user amount of tip in the smallest units of the currency. # @return [TD::Types::PaymentResult] - def send_payment_form(chat_id:, message_id:, payment_form_id:, order_info_id:, shipping_option_id:, credentials:, - tip_amount:) + def send_payment_form(input_invoice:, payment_form_id:, order_info_id:, shipping_option_id:, credentials:, tip_amount:) broadcast('@type' => 'sendPaymentForm', - 'chat_id' => chat_id, - 'message_id' => message_id, + 'input_invoice' => input_invoice, 'payment_form_id' => payment_form_id, 'order_info_id' => order_info_id, 'shipping_option_id' => shipping_option_id, @@ -4108,32 +7451,123 @@ def send_payment_form(chat_id:, message_id:, payment_form_id:, order_info_id:, s 'tip_amount' => tip_amount) end - # Sends phone number confirmation code. - # Should be called when user presses "https://t.me/confirmphone?phone=*******&hash=**********" or - # "tg://confirmphone?phone=*******&hash=**********" link. + # Sends a code to the specified phone number. + # Aborts previous phone number verification if there was one. + # On success, returns information about the sent code. # - # @param hash [TD::Types::String] Value of the "hash" parameter from the link. - # @param phone_number [TD::Types::String] Value of the "phone" parameter from the link. + # @param phone_number [TD::Types::String] The phone number, in international format. # @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone - # number. + # number; pass null to use default settings. + # @param type [TD::Types::PhoneNumberCodeType] Type of the request for which the code is sent. # @return [TD::Types::AuthenticationCodeInfo] - def send_phone_number_confirmation_code(hash:, phone_number:, settings:) - broadcast('@type' => 'sendPhoneNumberConfirmationCode', - 'hash' => hash, + def send_phone_number_code(phone_number:, settings:, type:) + broadcast('@type' => 'sendPhoneNumberCode', 'phone_number' => phone_number, - 'settings' => settings) + 'settings' => settings, + 'type' => type) end - # Sends a code to verify a phone number to be added to a user's Telegram Passport. + # Sends Firebase Authentication SMS to the specified phone number. + # Works only when received a code of the type authenticationCodeTypeFirebaseAndroid or + # authenticationCodeTypeFirebaseIos. # - # @param phone_number [TD::Types::String] The phone number of the user, in international format. - # @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone - # number. - # @return [TD::Types::AuthenticationCodeInfo] - def send_phone_number_verification_code(phone_number:, settings:) - broadcast('@type' => 'sendPhoneNumberVerificationCode', - 'phone_number' => phone_number, - 'settings' => settings) + # @param token [TD::Types::String] Play Integrity API or SafetyNet Attestation API token for the Android application, + # or secret from push notification for the iOS application. + # @return [TD::Types::Ok] + def send_phone_number_firebase_sms(token:) + broadcast('@type' => 'sendPhoneNumberFirebaseSms', + 'token' => token) + end + + # Sends messages from a quick reply shortcut. + # Requires Telegram Business subscription. + # + # @param chat_id [Integer] Identifier of the chat to which to send messages. + # The chat must be a private chat with a regular user. + # @param shortcut_id [Integer] Unique identifier of the quick reply shortcut. + # @param sending_id [Integer] Non-persistent identifier, which will be returned back in + # {TD::Types::MessageSendingState::Pending} object and can be used to match sent messages and corresponding + # {TD::Types::Update::NewMessage} updates. + # @return [TD::Types::Messages] + def send_quick_reply_shortcut_messages(chat_id:, shortcut_id:, sending_id:) + broadcast('@type' => 'sendQuickReplyShortcutMessages', + 'chat_id' => chat_id, + 'shortcut_id' => shortcut_id, + 'sending_id' => sending_id) + end + + # Sends a new story to a chat; requires can_post_stories right for supergroup and channel chats. + # Returns a temporary story. + # + # @param chat_id [Integer] Identifier of the chat that will post the story. + # Pass Saved Messages chat identifier when posting a story on behalf of the current user. + # @param content [TD::Types::InputStoryContent] Content of the story. + # @param areas [TD::Types::InputStoryAreas] Clickable rectangle areas to be shown on the story media; pass null if + # none. + # @param caption [TD::Types::FormattedText] Story caption; pass null to use an empty caption; + # 0-getOption("story_caption_length_max") characters; can have entities only if + # getOption("can_use_text_entities_in_story_caption"). + # @param privacy_settings [TD::Types::StoryPrivacySettings] The privacy settings for the story; ignored for stories + # sent to supergroup and channel chats. + # @param active_period [Integer] Period after which the story is moved to archive, in seconds; must be one of 6 * + # 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise. + # @param from_story_full_id [TD::Types::StoryFullId] Full identifier of the original story, which content was used to + # create the story; pass null if the story isn't repost of another story. + # @param is_posted_to_chat_page [Boolean] Pass true to keep the story accessible after expiration. + # @param protect_content [Boolean] Pass true if the content of the story must be protected from forwarding and + # screenshotting. + # @return [TD::Types::Story] + def send_story(chat_id:, content:, areas:, caption:, privacy_settings:, active_period:, from_story_full_id:, + is_posted_to_chat_page:, protect_content:) + broadcast('@type' => 'sendStory', + 'chat_id' => chat_id, + 'content' => content, + 'areas' => areas, + 'caption' => caption, + 'privacy_settings' => privacy_settings, + 'active_period' => active_period, + 'from_story_full_id' => from_story_full_id, + 'is_posted_to_chat_page' => is_posted_to_chat_page, + 'protect_content' => protect_content) + end + + # Sends a custom request from a Web App. + # + # @param bot_user_id [Integer] Identifier of the bot. + # @param method [TD::Types::String] The method name. + # @param parameters [TD::Types::String] JSON-serialized method parameters. + # @return [TD::Types::CustomRequestResult] + def send_web_app_custom_request(bot_user_id:, method:, parameters:) + broadcast('@type' => 'sendWebAppCustomRequest', + 'bot_user_id' => bot_user_id, + 'method' => method, + 'parameters' => parameters) + end + + # Sends data received from a keyboardButtonTypeWebApp Web App to a bot. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param button_text [TD::Types::String] Text of the {TD::Types::KeyboardButtonType::WebApp} button, which opened the + # Web App. + # @param data [TD::Types::String] The data. + # @return [TD::Types::Ok] + def send_web_app_data(bot_user_id:, button_text:, data:) + broadcast('@type' => 'sendWebAppData', + 'bot_user_id' => bot_user_id, + 'button_text' => button_text, + 'data' => data) + end + + # Changes accent color and background custom emoji for the current user; for Telegram Premium users only. + # + # @param accent_color_id [Integer] Identifier of the accent color to use. + # @param background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the reply header and link + # preview background; 0 if none. + # @return [TD::Types::Ok] + def set_accent_color(accent_color_id:, background_custom_emoji_id:) + broadcast('@type' => 'setAccentColor', + 'accent_color_id' => accent_color_id, + 'background_custom_emoji_id' => background_custom_emoji_id) end # Changes the period of inactivity after which the account of the current user will automatically be deleted. @@ -4155,14 +7589,48 @@ def set_alarm(seconds:) 'seconds' => seconds) end + # Application verification has been completed. + # Can be called before authorization. + # + # @param verification_id [Integer] Unique identifier for the verification process as received from + # updateApplicationVerificationRequired. + # @param token [TD::Types::String] Play Integrity API token for the Android application, or secret from push + # notification for the iOS application;. + # @return [TD::Types::Ok] + def set_application_verification_token(verification_id:, token:) + broadcast('@type' => 'setApplicationVerificationToken', + 'verification_id' => verification_id, + 'token' => token) + end + + # Changes settings for automatic moving of chats to and from the Archive chat lists. + # + # @param settings [TD::Types::ArchiveChatListSettings] New settings. + # @return [TD::Types::Ok] + def set_archive_chat_list_settings(settings:) + broadcast('@type' => 'setArchiveChatListSettings', + 'settings' => settings) + end + + # Sets the email address of the user and sends an authentication code to the email address. + # Works only when the current authorization state is authorizationStateWaitEmailAddress. + # + # @param email_address [TD::Types::String] The email address of the user. + # @return [TD::Types::Ok] + def set_authentication_email_address(email_address:) + broadcast('@type' => 'setAuthenticationEmailAddress', + 'email_address' => email_address) + end + # Sets the phone number of the user and sends an authentication code to the user. # Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending - # authentication query and the current authorization state is authorizationStateWaitCode, - # authorizationStateWaitRegistration, or authorizationStateWaitPassword. + # authentication query and the current authorization state is authorizationStateWaitEmailAddress, + # authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or + # authorizationStateWaitPassword. # # @param phone_number [TD::Types::String] The phone number of the user, in international format. # @param settings [TD::Types::PhoneNumberAuthenticationSettings] Settings for the authentication of the user's phone - # number. + # number; pass null to use default settings. # @return [TD::Types::Ok] def set_authentication_phone_number(phone_number:, settings:) broadcast('@type' => 'setAuthenticationPhoneNumber', @@ -4173,7 +7641,7 @@ def set_authentication_phone_number(phone_number:, settings:) # Sets auto-download settings. # # @param settings [TD::Types::AutoDownloadSettings] New user auto-download settings. - # @param type [TD::Types::NetworkType] Type of the network for which the new settings are applied. + # @param type [TD::Types::NetworkType] Type of the network for which the new settings are relevant. # @return [TD::Types::Ok] def set_auto_download_settings(settings:, type:) broadcast('@type' => 'setAutoDownloadSettings', @@ -4181,29 +7649,96 @@ def set_auto_download_settings(settings:, type:) 'type' => type) end - # Changes the background selected by the user; adds background to the list of installed backgrounds. + # Sets autosave settings for the given scope. + # The method is guaranteed to work only after at least one call to getAutosaveSettings. # - # @param background [TD::Types::InputBackground] The input background to use, null for filled backgrounds. - # @param type [TD::Types::BackgroundType] Background type; null for default background. - # The method will return error 404 if type is null. - # @param for_dark_theme [Boolean] True, if the background is chosen for dark theme. - # @return [TD::Types::Background] - def set_background(background:, type:, for_dark_theme:) - broadcast('@type' => 'setBackground', - 'background' => background, - 'type' => type, - 'for_dark_theme' => for_dark_theme) + # @param scope [TD::Types::AutosaveSettingsScope] Autosave settings scope. + # @param settings [TD::Types::ScopeAutosaveSettings] New autosave settings for the scope; pass null to set autosave + # settings to default. + # @return [TD::Types::Ok] + def set_autosave_settings(scope:, settings:) + broadcast('@type' => 'setAutosaveSettings', + 'scope' => scope, + 'settings' => settings) end # Changes the bio of the current user. # - # @param bio [TD::Types::String] The new value of the user bio; 0-70 characters without line feeds. + # @param bio [TD::Types::String] The new value of the user bio; 0-getOption("bio_length_max") characters without line + # feeds. # @return [TD::Types::Ok] def set_bio(bio:) broadcast('@type' => 'setBio', 'bio' => bio) end + # Changes the birthdate of the current user. + # + # @param birthdate [TD::Types::Birthdate] The new value of the current user's birthdate; pass null to remove the + # birthdate. + # @return [TD::Types::Ok] + def set_birthdate(birthdate:) + broadcast('@type' => 'setBirthdate', + 'birthdate' => birthdate) + end + + # Sets the text shown in the chat with a bot if the chat is empty. + # Can be called only if userTypeBot.can_be_edited == true. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code. + # If empty, the description will be shown to all users for whose languages there is no dedicated description. + # @param description [TD::Types::String] New bot's description on the specified language. + # @return [TD::Types::Ok] + def set_bot_info_description(bot_user_id:, language_code:, description:) + broadcast('@type' => 'setBotInfoDescription', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code, + 'description' => description) + end + + # Sets the text shown on a bot's profile page and sent together with the link when users share the bot. + # Can be called only if userTypeBot.can_be_edited == true. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code. + # If empty, the short description will be shown to all users for whose languages there is no dedicated description. + # @param short_description [TD::Types::String] New bot's short description on the specified language. + # @return [TD::Types::Ok] + def set_bot_info_short_description(bot_user_id:, language_code:, short_description:) + broadcast('@type' => 'setBotInfoShortDescription', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code, + 'short_description' => short_description) + end + + # Sets the name of a bot. + # Can be called only if userTypeBot.can_be_edited == true. + # + # @param bot_user_id [Integer, nil] Identifier of the target bot. + # @param language_code [TD::Types::String, nil] A two-letter ISO 639-1 language code. + # If empty, the name will be shown to all users for whose languages there is no dedicated name. + # @param name [TD::Types::String] New bot's name on the specified language; 0-64 characters; must be non-empty if + # language code is empty. + # @return [TD::Types::Ok] + def set_bot_name(bot_user_id: nil, language_code: nil, name:) + broadcast('@type' => 'setBotName', + 'bot_user_id' => bot_user_id, + 'language_code' => language_code, + 'name' => name) + end + + # Changes a profile photo for a bot. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param photo [TD::Types::InputChatPhoto] Profile photo to set; pass null to delete the chat photo. + # @return [TD::Types::Ok] + def set_bot_profile_photo(bot_user_id:, photo:) + broadcast('@type' => 'setBotProfilePhoto', + 'bot_user_id' => bot_user_id, + 'photo' => photo) + end + # Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots # only. # @@ -4216,6 +7751,156 @@ def set_bot_updates_status(pending_update_count:, error_message:) 'error_message' => error_message) end + # Changes the business away message settings of the current user. + # Requires Telegram Business subscription. + # + # @param away_message_settings [TD::Types::BusinessAwayMessageSettings] The new settings for the away message of the + # business; pass null to disable the away message. + # @return [TD::Types::Ok] + def set_business_away_message_settings(away_message_settings:) + broadcast('@type' => 'setBusinessAwayMessageSettings', + 'away_message_settings' => away_message_settings) + end + + # Adds or changes business bot that is connected to the current user account. + # + # @param bot [TD::Types::BusinessConnectedBot] Connection settings for the bot. + # @return [TD::Types::Ok] + def set_business_connected_bot(bot:) + broadcast('@type' => 'setBusinessConnectedBot', + 'bot' => bot) + end + + # Changes the business greeting message settings of the current user. + # Requires Telegram Business subscription. + # + # @param greeting_message_settings [TD::Types::BusinessGreetingMessageSettings] The new settings for the greeting + # message of the business; pass null to disable the greeting message. + # @return [TD::Types::Ok] + def set_business_greeting_message_settings(greeting_message_settings:) + broadcast('@type' => 'setBusinessGreetingMessageSettings', + 'greeting_message_settings' => greeting_message_settings) + end + + # Changes the business location of the current user. + # Requires Telegram Business subscription. + # + # @param location [TD::Types::BusinessLocation] The new location of the business; pass null to remove the location. + # @return [TD::Types::Ok] + def set_business_location(location:) + broadcast('@type' => 'setBusinessLocation', + 'location' => location) + end + + # Pins or unpins a message sent on behalf of a business account; for bots only. + # + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which the + # message was sent. + # @param chat_id [Integer] The chat the message belongs to. + # @param message_id [Integer] Identifier of the message. + # @param is_pinned [Boolean] Pass true to pin the message, pass false to unpin it. + # @return [TD::Types::Ok] + def set_business_message_is_pinned(business_connection_id:, chat_id:, message_id:, is_pinned:) + broadcast('@type' => 'setBusinessMessageIsPinned', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'message_id' => message_id, + 'is_pinned' => is_pinned) + end + + # Changes the business opening hours of the current user. + # Requires Telegram Business subscription. + # + # @param opening_hours [TD::Types::BusinessOpeningHours] The new opening hours of the business; pass null to remove + # the opening hours; up to 28 time intervals can be specified. + # @return [TD::Types::Ok] + def set_business_opening_hours(opening_hours:) + broadcast('@type' => 'setBusinessOpeningHours', + 'opening_hours' => opening_hours) + end + + # Changes the business start page of the current user. + # Requires Telegram Business subscription. + # + # @param start_page [TD::Types::InputBusinessStartPage] The new start page of the business; pass null to remove + # custom start page. + # @return [TD::Types::Ok] + def set_business_start_page(start_page:) + broadcast('@type' => 'setBusinessStartPage', + 'start_page' => start_page) + end + + # Changes accent color and background custom emoji of a channel chat. + # Requires can_change_info administrator right. + # + # @param chat_id [Integer] Chat identifier. + # @param accent_color_id [Integer] Identifier of the accent color to use. + # The chat must have at least accentColor.min_channel_chat_boost_level boost level to pass the corresponding color. + # @param background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the reply header and link + # preview background; 0 if none. + # Use chatBoostLevelFeatures.can_set_background_custom_emoji to check whether a custom emoji can be set. + # @return [TD::Types::Ok] + def set_chat_accent_color(chat_id:, accent_color_id:, background_custom_emoji_id:) + broadcast('@type' => 'setChatAccentColor', + 'chat_id' => chat_id, + 'accent_color_id' => accent_color_id, + 'background_custom_emoji_id' => background_custom_emoji_id) + end + + # Changes story list in which stories from the chat are shown. + # + # @param chat_id [Integer] Identifier of the chat that posted stories. + # @param story_list [TD::Types::StoryList] New list for active stories posted by the chat. + # @return [TD::Types::Ok] + def set_chat_active_stories_list(chat_id:, story_list:) + broadcast('@type' => 'setChatActiveStoriesList', + 'chat_id' => chat_id, + 'story_list' => story_list) + end + + # Changes reactions, available in a chat. + # Available for basic groups, supergroups, and channels. + # Requires can_change_info member right. + # + # @param chat_id [Integer] Identifier of the chat. + # @param available_reactions [TD::Types::ChatAvailableReactions] Reactions available in the chat. + # All explicitly specified emoji reactions must be active. + # In channel chats up to the chat's boost level custom emoji reactions can be explicitly specified. + # @return [TD::Types::Ok] + def set_chat_available_reactions(chat_id:, available_reactions:) + broadcast('@type' => 'setChatAvailableReactions', + 'chat_id' => chat_id, + 'available_reactions' => available_reactions) + end + + # Sets the background in a specific chat. + # Supported only in private and secret chats with non-deleted users, and in chats with sufficient boost level and + # can_change_info administrator right. + # + # @param chat_id [Integer] Chat identifier. + # @param background [TD::Types::InputBackground] The input background to use; pass null to create a new filled or + # chat theme background. + # @param type [TD::Types::BackgroundType] Background type; pass null to use default background type for the chosen + # background; {TD::Types::BackgroundType::ChatTheme} isn't supported for private and secret chats. + # Use chatBoostLevelFeatures.chat_theme_background_count and chatBoostLevelFeatures.can_set_custom_background to + # check whether the background type can be set in the boosted chat. + # @param dark_theme_dimming [Integer] Dimming of the background in dark themes, as a percentage; 0-100. + # Applied only to Wallpaper and Fill types of background. + # @param only_for_self [Boolean] Pass true to set background only for self; pass false to set background for all chat + # users. + # Always false for backgrounds set in boosted chats. + # Background can be set for both users only by Telegram Premium users and if set background isn't of the type + # inputBackgroundPrevious. + # @return [TD::Types::Ok] + def set_chat_background(chat_id:, background:, type:, dark_theme_dimming:, only_for_self:) + broadcast('@type' => 'setChatBackground', + 'chat_id' => chat_id, + 'background' => background, + 'type' => type, + 'dark_theme_dimming' => dark_theme_dimming, + 'only_for_self' => only_for_self) + end + # Changes application-specific data associated with a chat. # # @param chat_id [Integer] Chat identifier. @@ -4229,7 +7914,7 @@ def set_chat_client_data(chat_id:, client_data:) # Changes information about a chat. # Available for basic groups, supergroups, and channels. - # Requires can_change_info administrator right. + # Requires can_change_info member right. # # @param chat_id [Integer] Identifier of the chat. # @param description [TD::Types::String] New chat description; 0-255 characters. @@ -4245,7 +7930,7 @@ def set_chat_description(chat_id:, description:) # # @param chat_id [Integer] Identifier of the channel chat. # Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires - # can_pin_messages rights in the supergroup). + # can_pin_messages member right in the supergroup). # @param discussion_chat_id [Integer] Identifier of a new channel's discussion group. # Use 0 to remove the discussion group. # Use the method getSuitableDiscussionChats to find all suitable groups. @@ -4262,16 +7947,31 @@ def set_chat_discussion_group(chat_id:, discussion_chat_id:) # Changes the draft message in a chat. # # @param chat_id [Integer] Chat identifier. - # @param message_thread_id [Integer] If not 0, a message thread identifier in which the draft was changed. - # @param draft_message [TD::Types::DraftMessage, nil] New draft message; may be null. + # @param message_thread_id [Integer] If not 0, the message thread identifier in which the draft was changed. + # @param draft_message [TD::Types::DraftMessage] New draft message; pass null to remove the draft. + # All files in draft message content must be of the type inputFileLocal. + # Media thumbnails and captions are ignored. # @return [TD::Types::Ok] - def set_chat_draft_message(chat_id:, message_thread_id:, draft_message: nil) + def set_chat_draft_message(chat_id:, message_thread_id:, draft_message:) broadcast('@type' => 'setChatDraftMessage', 'chat_id' => chat_id, 'message_thread_id' => message_thread_id, 'draft_message' => draft_message) end + # Changes the emoji status of a chat. + # Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can be set. + # Requires can_change_info administrator right. + # + # @param chat_id [Integer] Chat identifier. + # @param emoji_status [TD::Types::EmojiStatus] New emoji status; pass null to remove emoji status. + # @return [TD::Types::Ok] + def set_chat_emoji_status(chat_id:, emoji_status:) + broadcast('@type' => 'setChatEmojiStatus', + 'chat_id' => chat_id, + 'emoji_status' => emoji_status) + end + # Changes the location of a chat. # Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the # method is allowed to use. @@ -4285,9 +7985,11 @@ def set_chat_location(chat_id:, location:) 'location' => location) end - # Changes the status of a chat member, needs appropriate privileges. - # This function is currently not suitable for adding new members to the chat and transferring chat ownership; - # instead, use addChatMember or transferChatOwnership. + # Changes the status of a chat member; requires can_invite_users member right to add a chat member, + # can_promote_members administrator right to change administrator rights of the member, and can_restrict_members + # administrator right to change restrictions of a user. + # This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. + # Use addChatMember or banChatMember if some additional parameters needs to be passed. # # @param chat_id [Integer] Chat identifier. # @param member_id [TD::Types::MessageSender] Member identifier. @@ -4301,17 +8003,30 @@ def set_chat_member_status(chat_id:, member_id:, status:) 'status' => status) end - # Changes the message TTL setting (sets a new self-destruct timer) in a chat. - # Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL setting of a - # chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be changed. + # Changes the message auto-delete or self-destruct (for secret chats) time in a chat. + # Requires change_info administrator right in basic groups, supergroups and channels Message auto-delete time can't + # be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).. # # @param chat_id [Integer] Chat identifier. - # @param ttl [Integer] New TTL value, in seconds; must be one of 0, 86400, 604800 unless chat is secret. + # @param message_auto_delete_time [Integer] New time value, in seconds; unless the chat is secret, it must be from 0 + # up to 365 * 86400 and be divisible by 86400. + # If 0, then messages aren't deleted automatically. # @return [TD::Types::Ok] - def set_chat_message_ttl_setting(chat_id:, ttl:) - broadcast('@type' => 'setChatMessageTtlSetting', - 'chat_id' => chat_id, - 'ttl' => ttl) + def set_chat_message_auto_delete_time(chat_id:, message_auto_delete_time:) + broadcast('@type' => 'setChatMessageAutoDeleteTime', + 'chat_id' => chat_id, + 'message_auto_delete_time' => message_auto_delete_time) + end + + # Selects a message sender to send messages in a chat. + # + # @param chat_id [Integer] Chat identifier. + # @param message_sender_id [TD::Types::MessageSender] New message sender for the chat. + # @return [TD::Types::Ok] + def set_chat_message_sender(chat_id:, message_sender_id:) + broadcast('@type' => 'setChatMessageSender', + 'chat_id' => chat_id, + 'message_sender_id' => message_sender_id) end # Changes the notification settings of a chat. @@ -4319,7 +8034,7 @@ def set_chat_message_ttl_setting(chat_id:, ttl:) # # @param chat_id [Integer] Chat identifier. # @param notification_settings [TD::Types::ChatNotificationSettings] New notification settings for the chat. - # If the chat is muted for more than 1 week, it is considered to be muted forever. + # If the chat is muted for more than 366 days, it is considered to be muted forever. # @return [TD::Types::Ok] def set_chat_notification_settings(chat_id:, notification_settings:) broadcast('@type' => 'setChatNotificationSettings', @@ -4342,11 +8057,10 @@ def set_chat_permissions(chat_id:, permissions:) # Changes the photo of a chat. # Supported only for basic groups, supergroups and channels. - # Requires can_change_info administrator right. + # Requires can_change_info member right. # # @param chat_id [Integer] Chat identifier. - # @param photo [TD::Types::InputChatPhoto] New chat photo. - # Pass null to delete the chat photo. + # @param photo [TD::Types::InputChatPhoto] New chat photo; pass null to delete the chat photo. # @return [TD::Types::Ok] def set_chat_photo(chat_id:, photo:) broadcast('@type' => 'setChatPhoto', @@ -4354,11 +8068,43 @@ def set_chat_photo(chat_id:, photo:) 'photo' => photo) end + # Changes the list of pinned stories on a chat page; requires can_edit_stories right in the chat. + # + # @param chat_id [Integer] Identifier of the chat that posted the stories. + # @param story_ids [Array] New list of pinned stories. + # All stories must be posted to the chat page first. + # There can be up to getOption("pinned_story_count_max") pinned stories on a chat page. + # @return [TD::Types::Ok] + def set_chat_pinned_stories(chat_id:, story_ids:) + broadcast('@type' => 'setChatPinnedStories', + 'chat_id' => chat_id, + 'story_ids' => story_ids) + end + + # Changes accent color and background custom emoji for profile of a supergroup or channel chat. + # Requires can_change_info administrator right. + # + # @param chat_id [Integer] Chat identifier. + # @param profile_accent_color_id [Integer] Identifier of the accent color to use for profile; pass -1 if none. + # The chat must have at least profileAccentColor.min_supergroup_chat_boost_level for supergroups or + # profileAccentColor.min_channel_chat_boost_level for channels boost level to pass the corresponding color. + # @param profile_background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the chat's profile + # photo background; 0 if none. + # Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set. + # @return [TD::Types::Ok] + def set_chat_profile_accent_color(chat_id:, profile_accent_color_id:, profile_background_custom_emoji_id:) + broadcast('@type' => 'setChatProfileAccentColor', + 'chat_id' => chat_id, + 'profile_accent_color_id' => profile_accent_color_id, + 'profile_background_custom_emoji_id' => profile_background_custom_emoji_id) + end + # Changes the slow mode delay of a chat. - # Available only for supergroups; requires can_restrict_members rights. + # Available only for supergroups; requires can_restrict_members right. # # @param chat_id [Integer] Chat identifier. - # @param slow_mode_delay [Integer] New slow mode delay for the chat; must be one of 0, 10, 30, 60, 300, 900, 3600. + # @param slow_mode_delay [Integer] New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, + # 900, 3600. # @return [TD::Types::Ok] def set_chat_slow_mode_delay(chat_id:, slow_mode_delay:) broadcast('@type' => 'setChatSlowModeDelay', @@ -4366,9 +8112,21 @@ def set_chat_slow_mode_delay(chat_id:, slow_mode_delay:) 'slow_mode_delay' => slow_mode_delay) end + # Changes the chat theme. + # Supported only in private and secret chats. + # + # @param chat_id [Integer] Chat identifier. + # @param theme_name [TD::Types::String] Name of the new chat theme; pass an empty string to return the default theme. + # @return [TD::Types::Ok] + def set_chat_theme(chat_id:, theme_name:) + broadcast('@type' => 'setChatTheme', + 'chat_id' => chat_id, + 'theme_name' => theme_name) + end + # Changes the chat title. # Supported only for basic groups, supergroups and channels. - # Requires can_change_info administrator right. + # Requires can_change_info member right. # # @param chat_id [Integer] Chat identifier. # @param title [TD::Types::String] New title of the chat; 1-128 characters. @@ -4379,20 +8137,49 @@ def set_chat_title(chat_id:, title:) 'title' => title) end - # Sets the list of commands supported by the bot; for bots only. + # Changes the list of close friends of the current user. # + # @param user_ids [Array] User identifiers of close friends; the users must be contacts of the current user. + # @return [TD::Types::Ok] + def set_close_friends(user_ids:) + broadcast('@type' => 'setCloseFriends', + 'user_ids' => user_ids) + end + + # Sets the list of commands supported by the bot for the given user scope and language; for bots only. + # + # @param scope [TD::Types::BotCommandScope] The scope to which the commands are relevant; pass null to change + # commands in the default bot command scope. + # @param language_code [TD::Types::String] A two-letter ISO 639-1 language code. + # If empty, the commands will be applied to all users from the given scope, for which language there are no + # dedicated commands. # @param commands [Array] List of the bot's commands. # @return [TD::Types::Ok] - def set_commands(commands:) - broadcast('@type' => 'setCommands', - 'commands' => commands) + def set_commands(scope:, language_code:, commands:) + broadcast('@type' => 'setCommands', + 'scope' => scope, + 'language_code' => language_code, + 'commands' => commands) + end + + # Sets a custom emoji sticker set thumbnail. + # + # @param name [TD::Types::String] Sticker set name. + # The sticker set must be owned by the current user. + # @param custom_emoji_id [Integer] Identifier of the custom emoji from the sticker set, which will be set as sticker + # set thumbnail; pass 0 to remove the sticker set thumbnail. + # @return [TD::Types::Ok] + def set_custom_emoji_sticker_set_thumbnail(name:, custom_emoji_id:) + broadcast('@type' => 'setCustomEmojiStickerSetThumbnail', + 'name' => name, + 'custom_emoji_id' => custom_emoji_id) end # Adds or changes a custom local language pack to the current localization target. # # @param info [TD::Types::LanguagePackInfo] Information about the language pack. - # Language pack ID must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 - # characters. + # Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not + # exceed 64 characters. # Can be called before authorization. # @param strings [Array] Strings of the new language pack. # @return [TD::Types::Ok] @@ -4425,6 +8212,71 @@ def set_database_encryption_key(new_encryption_key:) 'new_encryption_key' => new_encryption_key) end + # Sets default background for chats; adds the background to the list of installed backgrounds. + # + # @param background [TD::Types::InputBackground] The input background to use; pass null to create a new filled + # background. + # @param type [TD::Types::BackgroundType] Background type; pass null to use the default type of the remote + # background; {TD::Types::BackgroundType::ChatTheme} isn't supported. + # @param for_dark_theme [Boolean] Pass true if the background is set for a dark theme. + # @return [TD::Types::Background] + def set_default_background(background:, type:, for_dark_theme:) + broadcast('@type' => 'setDefaultBackground', + 'background' => background, + 'type' => type, + 'for_dark_theme' => for_dark_theme) + end + + # Sets default administrator rights for adding the bot to channel chats; for bots only. + # + # @param default_channel_administrator_rights [TD::Types::ChatAdministratorRights] Default administrator rights for + # adding the bot to channels; pass null to remove default rights. + # @return [TD::Types::Ok] + def set_default_channel_administrator_rights(default_channel_administrator_rights:) + broadcast('@type' => 'setDefaultChannelAdministratorRights', + 'default_channel_administrator_rights' => default_channel_administrator_rights) + end + + # Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only. + # + # @param default_group_administrator_rights [TD::Types::ChatAdministratorRights] Default administrator rights for + # adding the bot to basic group and supergroup chats; pass null to remove default rights. + # @return [TD::Types::Ok] + def set_default_group_administrator_rights(default_group_administrator_rights:) + broadcast('@type' => 'setDefaultGroupAdministratorRights', + 'default_group_administrator_rights' => default_group_administrator_rights) + end + + # Changes the default message auto-delete time for new chats. + # + # @param message_auto_delete_time [TD::Types::MessageAutoDeleteTime] New default message auto-delete time; must be + # from 0 up to 365 * 86400 and be divisible by 86400. + # If 0, then messages aren't deleted automatically. + # @return [TD::Types::Ok] + def set_default_message_auto_delete_time(message_auto_delete_time:) + broadcast('@type' => 'setDefaultMessageAutoDeleteTime', + 'message_auto_delete_time' => message_auto_delete_time) + end + + # Changes type of default reaction for the current user. + # + # @param reaction_type [TD::Types::ReactionType] New type of the default reaction. + # The paid reaction can't be set as default. + # @return [TD::Types::Ok] + def set_default_reaction_type(reaction_type:) + broadcast('@type' => 'setDefaultReactionType', + 'reaction_type' => reaction_type) + end + + # Changes the emoji status of the current user; for Telegram Premium users only. + # + # @param emoji_status [TD::Types::EmojiStatus] New emoji status; pass null to switch to the default badge. + # @return [TD::Types::Ok] + def set_emoji_status(emoji_status:) + broadcast('@type' => 'setEmojiStatus', + 'emoji_status' => emoji_status) + end + # Informs TDLib on a file generation progress. # # @param generation_id [Integer] The identifier of the generation process. @@ -4438,11 +8290,25 @@ def set_file_generation_progress(generation_id:, expected_size:, local_prefix_si 'local_prefix_size' => local_prefix_size) end - # Updates the game score of the specified user in the game; for bots only. + # Changes the notification settings of a forum topic. # - # @param chat_id [Integer] The chat to which the message with the game belongs. + # @param chat_id [Integer] Chat identifier. + # @param message_thread_id [Integer] Message thread identifier of the forum topic. + # @param notification_settings [TD::Types::ChatNotificationSettings] New notification settings for the forum topic. + # If the topic is muted for more than 366 days, it is considered to be muted forever. + # @return [TD::Types::Ok] + def set_forum_topic_notification_settings(chat_id:, message_thread_id:, notification_settings:) + broadcast('@type' => 'setForumTopicNotificationSettings', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id, + 'notification_settings' => notification_settings) + end + + # Updates the game score of the specified user in the game; for bots only. + # + # @param chat_id [Integer] The chat to which the message with the game belongs. # @param message_id [Integer] Identifier of the message. - # @param edit_message [Boolean] True, if the message should be edited. + # @param edit_message [Boolean] Pass true to edit the game message to include the current scoreboard. # @param user_id [Integer] User identifier. # @param score [Integer] The new score. # @param force [Boolean] Pass true to update the score even if it decreases. @@ -4458,22 +8324,23 @@ def set_game_score(chat_id:, message_id:, edit_message:, user_id:, score:, force 'force' => force) end - # Informs TDLib that a participant of an active group call speaking state has changed. + # Informs TDLib that speaking state of a participant of an active group has changed. # # @param group_call_id [Integer] Group call identifier. - # @param source [Integer] Group call participant's synchronization source identifier, or 0 for the current user. - # @param is_speaking [Boolean] True, if the user is speaking. + # @param audio_source [Integer] Group call participant's synchronization audio source identifier, or 0 for the + # current user. + # @param is_speaking [Boolean] Pass true if the user is speaking. # @return [TD::Types::Ok] - def set_group_call_participant_is_speaking(group_call_id:, source:, is_speaking:) + def set_group_call_participant_is_speaking(group_call_id:, audio_source:, is_speaking:) broadcast('@type' => 'setGroupCallParticipantIsSpeaking', 'group_call_id' => group_call_id, - 'source' => source, + 'audio_source' => audio_source, 'is_speaking' => is_speaking) end # Changes volume level of a participant of an active group call. # If the current user can manage the group call, then the participant's volume level will be changed for all users - # with default volume level. + # with the default volume level. # # @param group_call_id [Integer] Group call identifier. # @param participant_id [TD::Types::MessageSender] Participant identifier. @@ -4498,10 +8365,20 @@ def set_group_call_title(group_call_id:, title:) 'title' => title) end + # Changes the period of inactivity after which sessions will automatically be terminated. + # + # @param inactive_session_ttl_days [Integer] New number of days of inactivity before sessions will be automatically + # terminated; 1-366 days. + # @return [TD::Types::Ok] + def set_inactive_session_ttl(inactive_session_ttl_days:) + broadcast('@type' => 'setInactiveSessionTtl', + 'inactive_session_ttl_days' => inactive_session_ttl_days) + end + # Updates the game score of the specified user in a game; for bots only. # # @param inline_message_id [TD::Types::String] Inline message identifier. - # @param edit_message [Boolean] True, if the message should be edited. + # @param edit_message [Boolean] Pass true to edit the game message to include the current scoreboard. # @param user_id [Integer] User identifier. # @param score [Integer] The new score. # @param force [Boolean] Pass true to update the score even if it decreases. @@ -4517,7 +8394,8 @@ def set_inline_game_score(inline_message_id:, edit_message:, user_id:, score:, f end # Changes the location of the current user. - # Needs to be called if GetOption("is_location_visible") is true and location changes for more than 1 kilometer. + # Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer. + # Must not be called if the user has a business location. # # @param location [TD::Types::Location] The new location of the user. # @return [TD::Types::Ok] @@ -4561,10 +8439,78 @@ def set_log_verbosity_level(new_verbosity_level:) 'new_verbosity_level' => new_verbosity_level) end + # Changes the login email address of the user. + # The email address can be changed only if the current user already has login email and + # passwordState.login_email_address_pattern is non-empty. + # The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. + # To use Apple ID/Google ID instead of an email address, call checkLoginEmailAddressCode directly. + # + # @param new_login_email_address [TD::Types::String] New login email address. + # @return [TD::Types::EmailAddressAuthenticationCodeInfo] + def set_login_email_address(new_login_email_address:) + broadcast('@type' => 'setLoginEmailAddress', + 'new_login_email_address' => new_login_email_address) + end + + # Sets menu button for the given user or for all users; for bots only. + # + # @param user_id [Integer] Identifier of the user or 0 to set menu button for all users. + # @param menu_button [TD::Types::BotMenuButton] New menu button. + # @return [TD::Types::Ok] + def set_menu_button(user_id:, menu_button:) + broadcast('@type' => 'setMenuButton', + 'user_id' => user_id, + 'menu_button' => menu_button) + end + + # Changes the fact-check of a message. + # Can be only used if messageProperties.can_set_fact_check == true. + # + # @param chat_id [Integer] The channel chat the message belongs to. + # @param message_id [Integer] Identifier of the message. + # @param text [TD::Types::FormattedText] New text of the fact-check; 0-getOption("fact_check_length_max") characters; + # pass null to remove it. + # Only Bold, Italic, and TextUrl entities with https://t.me/ links are supported. + # @return [TD::Types::Ok] + def set_message_fact_check(chat_id:, message_id:, text:) + broadcast('@type' => 'setMessageFactCheck', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'text' => text) + end + + # Sets reactions on a message; for bots only. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @param reaction_types [Array] Types of the reaction to set. + # @param is_big [Boolean] Pass true if the reactions are added with a big animation. + # @return [TD::Types::Ok] + def set_message_reactions(chat_id:, message_id:, reaction_types:, is_big:) + broadcast('@type' => 'setMessageReactions', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reaction_types' => reaction_types, + 'is_big' => is_big) + end + + # Changes the block list of a message sender. + # Currently, only users and supergroup chats can be blocked. + # + # @param sender_id [TD::Types::MessageSender] Identifier of a message sender to block/unblock. + # @param block_list [TD::Types::BlockList] New block list for the message sender; pass null to unblock the message + # sender. + # @return [TD::Types::Ok] + def set_message_sender_block_list(sender_id:, block_list:) + broadcast('@type' => 'setMessageSenderBlockList', + 'sender_id' => sender_id, + 'block_list' => block_list) + end + # Changes the first and last name of the current user. # - # @param first_name [TD::Types::String] The new value of the first name for the user; 1-64 characters. - # @param last_name [TD::Types::String] The new value of the optional last name for the user; 0-64 characters. + # @param first_name [TD::Types::String] The new value of the first name for the current user; 1-64 characters. + # @param last_name [TD::Types::String] The new value of the optional last name for the current user; 0-64 characters. # @return [TD::Types::Ok] def set_name(first_name:, last_name:) broadcast('@type' => 'setName', @@ -4575,24 +8521,33 @@ def set_name(first_name:, last_name:) # Sets the current network type. # Can be called before authorization. # Calling this method forces all network connections to reopen, mitigating the delay in switching between different - # networks, so it should be called whenever the network is changed, even if the network type remains the same. + # networks, so it must be called whenever the network is changed, even if the network type remains the same. # Network type is used to check whether the library can use the network at all and also for collecting detailed # network data usage statistics. # - # @param type [TD::Types::NetworkType] The new network type. - # By default, networkTypeOther. + # @param type [TD::Types::NetworkType] The new network type; pass null to set network type to networkTypeOther. # @return [TD::Types::Ok] def set_network_type(type:) broadcast('@type' => 'setNetworkType', 'type' => type) end + # Changes privacy settings for new chat creation; can be used only if getOption("can_set_new_chat_privacy_settings"). + # + # @param settings [TD::Types::NewChatPrivacySettings] New settings. + # @return [TD::Types::Ok] + def set_new_chat_privacy_settings(settings:) + broadcast('@type' => 'setNewChatPrivacySettings', + 'settings' => settings) + end + # Sets the value of an option. # (Check the list of available options on https://core.telegram.org/tdlib/options.) Only writable options can be set. # Can be called before authorization. # # @param name [TD::Types::String] The name of the option. - # @param value [TD::Types::OptionValue] The new value of the option. + # @param value [TD::Types::OptionValue] The new value of the option; pass null to reset option value to a default + # value. # @return [TD::Types::Ok] def set_option(name:, value:) broadcast('@type' => 'setOption', @@ -4605,7 +8560,7 @@ def set_option(name:, value:) # number or the chosen email address must be verified first. # # @param element [TD::Types::InputPassportElement] Input Telegram Passport element. - # @param password [TD::Types::String] Password of the current user. + # @param password [TD::Types::String] The 2-step verification password of the current user. # @return [TD::Types::PassportElement] def set_passport_element(element:, password:) broadcast('@type' => 'setPassportElement', @@ -4625,14 +8580,15 @@ def set_passport_element_errors(user_id:, errors:) 'errors' => errors) end - # Changes the password for the user. + # Changes the 2-step verification password for the current user. # If a new recovery email address is specified, then the change will not be applied until the new recovery email # address is confirmed. # - # @param old_password [TD::Types::String] Previous password of the user. - # @param new_password [TD::Types::String, nil] New password of the user; may be empty to remove the password. + # @param old_password [TD::Types::String] Previous 2-step verification password of the user. + # @param new_password [TD::Types::String, nil] New 2-step verification password of the user; may be empty to remove + # the password. # @param new_hint [TD::Types::String, nil] New password hint; may be empty. - # @param set_recovery_email_address [Boolean] Pass true if the recovery email address should be changed. + # @param set_recovery_email_address [Boolean] Pass true to change also the recovery email address. # @param new_recovery_email_address [TD::Types::String, nil] New recovery email address; may be empty. # @return [TD::Types::PasswordState] def set_password(old_password:, new_password: nil, new_hint: nil, set_recovery_email_address: false, @@ -4645,6 +8601,16 @@ def set_password(old_password:, new_password: nil, new_hint: nil, set_recovery_e 'new_recovery_email_address' => new_recovery_email_address) end + # Changes the personal chat of the current user. + # + # @param chat_id [Integer] Identifier of the new personal chat; pass 0 to remove the chat. + # Use getSuitablePersonalChats to get suitable chats. + # @return [TD::Types::Ok] + def set_personal_chat(chat_id:) + broadcast('@type' => 'setPersonalChat', + 'chat_id' => chat_id) + end + # Changes the order of pinned chats. # # @param chat_list [TD::Types::ChatList] Chat list in which to change the order of pinned chats. @@ -4656,6 +8622,26 @@ def set_pinned_chats(chat_list:, chat_ids:) 'chat_ids' => chat_ids) end + # Changes the order of pinned forum topics; requires can_manage_topics right in the supergroup. + # + # @param chat_id [Integer] Chat identifier. + # @param message_thread_ids [Array] The new list of pinned forum topics. + # @return [TD::Types::Ok] + def set_pinned_forum_topics(chat_id:, message_thread_ids:) + broadcast('@type' => 'setPinnedForumTopics', + 'chat_id' => chat_id, + 'message_thread_ids' => message_thread_ids) + end + + # Changes the order of pinned Saved Messages topics. + # + # @param saved_messages_topic_ids [Array] Identifiers of the new pinned Saved Messages topics. + # @return [TD::Types::Ok] + def set_pinned_saved_messages_topics(saved_messages_topic_ids:) + broadcast('@type' => 'setPinnedSavedMessagesTopics', + 'saved_messages_topic_ids' => saved_messages_topic_ids) + end + # Changes the user answer to a poll. # A poll in quiz mode can be answered only once. # @@ -4671,13 +8657,58 @@ def set_poll_answer(chat_id:, message_id:, option_ids:) 'option_ids' => option_ids) end + # Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only. + # + # @param profile_accent_color_id [Integer] Identifier of the accent color to use for profile; pass -1 if none. + # @param profile_background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the user's profile + # photo background; 0 if none. + # @return [TD::Types::Ok] + def set_profile_accent_color(profile_accent_color_id:, profile_background_custom_emoji_id:) + broadcast('@type' => 'setProfileAccentColor', + 'profile_accent_color_id' => profile_accent_color_id, + 'profile_background_custom_emoji_id' => profile_background_custom_emoji_id) + end + # Changes a profile photo for the current user. # # @param photo [TD::Types::InputChatPhoto] Profile photo to set. + # @param is_public [Boolean] Pass true to set a public photo, which will be visible even the main photo is hidden by + # privacy settings. # @return [TD::Types::Ok] - def set_profile_photo(photo:) - broadcast('@type' => 'setProfilePhoto', - 'photo' => photo) + def set_profile_photo(photo:, is_public:) + broadcast('@type' => 'setProfilePhoto', + 'photo' => photo, + 'is_public' => is_public) + end + + # Changes name of a quick reply shortcut. + # + # @param shortcut_id [Integer] Unique identifier of the quick reply shortcut. + # @param name [TD::Types::String] New name for the shortcut. + # Use checkQuickReplyShortcutName to check its validness. + # @return [TD::Types::Ok] + def set_quick_reply_shortcut_name(shortcut_id:, name:) + broadcast('@type' => 'setQuickReplyShortcutName', + 'shortcut_id' => shortcut_id, + 'name' => name) + end + + # Changes notification settings for reactions. + # + # @param notification_settings [TD::Types::ReactionNotificationSettings] The new notification settings for reactions. + # @return [TD::Types::Ok] + def set_reaction_notification_settings(notification_settings:) + broadcast('@type' => 'setReactionNotificationSettings', + 'notification_settings' => notification_settings) + end + + # Changes privacy settings for message read date. + # + # @param settings [TD::Types::ReadDatePrivacySettings] New settings. + # @return [TD::Types::Ok] + def set_read_date_privacy_settings(settings:) + broadcast('@type' => 'setReadDatePrivacySettings', + 'settings' => settings) end # Changes the 2-step verification recovery email address of the user. @@ -4686,7 +8717,7 @@ def set_profile_photo(photo:) # If new_recovery_email_address is the same as the email address that is currently set up, this call succeeds # immediately and aborts all other requests waiting for an email confirmation. # - # @param password [TD::Types::String] Password of the current user. + # @param password [TD::Types::String] The 2-step verification password of the current user. # @param new_recovery_email_address [TD::Types::String] New recovery email address. # @return [TD::Types::PasswordState] def set_recovery_email_address(password:, new_recovery_email_address:) @@ -4695,6 +8726,17 @@ def set_recovery_email_address(password:, new_recovery_email_address:) 'new_recovery_email_address' => new_recovery_email_address) end + # Changes label of a Saved Messages tag; for Telegram Premium users only. + # + # @param tag [TD::Types::ReactionType] The tag which label will be changed. + # @param label [TD::Types::String] New label for the tag; 0-12 characters. + # @return [TD::Types::Ok] + def set_saved_messages_tag_label(tag:, label:) + broadcast('@type' => 'setSavedMessagesTagLabel', + 'tag' => tag, + 'label' => label) + end + # Changes notification settings for chats of a given type. # # @param scope [TD::Types::NotificationSettingsScope] Types of chats for which to change the notification settings. @@ -4707,11 +8749,49 @@ def set_scope_notification_settings(scope:, notification_settings:) 'notification_settings' => notification_settings) end - # Changes the position of a sticker in the set to which it belongs; for bots only. - # The sticker set must have been created by the bot. + # Changes the list of emojis corresponding to a sticker. + # The sticker must belong to a regular or custom emoji sticker set that is owned by the current user. + # + # @param sticker [TD::Types::InputFile] Sticker. + # @param emojis [TD::Types::String] New string with 1-20 emoji corresponding to the sticker. + # @return [TD::Types::Ok] + def set_sticker_emojis(sticker:, emojis:) + broadcast('@type' => 'setStickerEmojis', + 'sticker' => sticker, + 'emojis' => emojis) + end + + # Changes the list of keywords of a sticker. + # The sticker must belong to a regular or custom emoji sticker set that is owned by the current user. + # + # @param sticker [TD::Types::InputFile] Sticker. + # @param keywords [Array] List of up to 20 keywords with total length up to 64 characters, which + # can be used to find the sticker. + # @return [TD::Types::Ok] + def set_sticker_keywords(sticker:, keywords:) + broadcast('@type' => 'setStickerKeywords', + 'sticker' => sticker, + 'keywords' => keywords) + end + + # Changes the mask position of a mask sticker. + # The sticker must belong to a mask sticker set that is owned by the current user. + # + # @param sticker [TD::Types::InputFile] Sticker. + # @param mask_position [TD::Types::MaskPosition] Position where the mask is placed; pass null to remove mask + # position. + # @return [TD::Types::Ok] + def set_sticker_mask_position(sticker:, mask_position:) + broadcast('@type' => 'setStickerMaskPosition', + 'sticker' => sticker, + 'mask_position' => mask_position) + end + + # Changes the position of a sticker in the set to which it belongs. + # The sticker set must be owned by the current user. # # @param sticker [TD::Types::InputFile] Sticker. - # @param position [Integer] New position of the sticker in the set, zero-based. + # @param position [Integer] New position of the sticker in the set, 0-based. # @return [TD::Types::Ok] def set_sticker_position_in_set(sticker:, position:) broadcast('@type' => 'setStickerPositionInSet', @@ -4719,20 +8799,76 @@ def set_sticker_position_in_set(sticker:, position:) 'position' => position) end - # Sets a sticker set thumbnail; for bots only. - # Returns the sticker set. + # Sets a sticker set thumbnail. # - # @param user_id [Integer] Sticker set owner. + # @param user_id [Integer] Sticker set owner; ignored for regular users. # @param name [TD::Types::String] Sticker set name. - # @param thumbnail [TD::Types::InputFile] Thumbnail to set in PNG or TGS format. - # Animated thumbnail must be set for animated sticker sets and only for them. - # Pass a zero InputFileId to delete the thumbnail. - # @return [TD::Types::StickerSet] - def set_sticker_set_thumbnail(user_id:, name:, thumbnail:) + # The sticker set must be owned by the current user. + # @param thumbnail [TD::Types::InputFile] Thumbnail to set; pass null to remove the sticker set thumbnail. + # @param format [TD::Types::StickerFormat] Format of the thumbnail; pass null if thumbnail is removed. + # @return [TD::Types::Ok] + def set_sticker_set_thumbnail(user_id:, name:, thumbnail:, format:) broadcast('@type' => 'setStickerSetThumbnail', 'user_id' => user_id, 'name' => name, - 'thumbnail' => thumbnail) + 'thumbnail' => thumbnail, + 'format' => format) + end + + # Sets a sticker set title. + # + # @param name [TD::Types::String] Sticker set name. + # The sticker set must be owned by the current user. + # @param title [TD::Types::String] New sticker set title. + # @return [TD::Types::Ok] + def set_sticker_set_title(name:, title:) + broadcast('@type' => 'setStickerSetTitle', + 'name' => name, + 'title' => title) + end + + # Changes privacy settings of a story. + # The method can be called only for stories posted on behalf of the current user and if story.can_be_edited == true. + # + # @param story_id [Integer] Identifier of the story. + # @param privacy_settings [TD::Types::StoryPrivacySettings] The new privacy settigs for the story. + # @return [TD::Types::Ok] + def set_story_privacy_settings(story_id:, privacy_settings:) + broadcast('@type' => 'setStoryPrivacySettings', + 'story_id' => story_id, + 'privacy_settings' => privacy_settings) + end + + # Changes chosen reaction on a story that has already been sent. + # + # @param story_sender_chat_id [Integer] The identifier of the sender of the story. + # @param story_id [Integer] The identifier of the story. + # @param reaction_type [TD::Types::ReactionType] Type of the reaction to set; pass null to remove the reaction. + # Custom emoji reactions can be used only by Telegram Premium users. + # Paid reactions can't be set. + # @param update_recent_reactions [Boolean] Pass true if the reaction needs to be added to recent reactions. + # @return [TD::Types::Ok] + def set_story_reaction(story_sender_chat_id:, story_id:, reaction_type:, update_recent_reactions:) + broadcast('@type' => 'setStoryReaction', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id, + 'reaction_type' => reaction_type, + 'update_recent_reactions' => update_recent_reactions) + end + + # Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. + # The chat must have at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to pass the + # corresponding color. + # + # @param supergroup_id [Integer] Identifier of the supergroup. + # @param custom_emoji_sticker_set_id [Integer] New value of the custom emoji sticker set identifier for the + # supergroup. + # Use 0 to remove the custom emoji sticker set in the supergroup. + # @return [TD::Types::Ok] + def set_supergroup_custom_emoji_sticker_set(supergroup_id:, custom_emoji_sticker_set_id:) + broadcast('@type' => 'setSupergroupCustomEmojiStickerSet', + 'supergroup_id' => supergroup_id, + 'custom_emoji_sticker_set_id' => custom_emoji_sticker_set_id) end # Changes the sticker set of a supergroup; requires can_change_info administrator right. @@ -4747,11 +8883,25 @@ def set_supergroup_sticker_set(supergroup_id:, sticker_set_id:) 'sticker_set_id' => sticker_set_id) end - # Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel. + # Changes the number of times the supergroup must be boosted by a user to ignore slow mode and chat permission + # restrictions; requires can_restrict_members administrator right. + # + # @param supergroup_id [Integer] Identifier of the supergroup. + # @param unrestrict_boost_count [Integer] New value of the unrestrict_boost_count supergroup setting; 0-8. + # Use 0 to remove the setting. + # @return [TD::Types::Ok] + def set_supergroup_unrestrict_boost_count(supergroup_id:, unrestrict_boost_count:) + broadcast('@type' => 'setSupergroupUnrestrictBoostCount', + 'supergroup_id' => supergroup_id, + 'unrestrict_boost_count' => unrestrict_boost_count) + end + + # Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel. # # @param supergroup_id [Integer] Identifier of the supergroup or channel. # @param username [TD::Types::String] New value of the username. # Use an empty string to remove the username. + # The username can't be completely removed if there is another active or disabled username. # @return [TD::Types::Ok] def set_supergroup_username(supergroup_id:, username:) broadcast('@type' => 'setSupergroupUsername', @@ -4762,11 +8912,63 @@ def set_supergroup_username(supergroup_id:, username:) # Sets the parameters for TDLib initialization. # Works only when the current authorization state is authorizationStateWaitTdlibParameters. # - # @param parameters [TD::Types::TdlibParameters] Parameters. + # @param use_test_dc [Boolean, nil] Pass true to use Telegram test environment instead of the production environment. + # @param database_directory [TD::Types::String, nil] The path to the directory for the persistent database; if empty, + # the current working directory will be used. + # @param files_directory [TD::Types::String, nil] The path to the directory for storing files; if empty, + # database_directory will be used. + # @param database_encryption_key [String, nil] Encryption key for the database. + # If the encryption key is invalid, then an error with code 401 will be returned. + # @param use_file_database [Boolean, nil] Pass true to keep information about downloaded and uploaded files between + # application restarts. + # @param use_chat_info_database [Boolean, nil] Pass true to keep cache of users, basic groups, supergroups, channels + # and secret chats between restarts. + # Implies use_file_database. + # @param use_message_database [Boolean, nil] Pass true to keep cache of chats and messages between restarts. + # Implies use_chat_info_database. + # @param use_secret_chats [Boolean, nil] Pass true to enable support for secret chats. + # @param api_id [Integer, nil] Application identifier for Telegram API access, which can be obtained at + # https://my.telegram.org. + # @param api_hash [TD::Types::String, nil] Application identifier hash for Telegram API access, which can be obtained + # at https://my.telegram.org. + # @param system_language_code [TD::Types::String] IETF language tag of the user's operating system language; must be + # non-empty. + # @param device_model [TD::Types::String] Model of the device the application is being run on; must be non-empty. + # @param system_version [TD::Types::String, nil] Version of the operating system the application is being run on. + # If empty, the version is automatically detected by TDLib. + # @param application_version [TD::Types::String] Application version; must be non-empty. + # @return [TD::Types::Ok] + def set_tdlib_parameters(use_test_dc: nil, database_directory: nil, files_directory: nil, database_encryption_key: + nil, use_file_database: nil, use_chat_info_database: nil, use_message_database: nil, + use_secret_chats: nil, api_id: nil, api_hash: nil, system_language_code:, device_model:, + system_version: nil, application_version:) + broadcast('@type' => 'setTdlibParameters', + 'use_test_dc' => use_test_dc, + 'database_directory' => database_directory, + 'files_directory' => files_directory, + 'database_encryption_key' => database_encryption_key, + 'use_file_database' => use_file_database, + 'use_chat_info_database' => use_chat_info_database, + 'use_message_database' => use_message_database, + 'use_secret_chats' => use_secret_chats, + 'api_id' => api_id, + 'api_hash' => api_hash, + 'system_language_code' => system_language_code, + 'device_model' => device_model, + 'system_version' => system_version, + 'application_version' => application_version) + end + + # Changes a personal profile photo of a contact user. + # + # @param user_id [Integer] User identifier. + # @param photo [TD::Types::InputChatPhoto] Profile photo to set; pass null to delete the photo; + # {TD::Types::InputChatPhoto::Previous} isn't supported in this function. # @return [TD::Types::Ok] - def set_tdlib_parameters(parameters:) - broadcast('@type' => 'setTdlibParameters', - 'parameters' => parameters) + def set_user_personal_profile_photo(user_id:, photo:) + broadcast('@type' => 'setUserPersonalProfilePhoto', + 'user_id' => user_id, + 'photo' => photo) end # Changes user privacy settings. @@ -4780,28 +8982,65 @@ def set_user_privacy_setting_rules(setting:, rules:) 'rules' => rules) end - # Changes the username of the current user. + # Sets support information for the given user; for Telegram support only. + # + # @param user_id [Integer] User identifier. + # @param message [TD::Types::FormattedText] New information message. + # @return [TD::Types::UserSupportInfo] + def set_user_support_info(user_id:, message:) + broadcast('@type' => 'setUserSupportInfo', + 'user_id' => user_id, + 'message' => message) + end + + # Changes the editable username of the current user. # # @param username [TD::Types::String] The new value of the username. # Use an empty string to remove the username. + # The username can't be completely removed if there is another active or disabled username. # @return [TD::Types::Ok] def set_username(username:) broadcast('@type' => 'setUsername', 'username' => username) end - # Changes default participant identifier, which can be used to join voice chats in a chat. + # Changes default participant identifier, on whose behalf a video chat in the chat will be joined. # # @param chat_id [Integer] Chat identifier. # @param default_participant_id [TD::Types::MessageSender] Default group call participant identifier to join the - # voice chats. + # video chats. # @return [TD::Types::Ok] - def set_voice_chat_default_participant(chat_id:, default_participant_id:) - broadcast('@type' => 'setVoiceChatDefaultParticipant', + def set_video_chat_default_participant(chat_id:, default_participant_id:) + broadcast('@type' => 'setVideoChatDefaultParticipant', 'chat_id' => chat_id, 'default_participant_id' => default_participant_id) end + # Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot. + # + # @param chat_id [Integer] Identifier of the chat with the bot. + # @param message_id [Integer] Identifier of the message with the button. + # @param button_id [Integer] Identifier of the button. + # @param shared_chat_id [Integer] Identifier of the shared chat. + # @param only_check [Boolean] Pass true to check that the chat can be shared by the button instead of actually + # sharing it. + # Doesn't check bot_is_member and bot_administrator_rights restrictions. + # If the bot must be a member, then all chats from getGroupsInCommon and all chats, where the user can add the bot, + # are suitable. + # In the latter case the bot will be automatically added to the chat. + # If the bot must be an administrator, then all chats, where the bot already has requested rights or can be added + # to administrators by the user, are suitable. + # In the latter case the bot will be automatically granted requested rights. + # @return [TD::Types::Ok] + def share_chat_with_bot(chat_id:, message_id:, button_id:, shared_chat_id:, only_check:) + broadcast('@type' => 'shareChatWithBot', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'button_id' => button_id, + 'shared_chat_id' => shared_chat_id, + 'only_check' => only_check) + end + # Shares the phone number of the current user with a mutual contact. # Supposed to be called when the user clicks on chatActionBarSharePhoneNumber. # @@ -4813,16 +9052,53 @@ def share_phone_number(user_id:) 'user_id' => user_id) end + # Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot. + # + # @param chat_id [Integer] Identifier of the chat with the bot. + # @param message_id [Integer] Identifier of the message with the button. + # @param button_id [Integer] Identifier of the button. + # @param shared_user_ids [Array] Identifiers of the shared users. + # @param only_check [Boolean] Pass true to check that the users can be shared by the button instead of actually + # sharing them. + # @return [TD::Types::Ok] + def share_users_with_bot(chat_id:, message_id:, button_id:, shared_user_ids:, only_check:) + broadcast('@type' => 'shareUsersWithBot', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'button_id' => button_id, + 'shared_user_ids' => shared_user_ids, + 'only_check' => only_check) + end + # Starts recording of an active group call. # Requires groupCall.can_be_managed group call flag. # # @param group_call_id [Integer] Group call identifier. # @param title [TD::Types::String] Group call recording title; 0-64 characters. + # @param record_video [Boolean] Pass true to record a video file instead of an audio file. + # @param use_portrait_orientation [Boolean] Pass true to use portrait orientation for video instead of landscape one. # @return [TD::Types::Ok] - def start_group_call_recording(group_call_id:, title:) - broadcast('@type' => 'startGroupCallRecording', - 'group_call_id' => group_call_id, - 'title' => title) + def start_group_call_recording(group_call_id:, title:, record_video:, use_portrait_orientation:) + broadcast('@type' => 'startGroupCallRecording', + 'group_call_id' => group_call_id, + 'title' => title, + 'record_video' => record_video, + 'use_portrait_orientation' => use_portrait_orientation) + end + + # Starts screen sharing in a joined group call. + # Returns join response payload for tgcalls. + # + # @param group_call_id [Integer] Group call identifier. + # @param audio_source_id [Integer] Screen sharing audio channel synchronization source identifier; received from + # tgcalls. + # @param payload [TD::Types::String] Group call join payload; received from tgcalls. + # @return [TD::Types::Text] + def start_group_call_screen_sharing(group_call_id:, audio_source_id:, payload:) + broadcast('@type' => 'startGroupCallScreenSharing', + 'group_call_id' => group_call_id, + 'audio_source_id' => audio_source_id, + 'payload' => payload) end # Starts a scheduled group call. @@ -4834,12 +9110,28 @@ def start_scheduled_group_call(group_call_id:) 'group_call_id' => group_call_id) end + # Stops a poll sent on behalf of a business account; for bots only. + # + # @param business_connection_id [TD::Types::String] Unique identifier of business connection on behalf of which the + # message with the poll was sent. + # @param chat_id [Integer] The chat the message belongs to. + # @param message_id [Integer] Identifier of the message containing the poll. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none. + # @return [TD::Types::BusinessMessage] + def stop_business_poll(business_connection_id:, chat_id:, message_id:, reply_markup:) + broadcast('@type' => 'stopBusinessPoll', + 'business_connection_id' => business_connection_id, + 'chat_id' => chat_id, + 'message_id' => message_id, + 'reply_markup' => reply_markup) + end + # Stops a poll. - # A poll in a message can be stopped when the message has can_be_edited flag set. # # @param chat_id [Integer] Identifier of the chat to which the poll belongs. # @param message_id [Integer] Identifier of the message containing the poll. - # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; for bots only. + # Use messageProperties.can_be_edited to check whether the poll can be stopped. + # @param reply_markup [TD::Types::ReplyMarkup] The new message reply markup; pass null if none; for bots only. # @return [TD::Types::Ok] def stop_poll(chat_id:, message_id:, reply_markup:) broadcast('@type' => 'stopPoll', @@ -4848,8 +9140,20 @@ def stop_poll(chat_id:, message_id:, reply_markup:) 'reply_markup' => reply_markup) end + # Suggests a profile photo to another regular user with common messages. + # + # @param user_id [Integer] User identifier. + # @param photo [TD::Types::InputChatPhoto] Profile photo to suggest; {TD::Types::InputChatPhoto::Previous} isn't + # supported in this function. + # @return [TD::Types::Ok] + def suggest_user_profile_photo(user_id:, photo:) + broadcast('@type' => 'suggestUserProfilePhoto', + 'user_id' => user_id, + 'photo' => photo) + end + # Fetches the latest versions of all strings from a language pack in the current localization target from the server. - # This method shouldn't be called explicitly for the current used/base language packs. + # This method doesn't need to be called explicitly for the current used/base language packs. # Can be called before authorization. # # @param language_pack_id [TD::Types::String] Language pack identifier. @@ -4875,6 +9179,59 @@ def terminate_session(session_id:) 'session_id' => session_id) end + # Changes pause state of all files in the file download list. + # + # @param are_paused [Boolean] Pass true to pause all downloads; pass false to unpause them. + # @return [TD::Types::Ok] + def toggle_all_downloads_are_paused(are_paused:) + broadcast('@type' => 'toggleAllDownloadsArePaused', + 'are_paused' => are_paused) + end + + # Adds or removes a bot to attachment and side menu. + # Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true. + # + # @param bot_user_id [Integer] Bot's user identifier. + # @param is_added [Boolean] Pass true to add the bot to attachment menu; pass false to remove the bot from attachment + # menu. + # @param allow_write_access [Boolean] Pass true if the current user allowed the bot to send them messages. + # Ignored if is_added is false. + # @return [TD::Types::Ok] + def toggle_bot_is_added_to_attachment_menu(bot_user_id:, is_added:, allow_write_access:) + broadcast('@type' => 'toggleBotIsAddedToAttachmentMenu', + 'bot_user_id' => bot_user_id, + 'is_added' => is_added, + 'allow_write_access' => allow_write_access) + end + + # Changes active state for a username of a bot. + # The editable username can't be disabled. + # May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been + # reached. + # Can be called only if userTypeBot.can_be_edited == true. + # + # @param bot_user_id [Integer] Identifier of the target bot. + # @param username [TD::Types::String] The username to change. + # @param is_active [Boolean] Pass true to activate the username; pass false to disable it. + # @return [TD::Types::Ok] + def toggle_bot_username_is_active(bot_user_id:, username:, is_active:) + broadcast('@type' => 'toggleBotUsernameIsActive', + 'bot_user_id' => bot_user_id, + 'username' => username, + 'is_active' => is_active) + end + + # Pauses or resumes the connected business bot in a specific chat. + # + # @param chat_id [Integer] Chat identifier. + # @param is_paused [Boolean] Pass true to pause the connected bot in the chat; pass false to resume the bot. + # @return [TD::Types::Ok] + def toggle_business_connected_bot_chat_is_paused(chat_id:, is_paused:) + broadcast('@type' => 'toggleBusinessConnectedBotChatIsPaused', + 'chat_id' => chat_id, + 'is_paused' => is_paused) + end + # Changes the value of the default disable_notification parameter, used when a message is sent to a chat. # # @param chat_id [Integer] Chat identifier. @@ -4886,6 +9243,28 @@ def toggle_chat_default_disable_notification(chat_id:, default_disable_notificat 'default_disable_notification' => default_disable_notification) end + # Toggles whether chat folder tags are enabled. + # + # @param are_tags_enabled [Boolean] Pass true to enable folder tags; pass false to disable them. + # @return [TD::Types::Ok] + def toggle_chat_folder_tags(are_tags_enabled:) + broadcast('@type' => 'toggleChatFolderTags', + 'are_tags_enabled' => are_tags_enabled) + end + + # Changes the ability of users to save, forward, or copy chat content. + # Supported only for basic groups, supergroups and channels. + # Requires owner privileges. + # + # @param chat_id [Integer] Chat identifier. + # @param has_protected_content [Boolean] New value of has_protected_content. + # @return [TD::Types::Ok] + def toggle_chat_has_protected_content(chat_id:, has_protected_content:) + broadcast('@type' => 'toggleChatHasProtectedContent', + 'chat_id' => chat_id, + 'has_protected_content' => has_protected_content) + end + # Changes the marked as unread state of a chat. # # @param chat_id [Integer] Chat identifier. @@ -4898,12 +9277,13 @@ def toggle_chat_is_marked_as_unread(chat_id:, is_marked_as_unread:) end # Changes the pinned state of a chat. - # There can be up to GetOption("pinned_chat_count_max")/GetOption("pinned_archived_chat_count_max") pinned non-secret - # chats and the same number of secret chats in the main/arhive chat list. + # There can be up to getOption("pinned_chat_count_max")/getOption("pinned_archived_chat_count_max") pinned non-secret + # chats and the same number of secret chats in the main/archive chat list. + # The limit can be increased with Telegram Premium. # # @param chat_list [TD::Types::ChatList] Chat list in which to change the pinned state of the chat. # @param chat_id [Integer] Chat identifier. - # @param is_pinned [Boolean] True, if the chat is pinned. + # @param is_pinned [Boolean] Pass true to pin the chat; pass false to unpin it. # @return [TD::Types::Ok] def toggle_chat_is_pinned(chat_list:, chat_id:, is_pinned:) broadcast('@type' => 'toggleChatIsPinned', @@ -4912,7 +9292,80 @@ def toggle_chat_is_pinned(chat_list:, chat_id:, is_pinned:) 'is_pinned' => is_pinned) end - # Toggles whether the current user will receive a notification when the group call will start; scheduled group calls + # Changes the translatable state of a chat. + # + # @param chat_id [Integer] Chat identifier. + # @param is_translatable [Boolean] New value of is_translatable. + # @return [TD::Types::Ok] + def toggle_chat_is_translatable(chat_id:, is_translatable:) + broadcast('@type' => 'toggleChatIsTranslatable', + 'chat_id' => chat_id, + 'is_translatable' => is_translatable) + end + + # Changes the view_as_topics setting of a forum chat or Saved Messages. + # + # @param chat_id [Integer] Chat identifier. + # @param view_as_topics [Boolean] New value of view_as_topics. + # @return [TD::Types::Ok] + def toggle_chat_view_as_topics(chat_id:, view_as_topics:) + broadcast('@type' => 'toggleChatViewAsTopics', + 'chat_id' => chat_id, + 'view_as_topics' => view_as_topics) + end + + # Changes pause state of a file in the file download list. + # + # @param file_id [Integer] Identifier of the downloaded file. + # @param is_paused [Boolean] Pass true if the download is paused. + # @return [TD::Types::Ok] + def toggle_download_is_paused(file_id:, is_paused:) + broadcast('@type' => 'toggleDownloadIsPaused', + 'file_id' => file_id, + 'is_paused' => is_paused) + end + + # Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics right in the supergroup + # unless the user is creator of the topic. + # + # @param chat_id [Integer] Identifier of the chat. + # @param message_thread_id [Integer] Message thread identifier of the forum topic. + # @param is_closed [Boolean] Pass true to close the topic; pass false to reopen it. + # @return [TD::Types::Ok] + def toggle_forum_topic_is_closed(chat_id:, message_thread_id:, is_closed:) + broadcast('@type' => 'toggleForumTopicIsClosed', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id, + 'is_closed' => is_closed) + end + + # Changes the pinned state of a forum topic; requires can_manage_topics right in the supergroup. + # There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics. + # + # @param chat_id [Integer] Chat identifier. + # @param message_thread_id [Integer] Message thread identifier of the forum topic. + # @param is_pinned [Boolean] Pass true to pin the topic; pass false to unpin it. + # @return [TD::Types::Ok] + def toggle_forum_topic_is_pinned(chat_id:, message_thread_id:, is_pinned:) + broadcast('@type' => 'toggleForumTopicIsPinned', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id, + 'is_pinned' => is_pinned) + end + + # Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics right in the + # supergroup. + # + # @param chat_id [Integer] Identifier of the chat. + # @param is_hidden [Boolean] Pass true to hide and close the General topic; pass false to unhide it. + # @return [TD::Types::Ok] + def toggle_general_forum_topic_is_hidden(chat_id:, is_hidden:) + broadcast('@type' => 'toggleGeneralForumTopicIsHidden', + 'chat_id' => chat_id, + 'is_hidden' => is_hidden) + end + + # Toggles whether the current user will receive a notification when the group call starts; scheduled group calls # only. # # @param group_call_id [Integer] Group call identifier. @@ -4924,8 +9377,30 @@ def toggle_group_call_enabled_start_notification(group_call_id:, enabled_start_n 'enabled_start_notification' => enabled_start_notification) end + # Toggles whether current user's video is enabled. + # + # @param group_call_id [Integer] Group call identifier. + # @param is_my_video_enabled [Boolean] Pass true if the current user's video is enabled. + # @return [TD::Types::Ok] + def toggle_group_call_is_my_video_enabled(group_call_id:, is_my_video_enabled:) + broadcast('@type' => 'toggleGroupCallIsMyVideoEnabled', + 'group_call_id' => group_call_id, + 'is_my_video_enabled' => is_my_video_enabled) + end + + # Toggles whether current user's video is paused. + # + # @param group_call_id [Integer] Group call identifier. + # @param is_my_video_paused [Boolean] Pass true if the current user's video is paused. + # @return [TD::Types::Ok] + def toggle_group_call_is_my_video_paused(group_call_id:, is_my_video_paused:) + broadcast('@type' => 'toggleGroupCallIsMyVideoPaused', + 'group_call_id' => group_call_id, + 'is_my_video_paused' => is_my_video_paused) + end + # Toggles whether new participants of a group call can be unmuted only by administrators of the group call. - # Requires groupCall.can_change_mute_new_participants group call flag. + # Requires groupCall.can_toggle_mute_new_participants group call flag. # # @param group_call_id [Integer] Group call identifier. # @param mute_new_participants [Boolean] New value of the mute_new_participants setting. @@ -4940,7 +9415,7 @@ def toggle_group_call_mute_new_participants(group_call_id:, mute_new_participant # # @param group_call_id [Integer] Group call identifier. # @param participant_id [TD::Types::MessageSender] Participant identifier. - # @param is_hand_raised [Boolean] Pass true if the user's hand should be raised. + # @param is_hand_raised [Boolean] Pass true if the user's hand needs to be raised. # Only self hand can be raised. # Requires groupCall.can_be_managed group call flag to lower other's hand. # @return [TD::Types::Ok] @@ -4951,11 +9426,11 @@ def toggle_group_call_participant_is_hand_raised(group_call_id:, participant_id: 'is_hand_raised' => is_hand_raised) end - # Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themself. + # Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves. # # @param group_call_id [Integer] Group call identifier. # @param participant_id [TD::Types::MessageSender] Participant identifier. - # @param is_muted [Boolean] Pass true if the user must be muted and false otherwise. + # @param is_muted [Boolean] Pass true to mute the user; pass false to unmute them. # @return [TD::Types::Ok] def toggle_group_call_participant_is_muted(group_call_id:, participant_id:, is_muted:) broadcast('@type' => 'toggleGroupCallParticipantIsMuted', @@ -4964,20 +9439,134 @@ def toggle_group_call_participant_is_muted(group_call_id:, participant_id:, is_m 'is_muted' => is_muted) end - # Changes the block state of a message sender. - # Currently, only users and supergroup chats can be blocked. + # Pauses or unpauses screen sharing in a joined group call. # - # @param sender [TD::Types::MessageSender] Message Sender. - # @param is_blocked [Boolean] New value of is_blocked. + # @param group_call_id [Integer] Group call identifier. + # @param is_paused [Boolean] Pass true to pause screen sharing; pass false to unpause it. # @return [TD::Types::Ok] - def toggle_message_sender_is_blocked(sender:, is_blocked:) - broadcast('@type' => 'toggleMessageSenderIsBlocked', - 'sender' => sender, - 'is_blocked' => is_blocked) + def toggle_group_call_screen_sharing_is_paused(group_call_id:, is_paused:) + broadcast('@type' => 'toggleGroupCallScreenSharingIsPaused', + 'group_call_id' => group_call_id, + 'is_paused' => is_paused) end - # Toggles whether the message history of a supergroup is available to new members; requires can_change_info - # administrator right. + # Toggles whether the current user has sponsored messages enabled. + # The setting has no effect for users without Telegram Premium for which sponsored messages are always enabled. + # + # @param has_sponsored_messages_enabled [Boolean] Pass true to enable sponsored messages for the current user; false + # to disable them. + # @return [TD::Types::Ok] + def toggle_has_sponsored_messages_enabled(has_sponsored_messages_enabled:) + broadcast('@type' => 'toggleHasSponsoredMessagesEnabled', + 'has_sponsored_messages_enabled' => has_sponsored_messages_enabled) + end + + # Changes whether the paid message reaction of the user to a message is anonymous. + # The message must have paid reaction added by the user. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @param is_anonymous [Boolean] Pass true to make paid reaction of the user on the message anonymous; pass false to + # make the user's profile visible among top reactors. + # @return [TD::Types::Ok] + def toggle_paid_message_reaction_is_anonymous(chat_id:, message_id:, is_anonymous:) + broadcast('@type' => 'togglePaidMessageReactionIsAnonymous', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'is_anonymous' => is_anonymous) + end + + # Changes the pinned state of a Saved Messages topic. + # There can be up to getOption("pinned_saved_messages_topic_count_max") pinned topics. + # The limit can be increased with Telegram Premium. + # + # @param saved_messages_topic_id [Integer] Identifier of Saved Messages topic to pin or unpin. + # @param is_pinned [Boolean] Pass true to pin the topic; pass false to unpin it. + # @return [TD::Types::Ok] + def toggle_saved_messages_topic_is_pinned(saved_messages_topic_id:, is_pinned:) + broadcast('@type' => 'toggleSavedMessagesTopicIsPinned', + 'saved_messages_topic_id' => saved_messages_topic_id, + 'is_pinned' => is_pinned) + end + + # Toggles whether a session can accept incoming calls. + # + # @param session_id [Integer] Session identifier. + # @param can_accept_calls [Boolean] Pass true to allow accepting incoming calls by the session; pass false otherwise. + # @return [TD::Types::Ok] + def toggle_session_can_accept_calls(session_id:, can_accept_calls:) + broadcast('@type' => 'toggleSessionCanAcceptCalls', + 'session_id' => session_id, + 'can_accept_calls' => can_accept_calls) + end + + # Toggles whether a session can accept incoming secret chats. + # + # @param session_id [Integer] Session identifier. + # @param can_accept_secret_chats [Boolean] Pass true to allow accepting secret chats by the session; pass false + # otherwise. + # @return [TD::Types::Ok] + def toggle_session_can_accept_secret_chats(session_id:, can_accept_secret_chats:) + broadcast('@type' => 'toggleSessionCanAcceptSecretChats', + 'session_id' => session_id, + 'can_accept_secret_chats' => can_accept_secret_chats) + end + + # Toggles whether a story is accessible after expiration. + # Can be called only if story.can_toggle_is_posted_to_chat_page == true. + # + # @param story_sender_chat_id [Integer] Identifier of the chat that posted the story. + # @param story_id [Integer] Identifier of the story. + # @param is_posted_to_chat_page [Boolean] Pass true to make the story accessible after expiration; pass false to make + # it private. + # @return [TD::Types::Ok] + def toggle_story_is_posted_to_chat_page(story_sender_chat_id:, story_id:, is_posted_to_chat_page:) + broadcast('@type' => 'toggleStoryIsPostedToChatPage', + 'story_sender_chat_id' => story_sender_chat_id, + 'story_id' => story_id, + 'is_posted_to_chat_page' => is_posted_to_chat_page) + end + + # Toggles whether sponsored messages are shown in the channel chat; requires owner privileges in the channel. + # The chat must have at least chatBoostFeatures.min_sponsored_message_disable_boost_level boost level to disable + # sponsored messages. + # + # @param supergroup_id [Integer] The identifier of the channel. + # @param can_have_sponsored_messages [Boolean] The new value of can_have_sponsored_messages. + # @return [TD::Types::Ok] + def toggle_supergroup_can_have_sponsored_messages(supergroup_id:, can_have_sponsored_messages:) + broadcast('@type' => 'toggleSupergroupCanHaveSponsoredMessages', + 'supergroup_id' => supergroup_id, + 'can_have_sponsored_messages' => can_have_sponsored_messages) + end + + # Toggles whether aggressive anti-spam checks are enabled in the supergroup. + # Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true. + # + # @param supergroup_id [Integer] The identifier of the supergroup, which isn't a broadcast group. + # @param has_aggressive_anti_spam_enabled [Boolean] The new value of has_aggressive_anti_spam_enabled. + # @return [TD::Types::Ok] + def toggle_supergroup_has_aggressive_anti_spam_enabled(supergroup_id:, has_aggressive_anti_spam_enabled:) + broadcast('@type' => 'toggleSupergroupHasAggressiveAntiSpamEnabled', + 'supergroup_id' => supergroup_id, + 'has_aggressive_anti_spam_enabled' => has_aggressive_anti_spam_enabled) + end + + # Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or + # searchChatMembers. + # Can be called only if supergroupFullInfo.can_hide_members == true. + # + # @param supergroup_id [Integer] Identifier of the supergroup. + # @param has_hidden_members [Boolean] New value of has_hidden_members. + # @return [TD::Types::Ok] + def toggle_supergroup_has_hidden_members(supergroup_id:, has_hidden_members:) + broadcast('@type' => 'toggleSupergroupHasHiddenMembers', + 'supergroup_id' => supergroup_id, + 'has_hidden_members' => has_hidden_members) + end + + # Toggles whether the message history of a supergroup is available to new members; requires can_change_info member + # right. # # @param supergroup_id [Integer] The identifier of the supergroup. # @param is_all_history_available [Boolean] The new value of is_all_history_available. @@ -4997,26 +9586,95 @@ def toggle_supergroup_is_broadcast_group(supergroup_id:) 'supergroup_id' => supergroup_id) end - # Toggles sender signatures messages sent in a channel; requires can_change_info administrator right. + # Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. + # Discussion supergroups can't be converted to forums. + # + # @param supergroup_id [Integer] Identifier of the supergroup. + # @param is_forum [Boolean] New value of is_forum. + # @return [TD::Types::Ok] + def toggle_supergroup_is_forum(supergroup_id:, is_forum:) + broadcast('@type' => 'toggleSupergroupIsForum', + 'supergroup_id' => supergroup_id, + 'is_forum' => is_forum) + end + + # Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; + # requires can_restrict_members administrator right. + # + # @param supergroup_id [Integer] Identifier of the supergroup that isn't a broadcast group. + # @param join_by_request [Boolean] New value of join_by_request. + # @return [TD::Types::Ok] + def toggle_supergroup_join_by_request(supergroup_id:, join_by_request:) + broadcast('@type' => 'toggleSupergroupJoinByRequest', + 'supergroup_id' => supergroup_id, + 'join_by_request' => join_by_request) + end + + # Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members + # administrator right. + # + # @param supergroup_id [Integer] Identifier of the supergroup that isn't a broadcast group. + # @param join_to_send_messages [Boolean] New value of join_to_send_messages. + # @return [TD::Types::Ok] + def toggle_supergroup_join_to_send_messages(supergroup_id:, join_to_send_messages:) + broadcast('@type' => 'toggleSupergroupJoinToSendMessages', + 'supergroup_id' => supergroup_id, + 'join_to_send_messages' => join_to_send_messages) + end + + # Toggles whether sender signature or link to the account is added to sent messages in a channel; requires + # can_change_info member right. # # @param supergroup_id [Integer] Identifier of the channel. # @param sign_messages [Boolean] New value of sign_messages. + # @param show_message_sender [Boolean] New value of show_message_sender. # @return [TD::Types::Ok] - def toggle_supergroup_sign_messages(supergroup_id:, sign_messages:) - broadcast('@type' => 'toggleSupergroupSignMessages', + def toggle_supergroup_sign_messages(supergroup_id:, sign_messages:, show_message_sender:) + broadcast('@type' => 'toggleSupergroupSignMessages', + 'supergroup_id' => supergroup_id, + 'sign_messages' => sign_messages, + 'show_message_sender' => show_message_sender) + end + + # Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or + # channel. + # The editable username can't be disabled. + # May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been + # reached. + # + # @param supergroup_id [Integer] Identifier of the supergroup or channel. + # @param username [TD::Types::String] The username to change. + # @param is_active [Boolean] Pass true to activate the username; pass false to disable it. + # @return [TD::Types::Ok] + def toggle_supergroup_username_is_active(supergroup_id:, username:, is_active:) + broadcast('@type' => 'toggleSupergroupUsernameIsActive', 'supergroup_id' => supergroup_id, - 'sign_messages' => sign_messages) + 'username' => username, + 'is_active' => is_active) end - # Changes the owner of a chat. - # The current user must be a current owner of the chat. + # Changes active state for a username of the current user. + # The editable username can't be disabled. + # May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been + # reached. + # + # @param username [TD::Types::String] The username to change. + # @param is_active [Boolean] Pass true to activate the username; pass false to disable it. + # @return [TD::Types::Ok] + def toggle_username_is_active(username:, is_active:) + broadcast('@type' => 'toggleUsernameIsActive', + 'username' => username, + 'is_active' => is_active) + end + + # Changes the owner of a chat; requires owner privileges in the chat. # Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. # Available only for supergroups and channel chats. # # @param chat_id [Integer] Chat identifier. # @param user_id [Integer] Identifier of the user to which transfer the ownership. # The ownership can't be transferred to a bot or to a deleted user. - # @param password [TD::Types::String] The password of the current user. + # @param password [TD::Types::String] The 2-step verification password of the current user. # @return [TD::Types::Ok] def transfer_chat_ownership(chat_id:, user_id:, password:) broadcast('@type' => 'transferChatOwnership', @@ -5025,8 +9683,48 @@ def transfer_chat_ownership(chat_id:, user_id:, password:) 'password' => password) end - # Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights - # in the channel. + # Extracts text or caption of the given message and translates it to the given language. + # If the current user is a Telegram Premium user, then text formatting is preserved. + # + # @param chat_id [Integer] Identifier of the chat to which the message belongs. + # @param message_id [Integer] Identifier of the message. + # @param to_language_code [TD::Types::String] Language code of the language to which the message is translated. + # Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", + # "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", + # "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", + # "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", + # "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", + # "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", + # "yi", "ji", "yo", "zu". + # @return [TD::Types::FormattedText] + def translate_message_text(chat_id:, message_id:, to_language_code:) + broadcast('@type' => 'translateMessageText', + 'chat_id' => chat_id, + 'message_id' => message_id, + 'to_language_code' => to_language_code) + end + + # Translates a text to the given language. + # If the current user is a Telegram Premium user, then text formatting is preserved. + # + # @param text [TD::Types::FormattedText] Text to translate. + # @param to_language_code [TD::Types::String] Language code of the language to which the message is translated. + # Must be one of "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", + # "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et", "fi", "fr", "fy", "gl", "ka", "de", + # "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", + # "kk", "km", "rw", "ko", "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", + # "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr", "st", "sn", "sd", "si", "sk", "sl", + # "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", + # "yi", "ji", "yo", "zu". + # @return [TD::Types::FormattedText] + def translate_text(text:, to_language_code:) + broadcast('@type' => 'translateText', + 'text' => text, + 'to_language_code' => to_language_code) + end + + # Removes all pinned messages from a chat; requires can_pin_messages member right if the chat is a basic group or + # supergroup, or can_edit_messages administrator right if the chat is a channel. # # @param chat_id [Integer] Identifier of the chat. # @return [TD::Types::Ok] @@ -5035,8 +9733,19 @@ def unpin_all_chat_messages(chat_id:) 'chat_id' => chat_id) end - # Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in - # the channel. + # Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup. + # + # @param chat_id [Integer] Identifier of the chat. + # @param message_thread_id [Integer] Message thread identifier in which messages will be unpinned. + # @return [TD::Types::Ok] + def unpin_all_message_thread_messages(chat_id:, message_thread_id:) + broadcast('@type' => 'unpinAllMessageThreadMessages', + 'chat_id' => chat_id, + 'message_thread_id' => message_thread_id) + end + + # Removes a pinned message from a chat; requires can_pin_messages member right if the chat is a basic group or + # supergroup, or can_edit_messages administrator right if the chat is a channel. # # @param chat_id [Integer] Identifier of the chat. # @param message_id [Integer] Identifier of the removed pinned message. @@ -5048,7 +9757,7 @@ def unpin_chat_message(chat_id:, message_id:) end # Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and - # messageChatUpgradeFrom; requires creator privileges. + # messageChatUpgradeFrom; requires owner privileges. # Deactivates the original basic group. # # @param chat_id [Integer] Identifier of the chat to upgrade. @@ -5058,67 +9767,62 @@ def upgrade_basic_group_chat_to_supergroup_chat(chat_id:) 'chat_id' => chat_id) end - # Asynchronously uploads a file to the cloud without sending it in a message. - # updateFile will be used to notify about upload progress and successful completion of the upload. - # The file will not have a persistent remote identifier until it will be sent in a message. - # - # @param file [TD::Types::InputFile] File to upload. - # @param file_type [TD::Types::FileType] File type. - # @param priority [Integer] Priority of the upload (1-32). - # The higher the priority, the earlier the file will be uploaded. - # If the priorities of two files are equal, then the first one for which uploadFile was called will be uploaded - # first. - # @return [TD::Types::File] - def upload_file(file:, file_type:, priority:) - broadcast('@type' => 'uploadFile', - 'file' => file, - 'file_type' => file_type, - 'priority' => priority) - end - - # Uploads a PNG image with a sticker; for bots only; returns the uploaded file. + # Uploads a file with a sticker; returns the uploaded file. # - # @param user_id [Integer] Sticker file owner. - # @param png_sticker [TD::Types::InputFile] PNG image with the sticker; must be up to 512 KB in size and fit in - # 512x512 square. + # @param user_id [Integer] Sticker file owner; ignored for regular users. + # @param sticker_format [TD::Types::StickerFormat] Sticker format. + # @param sticker [TD::Types::InputFile] File file to upload; must fit in a 512x512 square. + # For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. + # See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements. # @return [TD::Types::File] - def upload_sticker_file(user_id:, png_sticker:) - broadcast('@type' => 'uploadStickerFile', - 'user_id' => user_id, - 'png_sticker' => png_sticker) + def upload_sticker_file(user_id:, sticker_format:, sticker:) + broadcast('@type' => 'uploadStickerFile', + 'user_id' => user_id, + 'sticker_format' => sticker_format, + 'sticker' => sticker) end # Validates the order information provided by a user and returns the available shipping options for a flexible # invoice. # - # @param chat_id [Integer] Chat identifier of the Invoice message. - # @param message_id [Integer] Message identifier. - # @param order_info [TD::Types::OrderInfo] The order information, provided by the user. - # @param allow_save [Boolean] True, if the order information can be saved. + # @param input_invoice [TD::Types::InputInvoice] The invoice. + # @param order_info [TD::Types::OrderInfo, nil] The order information, provided by the user; pass null if empty. + # @param allow_save [Boolean] Pass true to save the order information. # @return [TD::Types::ValidatedOrderInfo] - def validate_order_info(chat_id:, message_id:, order_info:, allow_save:) - broadcast('@type' => 'validateOrderInfo', - 'chat_id' => chat_id, - 'message_id' => message_id, - 'order_info' => order_info, - 'allow_save' => allow_save) + def validate_order_info(input_invoice:, order_info: nil, allow_save:) + broadcast('@type' => 'validateOrderInfo', + 'input_invoice' => input_invoice, + 'order_info' => order_info, + 'allow_save' => allow_save) end # Informs TDLib that messages are being viewed by the user. + # Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen + # (excluding the button). # Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as # read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels). # # @param chat_id [Integer] Chat identifier. - # @param message_thread_id [Integer] If not 0, a message thread identifier in which the messages are being viewed. # @param message_ids [Array] The identifiers of the messages being viewed. - # @param force_read [Boolean] True, if messages in closed chats should be marked as read by the request. + # @param source [TD::Types::MessageSource] Source of the message view; pass null to guess the source based on chat + # open state. + # @param force_read [Boolean] Pass true to mark as read the specified messages even the chat is closed. # @return [TD::Types::Ok] - def view_messages(chat_id:, message_thread_id:, message_ids:, force_read:) - broadcast('@type' => 'viewMessages', - 'chat_id' => chat_id, - 'message_thread_id' => message_thread_id, - 'message_ids' => message_ids, - 'force_read' => force_read) + def view_messages(chat_id:, message_ids:, source:, force_read:) + broadcast('@type' => 'viewMessages', + 'chat_id' => chat_id, + 'message_ids' => message_ids, + 'source' => source, + 'force_read' => force_read) + end + + # Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen. + # + # @param feature [TD::Types::PremiumFeature] The viewed premium feature. + # @return [TD::Types::Ok] + def view_premium_feature(feature:) + broadcast('@type' => 'viewPremiumFeature', + 'feature' => feature) end # Informs the server that some trending sticker sets have been viewed by the user. diff --git a/lib/tdlib/types.rb b/lib/tdlib/types.rb index b5311593..09a1418a 100644 --- a/lib/tdlib/types.rb +++ b/lib/tdlib/types.rb @@ -5,963 +5,1757 @@ module TD::Types include Dry.Types() LOOKUP_TABLE = { - 'error' => 'Error', - 'ok' => 'Ok', - 'tdlibParameters' => 'TdlibParameters', - 'AuthenticationCodeType' => 'AuthenticationCodeType', - 'authenticationCodeTypeTelegramMessage' => 'AuthenticationCodeType::TelegramMessage', - 'authenticationCodeTypeSms' => 'AuthenticationCodeType::Sms', - 'authenticationCodeTypeCall' => 'AuthenticationCodeType::Call', - 'authenticationCodeTypeFlashCall' => 'AuthenticationCodeType::FlashCall', - 'authenticationCodeInfo' => 'AuthenticationCodeInfo', - 'emailAddressAuthenticationCodeInfo' => 'EmailAddressAuthenticationCodeInfo', - 'textEntity' => 'TextEntity', - 'textEntities' => 'TextEntities', - 'formattedText' => 'FormattedText', - 'termsOfService' => 'TermsOfService', - 'AuthorizationState' => 'AuthorizationState', - 'authorizationStateWaitTdlibParameters' => 'AuthorizationState::WaitTdlibParameters', - 'authorizationStateWaitEncryptionKey' => 'AuthorizationState::WaitEncryptionKey', - 'authorizationStateWaitPhoneNumber' => 'AuthorizationState::WaitPhoneNumber', - 'authorizationStateWaitCode' => 'AuthorizationState::WaitCode', - 'authorizationStateWaitOtherDeviceConfirmation' => 'AuthorizationState::WaitOtherDeviceConfirmation', - 'authorizationStateWaitRegistration' => 'AuthorizationState::WaitRegistration', - 'authorizationStateWaitPassword' => 'AuthorizationState::WaitPassword', - 'authorizationStateReady' => 'AuthorizationState::Ready', - 'authorizationStateLoggingOut' => 'AuthorizationState::LoggingOut', - 'authorizationStateClosing' => 'AuthorizationState::Closing', - 'authorizationStateClosed' => 'AuthorizationState::Closed', - 'passwordState' => 'PasswordState', - 'recoveryEmailAddress' => 'RecoveryEmailAddress', - 'temporaryPasswordState' => 'TemporaryPasswordState', - 'localFile' => 'LocalFile', - 'remoteFile' => 'RemoteFile', - 'file' => 'File', - 'InputFile' => 'InputFile', - 'inputFileId' => 'InputFile::Id', - 'inputFileRemote' => 'InputFile::Remote', - 'inputFileLocal' => 'InputFile::Local', - 'inputFileGenerated' => 'InputFile::Generated', - 'photoSize' => 'PhotoSize', - 'minithumbnail' => 'Minithumbnail', - 'ThumbnailFormat' => 'ThumbnailFormat', - 'thumbnailFormatJpeg' => 'ThumbnailFormat::Jpeg', - 'thumbnailFormatPng' => 'ThumbnailFormat::Png', - 'thumbnailFormatWebp' => 'ThumbnailFormat::Webp', - 'thumbnailFormatGif' => 'ThumbnailFormat::Gif', - 'thumbnailFormatTgs' => 'ThumbnailFormat::Tgs', - 'thumbnailFormatMpeg4' => 'ThumbnailFormat::Mpeg4', - 'thumbnail' => 'Thumbnail', - 'MaskPoint' => 'MaskPoint', - 'maskPointForehead' => 'MaskPoint::Forehead', - 'maskPointEyes' => 'MaskPoint::Eyes', - 'maskPointMouth' => 'MaskPoint::Mouth', - 'maskPointChin' => 'MaskPoint::Chin', - 'maskPosition' => 'MaskPosition', - 'closedVectorPath' => 'ClosedVectorPath', - 'pollOption' => 'PollOption', - 'PollType' => 'PollType', - 'pollTypeRegular' => 'PollType::Regular', - 'pollTypeQuiz' => 'PollType::Quiz', - 'animation' => 'Animation', - 'audio' => 'Audio', - 'document' => 'Document', - 'photo' => 'Photo', - 'sticker' => 'Sticker', - 'video' => 'Video', - 'videoNote' => 'VideoNote', - 'voiceNote' => 'VoiceNote', - 'contact' => 'Contact', - 'location' => 'Location', - 'venue' => 'Venue', - 'game' => 'Game', - 'poll' => 'Poll', - 'profilePhoto' => 'ProfilePhoto', - 'chatPhotoInfo' => 'ChatPhotoInfo', - 'UserType' => 'UserType', - 'userTypeRegular' => 'UserType::Regular', - 'userTypeDeleted' => 'UserType::Deleted', - 'userTypeBot' => 'UserType::Bot', - 'userTypeUnknown' => 'UserType::Unknown', - 'botCommand' => 'BotCommand', - 'botInfo' => 'BotInfo', - 'chatLocation' => 'ChatLocation', - 'animatedChatPhoto' => 'AnimatedChatPhoto', - 'chatPhoto' => 'ChatPhoto', - 'chatPhotos' => 'ChatPhotos', - 'InputChatPhoto' => 'InputChatPhoto', - 'inputChatPhotoPrevious' => 'InputChatPhoto::Previous', - 'inputChatPhotoStatic' => 'InputChatPhoto::Static', - 'inputChatPhotoAnimation' => 'InputChatPhoto::Animation', - 'user' => 'User', - 'userFullInfo' => 'UserFullInfo', - 'users' => 'Users', - 'chatAdministrator' => 'ChatAdministrator', - 'chatAdministrators' => 'ChatAdministrators', - 'chatPermissions' => 'ChatPermissions', - 'ChatMemberStatus' => 'ChatMemberStatus', - 'chatMemberStatusCreator' => 'ChatMemberStatus::Creator', - 'chatMemberStatusAdministrator' => 'ChatMemberStatus::Administrator', - 'chatMemberStatusMember' => 'ChatMemberStatus::Member', - 'chatMemberStatusRestricted' => 'ChatMemberStatus::Restricted', - 'chatMemberStatusLeft' => 'ChatMemberStatus::Left', - 'chatMemberStatusBanned' => 'ChatMemberStatus::Banned', - 'chatMember' => 'ChatMember', - 'chatMembers' => 'ChatMembers', - 'ChatMembersFilter' => 'ChatMembersFilter', - 'chatMembersFilterContacts' => 'ChatMembersFilter::Contacts', - 'chatMembersFilterAdministrators' => 'ChatMembersFilter::Administrators', - 'chatMembersFilterMembers' => 'ChatMembersFilter::Members', - 'chatMembersFilterMention' => 'ChatMembersFilter::Mention', - 'chatMembersFilterRestricted' => 'ChatMembersFilter::Restricted', - 'chatMembersFilterBanned' => 'ChatMembersFilter::Banned', - 'chatMembersFilterBots' => 'ChatMembersFilter::Bots', - 'SupergroupMembersFilter' => 'SupergroupMembersFilter', - 'supergroupMembersFilterRecent' => 'SupergroupMembersFilter::Recent', - 'supergroupMembersFilterContacts' => 'SupergroupMembersFilter::Contacts', - 'supergroupMembersFilterAdministrators' => 'SupergroupMembersFilter::Administrators', - 'supergroupMembersFilterSearch' => 'SupergroupMembersFilter::Search', - 'supergroupMembersFilterRestricted' => 'SupergroupMembersFilter::Restricted', - 'supergroupMembersFilterBanned' => 'SupergroupMembersFilter::Banned', - 'supergroupMembersFilterMention' => 'SupergroupMembersFilter::Mention', - 'supergroupMembersFilterBots' => 'SupergroupMembersFilter::Bots', - 'chatInviteLink' => 'ChatInviteLink', - 'chatInviteLinks' => 'ChatInviteLinks', - 'chatInviteLinkCount' => 'ChatInviteLinkCount', - 'chatInviteLinkCounts' => 'ChatInviteLinkCounts', - 'chatInviteLinkMember' => 'ChatInviteLinkMember', - 'chatInviteLinkMembers' => 'ChatInviteLinkMembers', - 'chatInviteLinkInfo' => 'ChatInviteLinkInfo', - 'basicGroup' => 'BasicGroup', - 'basicGroupFullInfo' => 'BasicGroupFullInfo', - 'supergroup' => 'Supergroup', - 'supergroupFullInfo' => 'SupergroupFullInfo', - 'SecretChatState' => 'SecretChatState', - 'secretChatStatePending' => 'SecretChatState::Pending', - 'secretChatStateReady' => 'SecretChatState::Ready', - 'secretChatStateClosed' => 'SecretChatState::Closed', - 'secretChat' => 'SecretChat', - 'MessageSender' => 'MessageSender', - 'messageSenderUser' => 'MessageSender::User', - 'messageSenderChat' => 'MessageSender::Chat', - 'messageSenders' => 'MessageSenders', - 'MessageForwardOrigin' => 'MessageForwardOrigin', - 'messageForwardOriginUser' => 'MessageForwardOrigin::User', - 'messageForwardOriginChat' => 'MessageForwardOrigin::Chat', - 'messageForwardOriginHiddenUser' => 'MessageForwardOrigin::HiddenUser', - 'messageForwardOriginChannel' => 'MessageForwardOrigin::Channel', - 'messageForwardOriginMessageImport' => 'MessageForwardOrigin::MessageImport', - 'messageForwardInfo' => 'MessageForwardInfo', - 'messageReplyInfo' => 'MessageReplyInfo', - 'messageInteractionInfo' => 'MessageInteractionInfo', - 'MessageSendingState' => 'MessageSendingState', - 'messageSendingStatePending' => 'MessageSendingState::Pending', - 'messageSendingStateFailed' => 'MessageSendingState::Failed', - 'message' => 'Message', - 'messages' => 'Messages', - 'foundMessages' => 'FoundMessages', - 'NotificationSettingsScope' => 'NotificationSettingsScope', - 'notificationSettingsScopePrivateChats' => 'NotificationSettingsScope::PrivateChats', - 'notificationSettingsScopeGroupChats' => 'NotificationSettingsScope::GroupChats', - 'notificationSettingsScopeChannelChats' => 'NotificationSettingsScope::ChannelChats', - 'chatNotificationSettings' => 'ChatNotificationSettings', - 'scopeNotificationSettings' => 'ScopeNotificationSettings', - 'draftMessage' => 'DraftMessage', - 'ChatType' => 'ChatType', - 'chatTypePrivate' => 'ChatType::Private', - 'chatTypeBasicGroup' => 'ChatType::BasicGroup', - 'chatTypeSupergroup' => 'ChatType::Supergroup', - 'chatTypeSecret' => 'ChatType::Secret', - 'chatFilter' => 'ChatFilter', - 'chatFilterInfo' => 'ChatFilterInfo', - 'recommendedChatFilter' => 'RecommendedChatFilter', - 'recommendedChatFilters' => 'RecommendedChatFilters', - 'ChatList' => 'ChatList', - 'chatListMain' => 'ChatList::Main', - 'chatListArchive' => 'ChatList::Archive', - 'chatListFilter' => 'ChatList::Filter', - 'chatLists' => 'ChatLists', - 'ChatSource' => 'ChatSource', - 'chatSourceMtprotoProxy' => 'ChatSource::MtprotoProxy', - 'chatSourcePublicServiceAnnouncement' => 'ChatSource::PublicServiceAnnouncement', - 'chatPosition' => 'ChatPosition', - 'voiceChat' => 'VoiceChat', - 'chat' => 'Chat', - 'chats' => 'Chats', - 'chatNearby' => 'ChatNearby', - 'chatsNearby' => 'ChatsNearby', - 'PublicChatType' => 'PublicChatType', - 'publicChatTypeHasUsername' => 'PublicChatType::HasUsername', - 'publicChatTypeIsLocationBased' => 'PublicChatType::IsLocationBased', - 'ChatActionBar' => 'ChatActionBar', - 'chatActionBarReportSpam' => 'ChatActionBar::ReportSpam', - 'chatActionBarReportUnrelatedLocation' => 'ChatActionBar::ReportUnrelatedLocation', - 'chatActionBarInviteMembers' => 'ChatActionBar::InviteMembers', - 'chatActionBarReportAddBlock' => 'ChatActionBar::ReportAddBlock', - 'chatActionBarAddContact' => 'ChatActionBar::AddContact', - 'chatActionBarSharePhoneNumber' => 'ChatActionBar::SharePhoneNumber', - 'KeyboardButtonType' => 'KeyboardButtonType', - 'keyboardButtonTypeText' => 'KeyboardButtonType::Text', - 'keyboardButtonTypeRequestPhoneNumber' => 'KeyboardButtonType::RequestPhoneNumber', - 'keyboardButtonTypeRequestLocation' => 'KeyboardButtonType::RequestLocation', - 'keyboardButtonTypeRequestPoll' => 'KeyboardButtonType::RequestPoll', - 'keyboardButton' => 'KeyboardButton', - 'InlineKeyboardButtonType' => 'InlineKeyboardButtonType', - 'inlineKeyboardButtonTypeUrl' => 'InlineKeyboardButtonType::Url', - 'inlineKeyboardButtonTypeLoginUrl' => 'InlineKeyboardButtonType::LoginUrl', - 'inlineKeyboardButtonTypeCallback' => 'InlineKeyboardButtonType::Callback', - 'inlineKeyboardButtonTypeCallbackWithPassword' => 'InlineKeyboardButtonType::CallbackWithPassword', - 'inlineKeyboardButtonTypeCallbackGame' => 'InlineKeyboardButtonType::CallbackGame', - 'inlineKeyboardButtonTypeSwitchInline' => 'InlineKeyboardButtonType::SwitchInline', - 'inlineKeyboardButtonTypeBuy' => 'InlineKeyboardButtonType::Buy', - 'inlineKeyboardButton' => 'InlineKeyboardButton', - 'ReplyMarkup' => 'ReplyMarkup', - 'replyMarkupRemoveKeyboard' => 'ReplyMarkup::RemoveKeyboard', - 'replyMarkupForceReply' => 'ReplyMarkup::ForceReply', - 'replyMarkupShowKeyboard' => 'ReplyMarkup::ShowKeyboard', - 'replyMarkupInlineKeyboard' => 'ReplyMarkup::InlineKeyboard', - 'LoginUrlInfo' => 'LoginUrlInfo', - 'loginUrlInfoOpen' => 'LoginUrlInfo::Open', - 'loginUrlInfoRequestConfirmation' => 'LoginUrlInfo::RequestConfirmation', - 'messageThreadInfo' => 'MessageThreadInfo', - 'RichText' => 'RichText', - 'richTextPlain' => 'RichText::Plain', - 'richTextBold' => 'RichText::Bold', - 'richTextItalic' => 'RichText::Italic', - 'richTextUnderline' => 'RichText::Underline', - 'richTextStrikethrough' => 'RichText::Strikethrough', - 'richTextFixed' => 'RichText::Fixed', - 'richTextUrl' => 'RichText::Url', - 'richTextEmailAddress' => 'RichText::EmailAddress', - 'richTextSubscript' => 'RichText::Subscript', - 'richTextSuperscript' => 'RichText::Superscript', - 'richTextMarked' => 'RichText::Marked', - 'richTextPhoneNumber' => 'RichText::PhoneNumber', - 'richTextIcon' => 'RichText::Icon', - 'richTextReference' => 'RichText::Reference', - 'richTextAnchor' => 'RichText::Anchor', - 'richTextAnchorLink' => 'RichText::AnchorLink', - 'richTexts' => 'RichText::s', - 'pageBlockCaption' => 'PageBlockCaption', - 'pageBlockListItem' => 'PageBlockListItem', - 'PageBlockHorizontalAlignment' => 'PageBlockHorizontalAlignment', - 'pageBlockHorizontalAlignmentLeft' => 'PageBlockHorizontalAlignment::Left', - 'pageBlockHorizontalAlignmentCenter' => 'PageBlockHorizontalAlignment::Center', - 'pageBlockHorizontalAlignmentRight' => 'PageBlockHorizontalAlignment::Right', - 'PageBlockVerticalAlignment' => 'PageBlockVerticalAlignment', - 'pageBlockVerticalAlignmentTop' => 'PageBlockVerticalAlignment::Top', - 'pageBlockVerticalAlignmentMiddle' => 'PageBlockVerticalAlignment::Middle', - 'pageBlockVerticalAlignmentBottom' => 'PageBlockVerticalAlignment::Bottom', - 'pageBlockTableCell' => 'PageBlockTableCell', - 'pageBlockRelatedArticle' => 'PageBlockRelatedArticle', - 'PageBlock' => 'PageBlock', - 'pageBlockTitle' => 'PageBlock::Title', - 'pageBlockSubtitle' => 'PageBlock::Subtitle', - 'pageBlockAuthorDate' => 'PageBlock::AuthorDate', - 'pageBlockHeader' => 'PageBlock::Header', - 'pageBlockSubheader' => 'PageBlock::Subheader', - 'pageBlockKicker' => 'PageBlock::Kicker', - 'pageBlockParagraph' => 'PageBlock::Paragraph', - 'pageBlockPreformatted' => 'PageBlock::Preformatted', - 'pageBlockFooter' => 'PageBlock::Footer', - 'pageBlockDivider' => 'PageBlock::Divider', - 'pageBlockAnchor' => 'PageBlock::Anchor', - 'pageBlockList' => 'PageBlock::List', - 'pageBlockBlockQuote' => 'PageBlock::BlockQuote', - 'pageBlockPullQuote' => 'PageBlock::PullQuote', - 'pageBlockAnimation' => 'PageBlock::Animation', - 'pageBlockAudio' => 'PageBlock::Audio', - 'pageBlockPhoto' => 'PageBlock::Photo', - 'pageBlockVideo' => 'PageBlock::Video', - 'pageBlockVoiceNote' => 'PageBlock::VoiceNote', - 'pageBlockCover' => 'PageBlock::Cover', - 'pageBlockEmbedded' => 'PageBlock::Embedded', - 'pageBlockEmbeddedPost' => 'PageBlock::EmbeddedPost', - 'pageBlockCollage' => 'PageBlock::Collage', - 'pageBlockSlideshow' => 'PageBlock::Slideshow', - 'pageBlockChatLink' => 'PageBlock::ChatLink', - 'pageBlockTable' => 'PageBlock::Table', - 'pageBlockDetails' => 'PageBlock::Details', - 'pageBlockRelatedArticles' => 'PageBlock::RelatedArticles', - 'pageBlockMap' => 'PageBlock::Map', - 'webPageInstantView' => 'WebPageInstantView', - 'webPage' => 'WebPage', - 'countryInfo' => 'CountryInfo', - 'countries' => 'Countries', - 'phoneNumberInfo' => 'PhoneNumberInfo', - 'bankCardActionOpenUrl' => 'BankCardActionOpenUrl', - 'bankCardInfo' => 'BankCardInfo', - 'address' => 'Address', - 'labeledPricePart' => 'LabeledPricePart', - 'invoice' => 'Invoice', - 'orderInfo' => 'OrderInfo', - 'shippingOption' => 'ShippingOption', - 'savedCredentials' => 'SavedCredentials', - 'InputCredentials' => 'InputCredentials', - 'inputCredentialsSaved' => 'InputCredentials::Saved', - 'inputCredentialsNew' => 'InputCredentials::New', - 'inputCredentialsApplePay' => 'InputCredentials::ApplePay', - 'inputCredentialsGooglePay' => 'InputCredentials::GooglePay', - 'paymentsProviderStripe' => 'PaymentsProviderStripe', - 'paymentFormTheme' => 'PaymentFormTheme', - 'paymentForm' => 'PaymentForm', - 'validatedOrderInfo' => 'ValidatedOrderInfo', - 'paymentResult' => 'PaymentResult', - 'paymentReceipt' => 'PaymentReceipt', - 'datedFile' => 'DatedFile', - 'PassportElementType' => 'PassportElementType', - 'passportElementTypePersonalDetails' => 'PassportElementType::PersonalDetails', - 'passportElementTypePassport' => 'PassportElementType::Passport', - 'passportElementTypeDriverLicense' => 'PassportElementType::DriverLicense', - 'passportElementTypeIdentityCard' => 'PassportElementType::IdentityCard', - 'passportElementTypeInternalPassport' => 'PassportElementType::InternalPassport', - 'passportElementTypeAddress' => 'PassportElementType::Address', - 'passportElementTypeUtilityBill' => 'PassportElementType::UtilityBill', - 'passportElementTypeBankStatement' => 'PassportElementType::BankStatement', - 'passportElementTypeRentalAgreement' => 'PassportElementType::RentalAgreement', - 'passportElementTypePassportRegistration' => 'PassportElementType::PassportRegistration', - 'passportElementTypeTemporaryRegistration' => 'PassportElementType::TemporaryRegistration', - 'passportElementTypePhoneNumber' => 'PassportElementType::PhoneNumber', - 'passportElementTypeEmailAddress' => 'PassportElementType::EmailAddress', - 'date' => 'Date', - 'personalDetails' => 'PersonalDetails', - 'identityDocument' => 'IdentityDocument', - 'inputIdentityDocument' => 'InputIdentityDocument', - 'personalDocument' => 'PersonalDocument', - 'inputPersonalDocument' => 'InputPersonalDocument', - 'PassportElement' => 'PassportElement', - 'passportElementPersonalDetails' => 'PassportElement::PersonalDetails', - 'passportElementPassport' => 'PassportElement::Passport', - 'passportElementDriverLicense' => 'PassportElement::DriverLicense', - 'passportElementIdentityCard' => 'PassportElement::IdentityCard', - 'passportElementInternalPassport' => 'PassportElement::InternalPassport', - 'passportElementAddress' => 'PassportElement::Address', - 'passportElementUtilityBill' => 'PassportElement::UtilityBill', - 'passportElementBankStatement' => 'PassportElement::BankStatement', - 'passportElementRentalAgreement' => 'PassportElement::RentalAgreement', - 'passportElementPassportRegistration' => 'PassportElement::PassportRegistration', - 'passportElementTemporaryRegistration' => 'PassportElement::TemporaryRegistration', - 'passportElementPhoneNumber' => 'PassportElement::PhoneNumber', - 'passportElementEmailAddress' => 'PassportElement::EmailAddress', - 'InputPassportElement' => 'InputPassportElement', - 'inputPassportElementPersonalDetails' => 'InputPassportElement::PersonalDetails', - 'inputPassportElementPassport' => 'InputPassportElement::Passport', - 'inputPassportElementDriverLicense' => 'InputPassportElement::DriverLicense', - 'inputPassportElementIdentityCard' => 'InputPassportElement::IdentityCard', - 'inputPassportElementInternalPassport' => 'InputPassportElement::InternalPassport', - 'inputPassportElementAddress' => 'InputPassportElement::Address', - 'inputPassportElementUtilityBill' => 'InputPassportElement::UtilityBill', - 'inputPassportElementBankStatement' => 'InputPassportElement::BankStatement', - 'inputPassportElementRentalAgreement' => 'InputPassportElement::RentalAgreement', - 'inputPassportElementPassportRegistration' => 'InputPassportElement::PassportRegistration', - 'inputPassportElementTemporaryRegistration' => 'InputPassportElement::TemporaryRegistration', - 'inputPassportElementPhoneNumber' => 'InputPassportElement::PhoneNumber', - 'inputPassportElementEmailAddress' => 'InputPassportElement::EmailAddress', - 'passportElements' => 'PassportElements', - 'PassportElementErrorSource' => 'PassportElementErrorSource', - 'passportElementErrorSourceUnspecified' => 'PassportElementErrorSource::Unspecified', - 'passportElementErrorSourceDataField' => 'PassportElementErrorSource::DataField', - 'passportElementErrorSourceFrontSide' => 'PassportElementErrorSource::FrontSide', - 'passportElementErrorSourceReverseSide' => 'PassportElementErrorSource::ReverseSide', - 'passportElementErrorSourceSelfie' => 'PassportElementErrorSource::Selfie', - 'passportElementErrorSourceTranslationFile' => 'PassportElementErrorSource::TranslationFile', - 'passportElementErrorSourceTranslationFiles' => 'PassportElementErrorSource::TranslationFiles', - 'passportElementErrorSourceFile' => 'PassportElementErrorSource::File', - 'passportElementErrorSourceFiles' => 'PassportElementErrorSource::Files', - 'passportElementError' => 'PassportElementError', - 'passportSuitableElement' => 'PassportSuitableElement', - 'passportRequiredElement' => 'PassportRequiredElement', - 'passportAuthorizationForm' => 'PassportAuthorizationForm', - 'passportElementsWithErrors' => 'PassportElementsWithErrors', - 'encryptedCredentials' => 'EncryptedCredentials', - 'encryptedPassportElement' => 'EncryptedPassportElement', - 'InputPassportElementErrorSource' => 'InputPassportElementErrorSource', - 'inputPassportElementErrorSourceUnspecified' => 'InputPassportElementErrorSource::Unspecified', - 'inputPassportElementErrorSourceDataField' => 'InputPassportElementErrorSource::DataField', - 'inputPassportElementErrorSourceFrontSide' => 'InputPassportElementErrorSource::FrontSide', - 'inputPassportElementErrorSourceReverseSide' => 'InputPassportElementErrorSource::ReverseSide', - 'inputPassportElementErrorSourceSelfie' => 'InputPassportElementErrorSource::Selfie', - 'inputPassportElementErrorSourceTranslationFile' => 'InputPassportElementErrorSource::TranslationFile', - 'inputPassportElementErrorSourceTranslationFiles' => 'InputPassportElementErrorSource::TranslationFiles', - 'inputPassportElementErrorSourceFile' => 'InputPassportElementErrorSource::File', - 'inputPassportElementErrorSourceFiles' => 'InputPassportElementErrorSource::Files', - 'inputPassportElementError' => 'InputPassportElementError', - 'MessageContent' => 'MessageContent', - 'messageText' => 'MessageContent::Text', - 'messageAnimation' => 'MessageContent::Animation', - 'messageAudio' => 'MessageContent::Audio', - 'messageDocument' => 'MessageContent::Document', - 'messagePhoto' => 'MessageContent::Photo', - 'messageExpiredPhoto' => 'MessageContent::ExpiredPhoto', - 'messageSticker' => 'MessageContent::Sticker', - 'messageVideo' => 'MessageContent::Video', - 'messageExpiredVideo' => 'MessageContent::ExpiredVideo', - 'messageVideoNote' => 'MessageContent::VideoNote', - 'messageVoiceNote' => 'MessageContent::VoiceNote', - 'messageLocation' => 'MessageContent::Location', - 'messageVenue' => 'MessageContent::Venue', - 'messageContact' => 'MessageContent::Contact', - 'messageDice' => 'MessageContent::Dice', - 'messageGame' => 'MessageContent::Game', - 'messagePoll' => 'MessageContent::Poll', - 'messageInvoice' => 'MessageContent::Invoice', - 'messageCall' => 'MessageContent::Call', - 'messageVoiceChatScheduled' => 'MessageContent::VoiceChatScheduled', - 'messageVoiceChatStarted' => 'MessageContent::VoiceChatStarted', - 'messageVoiceChatEnded' => 'MessageContent::VoiceChatEnded', - 'messageInviteVoiceChatParticipants' => 'MessageContent::InviteVoiceChatParticipants', - 'messageBasicGroupChatCreate' => 'MessageContent::BasicGroupChatCreate', - 'messageSupergroupChatCreate' => 'MessageContent::SupergroupChatCreate', - 'messageChatChangeTitle' => 'MessageContent::ChatChangeTitle', - 'messageChatChangePhoto' => 'MessageContent::ChatChangePhoto', - 'messageChatDeletePhoto' => 'MessageContent::ChatDeletePhoto', - 'messageChatAddMembers' => 'MessageContent::ChatAddMembers', - 'messageChatJoinByLink' => 'MessageContent::ChatJoinByLink', - 'messageChatDeleteMember' => 'MessageContent::ChatDeleteMember', - 'messageChatUpgradeTo' => 'MessageContent::ChatUpgradeTo', - 'messageChatUpgradeFrom' => 'MessageContent::ChatUpgradeFrom', - 'messagePinMessage' => 'MessageContent::PinMessage', - 'messageScreenshotTaken' => 'MessageContent::ScreenshotTaken', - 'messageChatSetTtl' => 'MessageContent::ChatSetTtl', - 'messageCustomServiceAction' => 'MessageContent::CustomServiceAction', - 'messageGameScore' => 'MessageContent::GameScore', - 'messagePaymentSuccessful' => 'MessageContent::PaymentSuccessful', - 'messagePaymentSuccessfulBot' => 'MessageContent::PaymentSuccessfulBot', - 'messageContactRegistered' => 'MessageContent::ContactRegistered', - 'messageWebsiteConnected' => 'MessageContent::WebsiteConnected', - 'messagePassportDataSent' => 'MessageContent::PassportDataSent', - 'messagePassportDataReceived' => 'MessageContent::PassportDataReceived', - 'messageProximityAlertTriggered' => 'MessageContent::ProximityAlertTriggered', - 'messageUnsupported' => 'MessageContent::Unsupported', - 'TextEntityType' => 'TextEntityType', - 'textEntityTypeMention' => 'TextEntityType::Mention', - 'textEntityTypeHashtag' => 'TextEntityType::Hashtag', - 'textEntityTypeCashtag' => 'TextEntityType::Cashtag', - 'textEntityTypeBotCommand' => 'TextEntityType::BotCommand', - 'textEntityTypeUrl' => 'TextEntityType::Url', - 'textEntityTypeEmailAddress' => 'TextEntityType::EmailAddress', - 'textEntityTypePhoneNumber' => 'TextEntityType::PhoneNumber', - 'textEntityTypeBankCardNumber' => 'TextEntityType::BankCardNumber', - 'textEntityTypeBold' => 'TextEntityType::Bold', - 'textEntityTypeItalic' => 'TextEntityType::Italic', - 'textEntityTypeUnderline' => 'TextEntityType::Underline', - 'textEntityTypeStrikethrough' => 'TextEntityType::Strikethrough', - 'textEntityTypeCode' => 'TextEntityType::Code', - 'textEntityTypePre' => 'TextEntityType::Pre', - 'textEntityTypePreCode' => 'TextEntityType::PreCode', - 'textEntityTypeTextUrl' => 'TextEntityType::TextUrl', - 'textEntityTypeMentionName' => 'TextEntityType::MentionName', - 'inputThumbnail' => 'InputThumbnail', - 'MessageSchedulingState' => 'MessageSchedulingState', - 'messageSchedulingStateSendAtDate' => 'MessageSchedulingState::SendAtDate', - 'messageSchedulingStateSendWhenOnline' => 'MessageSchedulingState::SendWhenOnline', - 'messageSendOptions' => 'MessageSendOptions', - 'messageCopyOptions' => 'MessageCopyOptions', - 'InputMessageContent' => 'InputMessageContent', - 'inputMessageText' => 'InputMessageContent::Text', - 'inputMessageAnimation' => 'InputMessageContent::Animation', - 'inputMessageAudio' => 'InputMessageContent::Audio', - 'inputMessageDocument' => 'InputMessageContent::Document', - 'inputMessagePhoto' => 'InputMessageContent::Photo', - 'inputMessageSticker' => 'InputMessageContent::Sticker', - 'inputMessageVideo' => 'InputMessageContent::Video', - 'inputMessageVideoNote' => 'InputMessageContent::VideoNote', - 'inputMessageVoiceNote' => 'InputMessageContent::VoiceNote', - 'inputMessageLocation' => 'InputMessageContent::Location', - 'inputMessageVenue' => 'InputMessageContent::Venue', - 'inputMessageContact' => 'InputMessageContent::Contact', - 'inputMessageDice' => 'InputMessageContent::Dice', - 'inputMessageGame' => 'InputMessageContent::Game', - 'inputMessageInvoice' => 'InputMessageContent::Invoice', - 'inputMessagePoll' => 'InputMessageContent::Poll', - 'inputMessageForwarded' => 'InputMessageContent::Forwarded', - 'SearchMessagesFilter' => 'SearchMessagesFilter', - 'searchMessagesFilterEmpty' => 'SearchMessagesFilter::Empty', - 'searchMessagesFilterAnimation' => 'SearchMessagesFilter::Animation', - 'searchMessagesFilterAudio' => 'SearchMessagesFilter::Audio', - 'searchMessagesFilterDocument' => 'SearchMessagesFilter::Document', - 'searchMessagesFilterPhoto' => 'SearchMessagesFilter::Photo', - 'searchMessagesFilterVideo' => 'SearchMessagesFilter::Video', - 'searchMessagesFilterVoiceNote' => 'SearchMessagesFilter::VoiceNote', - 'searchMessagesFilterPhotoAndVideo' => 'SearchMessagesFilter::PhotoAndVideo', - 'searchMessagesFilterUrl' => 'SearchMessagesFilter::Url', - 'searchMessagesFilterChatPhoto' => 'SearchMessagesFilter::ChatPhoto', - 'searchMessagesFilterCall' => 'SearchMessagesFilter::Call', - 'searchMessagesFilterMissedCall' => 'SearchMessagesFilter::MissedCall', - 'searchMessagesFilterVideoNote' => 'SearchMessagesFilter::VideoNote', - 'searchMessagesFilterVoiceAndVideoNote' => 'SearchMessagesFilter::VoiceAndVideoNote', - 'searchMessagesFilterMention' => 'SearchMessagesFilter::Mention', - 'searchMessagesFilterUnreadMention' => 'SearchMessagesFilter::UnreadMention', - 'searchMessagesFilterFailedToSend' => 'SearchMessagesFilter::FailedToSend', - 'searchMessagesFilterPinned' => 'SearchMessagesFilter::Pinned', - 'ChatAction' => 'ChatAction', - 'chatActionTyping' => 'ChatAction::Typing', - 'chatActionRecordingVideo' => 'ChatAction::RecordingVideo', - 'chatActionUploadingVideo' => 'ChatAction::UploadingVideo', - 'chatActionRecordingVoiceNote' => 'ChatAction::RecordingVoiceNote', - 'chatActionUploadingVoiceNote' => 'ChatAction::UploadingVoiceNote', - 'chatActionUploadingPhoto' => 'ChatAction::UploadingPhoto', - 'chatActionUploadingDocument' => 'ChatAction::UploadingDocument', - 'chatActionChoosingLocation' => 'ChatAction::ChoosingLocation', - 'chatActionChoosingContact' => 'ChatAction::ChoosingContact', - 'chatActionStartPlayingGame' => 'ChatAction::StartPlayingGame', - 'chatActionRecordingVideoNote' => 'ChatAction::RecordingVideoNote', - 'chatActionUploadingVideoNote' => 'ChatAction::UploadingVideoNote', - 'chatActionCancel' => 'ChatAction::Cancel', - 'UserStatus' => 'UserStatus', - 'userStatusEmpty' => 'UserStatus::Empty', - 'userStatusOnline' => 'UserStatus::Online', - 'userStatusOffline' => 'UserStatus::Offline', - 'userStatusRecently' => 'UserStatus::Recently', - 'userStatusLastWeek' => 'UserStatus::LastWeek', - 'userStatusLastMonth' => 'UserStatus::LastMonth', - 'stickers' => 'Stickers', - 'emojis' => 'Emojis', - 'stickerSet' => 'StickerSet', - 'stickerSetInfo' => 'StickerSetInfo', - 'stickerSets' => 'StickerSets', - 'CallDiscardReason' => 'CallDiscardReason', - 'callDiscardReasonEmpty' => 'CallDiscardReason::Empty', - 'callDiscardReasonMissed' => 'CallDiscardReason::Missed', - 'callDiscardReasonDeclined' => 'CallDiscardReason::Declined', - 'callDiscardReasonDisconnected' => 'CallDiscardReason::Disconnected', - 'callDiscardReasonHungUp' => 'CallDiscardReason::HungUp', - 'callProtocol' => 'CallProtocol', - 'CallServerType' => 'CallServerType', - 'callServerTypeTelegramReflector' => 'CallServerType::TelegramReflector', - 'callServerTypeWebrtc' => 'CallServerType::Webrtc', - 'callServer' => 'CallServer', - 'callId' => 'CallId', - 'groupCallId' => 'GroupCallId', - 'CallState' => 'CallState', - 'callStatePending' => 'CallState::Pending', - 'callStateExchangingKeys' => 'CallState::ExchangingKeys', - 'callStateReady' => 'CallState::Ready', - 'callStateHangingUp' => 'CallState::HangingUp', - 'callStateDiscarded' => 'CallState::Discarded', - 'callStateError' => 'CallState::Error', - 'groupCallRecentSpeaker' => 'GroupCallRecentSpeaker', - 'groupCall' => 'GroupCall', - 'groupCallPayloadFingerprint' => 'GroupCallPayloadFingerprint', - 'groupCallPayload' => 'GroupCallPayload', - 'groupCallJoinResponseCandidate' => 'GroupCallJoinResponseCandidate', - 'GroupCallJoinResponse' => 'GroupCallJoinResponse', - 'groupCallJoinResponseWebrtc' => 'GroupCallJoinResponse::Webrtc', - 'groupCallJoinResponseStream' => 'GroupCallJoinResponse::Stream', - 'groupCallParticipant' => 'GroupCallParticipant', - 'CallProblem' => 'CallProblem', - 'callProblemEcho' => 'CallProblem::Echo', - 'callProblemNoise' => 'CallProblem::Noise', - 'callProblemInterruptions' => 'CallProblem::Interruptions', - 'callProblemDistortedSpeech' => 'CallProblem::DistortedSpeech', - 'callProblemSilentLocal' => 'CallProblem::SilentLocal', - 'callProblemSilentRemote' => 'CallProblem::SilentRemote', - 'callProblemDropped' => 'CallProblem::Dropped', - 'callProblemDistortedVideo' => 'CallProblem::DistortedVideo', - 'callProblemPixelatedVideo' => 'CallProblem::PixelatedVideo', - 'call' => 'Call', - 'phoneNumberAuthenticationSettings' => 'PhoneNumberAuthenticationSettings', - 'animations' => 'Animations', - 'DiceStickers' => 'DiceStickers', - 'diceStickersRegular' => 'DiceStickers::Regular', - 'diceStickersSlotMachine' => 'DiceStickers::SlotMachine', - 'importedContacts' => 'ImportedContacts', - 'httpUrl' => 'HttpUrl', - 'InputInlineQueryResult' => 'InputInlineQueryResult', - 'inputInlineQueryResultAnimation' => 'InputInlineQueryResult::Animation', - 'inputInlineQueryResultArticle' => 'InputInlineQueryResult::Article', - 'inputInlineQueryResultAudio' => 'InputInlineQueryResult::Audio', - 'inputInlineQueryResultContact' => 'InputInlineQueryResult::Contact', - 'inputInlineQueryResultDocument' => 'InputInlineQueryResult::Document', - 'inputInlineQueryResultGame' => 'InputInlineQueryResult::Game', - 'inputInlineQueryResultLocation' => 'InputInlineQueryResult::Location', - 'inputInlineQueryResultPhoto' => 'InputInlineQueryResult::Photo', - 'inputInlineQueryResultSticker' => 'InputInlineQueryResult::Sticker', - 'inputInlineQueryResultVenue' => 'InputInlineQueryResult::Venue', - 'inputInlineQueryResultVideo' => 'InputInlineQueryResult::Video', - 'inputInlineQueryResultVoiceNote' => 'InputInlineQueryResult::VoiceNote', - 'InlineQueryResult' => 'InlineQueryResult', - 'inlineQueryResultArticle' => 'InlineQueryResult::Article', - 'inlineQueryResultContact' => 'InlineQueryResult::Contact', - 'inlineQueryResultLocation' => 'InlineQueryResult::Location', - 'inlineQueryResultVenue' => 'InlineQueryResult::Venue', - 'inlineQueryResultGame' => 'InlineQueryResult::Game', - 'inlineQueryResultAnimation' => 'InlineQueryResult::Animation', - 'inlineQueryResultAudio' => 'InlineQueryResult::Audio', - 'inlineQueryResultDocument' => 'InlineQueryResult::Document', - 'inlineQueryResultPhoto' => 'InlineQueryResult::Photo', - 'inlineQueryResultSticker' => 'InlineQueryResult::Sticker', - 'inlineQueryResultVideo' => 'InlineQueryResult::Video', - 'inlineQueryResultVoiceNote' => 'InlineQueryResult::VoiceNote', - 'inlineQueryResults' => 'InlineQueryResults', - 'CallbackQueryPayload' => 'CallbackQueryPayload', - 'callbackQueryPayloadData' => 'CallbackQueryPayload::Data', - 'callbackQueryPayloadDataWithPassword' => 'CallbackQueryPayload::DataWithPassword', - 'callbackQueryPayloadGame' => 'CallbackQueryPayload::Game', - 'callbackQueryAnswer' => 'CallbackQueryAnswer', - 'customRequestResult' => 'CustomRequestResult', - 'gameHighScore' => 'GameHighScore', - 'gameHighScores' => 'GameHighScores', - 'ChatEventAction' => 'ChatEventAction', - 'chatEventMessageEdited' => 'ChatEventAction::MessageEdited', - 'chatEventMessageDeleted' => 'ChatEventAction::MessageDeleted', - 'chatEventPollStopped' => 'ChatEventAction::PollStopped', - 'chatEventMessagePinned' => 'ChatEventAction::MessagePinned', - 'chatEventMessageUnpinned' => 'ChatEventAction::MessageUnpinned', - 'chatEventMemberJoined' => 'ChatEventAction::MemberJoined', - 'chatEventMemberJoinedByInviteLink' => 'ChatEventAction::MemberJoinedByInviteLink', - 'chatEventMemberLeft' => 'ChatEventAction::MemberLeft', - 'chatEventMemberInvited' => 'ChatEventAction::MemberInvited', - 'chatEventMemberPromoted' => 'ChatEventAction::MemberPromoted', - 'chatEventMemberRestricted' => 'ChatEventAction::MemberRestricted', - 'chatEventTitleChanged' => 'ChatEventAction::TitleChanged', - 'chatEventPermissionsChanged' => 'ChatEventAction::PermissionsChanged', - 'chatEventDescriptionChanged' => 'ChatEventAction::DescriptionChanged', - 'chatEventUsernameChanged' => 'ChatEventAction::UsernameChanged', - 'chatEventPhotoChanged' => 'ChatEventAction::PhotoChanged', - 'chatEventInvitesToggled' => 'ChatEventAction::InvitesToggled', - 'chatEventLinkedChatChanged' => 'ChatEventAction::LinkedChatChanged', - 'chatEventSlowModeDelayChanged' => 'ChatEventAction::SlowModeDelayChanged', - 'chatEventMessageTtlSettingChanged' => 'ChatEventAction::MessageTtlSettingChanged', - 'chatEventSignMessagesToggled' => 'ChatEventAction::SignMessagesToggled', - 'chatEventStickerSetChanged' => 'ChatEventAction::StickerSetChanged', - 'chatEventLocationChanged' => 'ChatEventAction::LocationChanged', - 'chatEventIsAllHistoryAvailableToggled' => 'ChatEventAction::IsAllHistoryAvailableToggled', - 'chatEventInviteLinkEdited' => 'ChatEventAction::InviteLinkEdited', - 'chatEventInviteLinkRevoked' => 'ChatEventAction::InviteLinkRevoked', - 'chatEventInviteLinkDeleted' => 'ChatEventAction::InviteLinkDeleted', - 'chatEventVoiceChatCreated' => 'ChatEventAction::VoiceChatCreated', - 'chatEventVoiceChatDiscarded' => 'ChatEventAction::VoiceChatDiscarded', - 'chatEventVoiceChatParticipantIsMutedToggled' => 'ChatEventAction::VoiceChatParticipantIsMutedToggled', - 'chatEventVoiceChatParticipantVolumeLevelChanged' => 'ChatEventAction::VoiceChatParticipantVolumeLevelChanged', - 'chatEventVoiceChatMuteNewParticipantsToggled' => 'ChatEventAction::VoiceChatMuteNewParticipantsToggled', - 'chatEvent' => 'ChatEvent', - 'chatEvents' => 'ChatEvents', - 'chatEventLogFilters' => 'ChatEventLogFilters', - 'LanguagePackStringValue' => 'LanguagePackStringValue', - 'languagePackStringValueOrdinary' => 'LanguagePackStringValue::Ordinary', - 'languagePackStringValuePluralized' => 'LanguagePackStringValue::Pluralized', - 'languagePackStringValueDeleted' => 'LanguagePackStringValue::Deleted', - 'languagePackString' => 'LanguagePackString', - 'languagePackStrings' => 'LanguagePackStrings', - 'languagePackInfo' => 'LanguagePackInfo', - 'localizationTargetInfo' => 'LocalizationTargetInfo', - 'DeviceToken' => 'DeviceToken', - 'deviceTokenFirebaseCloudMessaging' => 'DeviceToken::FirebaseCloudMessaging', - 'deviceTokenApplePush' => 'DeviceToken::ApplePush', - 'deviceTokenApplePushVoIP' => 'DeviceToken::ApplePushVoIP', - 'deviceTokenWindowsPush' => 'DeviceToken::WindowsPush', - 'deviceTokenMicrosoftPush' => 'DeviceToken::MicrosoftPush', - 'deviceTokenMicrosoftPushVoIP' => 'DeviceToken::MicrosoftPushVoIP', - 'deviceTokenWebPush' => 'DeviceToken::WebPush', - 'deviceTokenSimplePush' => 'DeviceToken::SimplePush', - 'deviceTokenUbuntuPush' => 'DeviceToken::UbuntuPush', - 'deviceTokenBlackBerryPush' => 'DeviceToken::BlackBerryPush', - 'deviceTokenTizenPush' => 'DeviceToken::TizenPush', - 'pushReceiverId' => 'PushReceiverId', - 'BackgroundFill' => 'BackgroundFill', - 'backgroundFillSolid' => 'BackgroundFill::Solid', - 'backgroundFillGradient' => 'BackgroundFill::Gradient', - 'BackgroundType' => 'BackgroundType', - 'backgroundTypeWallpaper' => 'BackgroundType::Wallpaper', - 'backgroundTypePattern' => 'BackgroundType::Pattern', - 'backgroundTypeFill' => 'BackgroundType::Fill', - 'background' => 'Background', - 'backgrounds' => 'Backgrounds', - 'InputBackground' => 'InputBackground', - 'inputBackgroundLocal' => 'InputBackground::Local', - 'inputBackgroundRemote' => 'InputBackground::Remote', - 'hashtags' => 'Hashtags', - 'CanTransferOwnershipResult' => 'CanTransferOwnershipResult', - 'canTransferOwnershipResultOk' => 'CanTransferOwnershipResult::Ok', - 'canTransferOwnershipResultPasswordNeeded' => 'CanTransferOwnershipResult::PasswordNeeded', - 'canTransferOwnershipResultPasswordTooFresh' => 'CanTransferOwnershipResult::PasswordTooFresh', - 'canTransferOwnershipResultSessionTooFresh' => 'CanTransferOwnershipResult::SessionTooFresh', - 'CheckChatUsernameResult' => 'CheckChatUsernameResult', - 'checkChatUsernameResultOk' => 'CheckChatUsernameResult::Ok', - 'checkChatUsernameResultUsernameInvalid' => 'CheckChatUsernameResult::UsernameInvalid', - 'checkChatUsernameResultUsernameOccupied' => 'CheckChatUsernameResult::UsernameOccupied', - 'checkChatUsernameResultPublicChatsTooMuch' => 'CheckChatUsernameResult::PublicChatsTooMuch', - 'checkChatUsernameResultPublicGroupsUnavailable' => 'CheckChatUsernameResult::PublicGroupsUnavailable', - 'MessageFileType' => 'MessageFileType', - 'messageFileTypePrivate' => 'MessageFileType::Private', - 'messageFileTypeGroup' => 'MessageFileType::Group', - 'messageFileTypeUnknown' => 'MessageFileType::Unknown', - 'PushMessageContent' => 'PushMessageContent', - 'pushMessageContentHidden' => 'PushMessageContent::Hidden', - 'pushMessageContentAnimation' => 'PushMessageContent::Animation', - 'pushMessageContentAudio' => 'PushMessageContent::Audio', - 'pushMessageContentContact' => 'PushMessageContent::Contact', - 'pushMessageContentContactRegistered' => 'PushMessageContent::ContactRegistered', - 'pushMessageContentDocument' => 'PushMessageContent::Document', - 'pushMessageContentGame' => 'PushMessageContent::Game', - 'pushMessageContentGameScore' => 'PushMessageContent::GameScore', - 'pushMessageContentInvoice' => 'PushMessageContent::Invoice', - 'pushMessageContentLocation' => 'PushMessageContent::Location', - 'pushMessageContentPhoto' => 'PushMessageContent::Photo', - 'pushMessageContentPoll' => 'PushMessageContent::Poll', - 'pushMessageContentScreenshotTaken' => 'PushMessageContent::ScreenshotTaken', - 'pushMessageContentSticker' => 'PushMessageContent::Sticker', - 'pushMessageContentText' => 'PushMessageContent::Text', - 'pushMessageContentVideo' => 'PushMessageContent::Video', - 'pushMessageContentVideoNote' => 'PushMessageContent::VideoNote', - 'pushMessageContentVoiceNote' => 'PushMessageContent::VoiceNote', - 'pushMessageContentBasicGroupChatCreate' => 'PushMessageContent::BasicGroupChatCreate', - 'pushMessageContentChatAddMembers' => 'PushMessageContent::ChatAddMembers', - 'pushMessageContentChatChangePhoto' => 'PushMessageContent::ChatChangePhoto', - 'pushMessageContentChatChangeTitle' => 'PushMessageContent::ChatChangeTitle', - 'pushMessageContentChatDeleteMember' => 'PushMessageContent::ChatDeleteMember', - 'pushMessageContentChatJoinByLink' => 'PushMessageContent::ChatJoinByLink', - 'pushMessageContentMessageForwards' => 'PushMessageContent::MessageForwards', - 'pushMessageContentMediaAlbum' => 'PushMessageContent::MediaAlbum', - 'NotificationType' => 'NotificationType', - 'notificationTypeNewMessage' => 'NotificationType::NewMessage', - 'notificationTypeNewSecretChat' => 'NotificationType::NewSecretChat', - 'notificationTypeNewCall' => 'NotificationType::NewCall', - 'notificationTypeNewPushMessage' => 'NotificationType::NewPushMessage', - 'NotificationGroupType' => 'NotificationGroupType', - 'notificationGroupTypeMessages' => 'NotificationGroupType::Messages', - 'notificationGroupTypeMentions' => 'NotificationGroupType::Mentions', - 'notificationGroupTypeSecretChat' => 'NotificationGroupType::SecretChat', - 'notificationGroupTypeCalls' => 'NotificationGroupType::Calls', - 'notification' => 'Notification', - 'notificationGroup' => 'NotificationGroup', - 'OptionValue' => 'OptionValue', - 'optionValueBoolean' => 'OptionValue::Boolean', - 'optionValueEmpty' => 'OptionValue::Empty', - 'optionValueInteger' => 'OptionValue::Integer', - 'optionValueString' => 'OptionValue::String', - 'jsonObjectMember' => 'JsonObjectMember', - 'JsonValue' => 'JsonValue', - 'jsonValueNull' => 'JsonValue::Null', - 'jsonValueBoolean' => 'JsonValue::Boolean', - 'jsonValueNumber' => 'JsonValue::Number', - 'jsonValueString' => 'JsonValue::String', - 'jsonValueArray' => 'JsonValue::Array', - 'jsonValueObject' => 'JsonValue::Object', - 'UserPrivacySettingRule' => 'UserPrivacySettingRule', - 'userPrivacySettingRuleAllowAll' => 'UserPrivacySettingRule::AllowAll', - 'userPrivacySettingRuleAllowContacts' => 'UserPrivacySettingRule::AllowContacts', - 'userPrivacySettingRuleAllowUsers' => 'UserPrivacySettingRule::AllowUsers', - 'userPrivacySettingRuleAllowChatMembers' => 'UserPrivacySettingRule::AllowChatMembers', - 'userPrivacySettingRuleRestrictAll' => 'UserPrivacySettingRule::RestrictAll', - 'userPrivacySettingRuleRestrictContacts' => 'UserPrivacySettingRule::RestrictContacts', - 'userPrivacySettingRuleRestrictUsers' => 'UserPrivacySettingRule::RestrictUsers', - 'userPrivacySettingRuleRestrictChatMembers' => 'UserPrivacySettingRule::RestrictChatMembers', - 'userPrivacySettingRules' => 'UserPrivacySettingRules', - 'UserPrivacySetting' => 'UserPrivacySetting', - 'userPrivacySettingShowStatus' => 'UserPrivacySetting::ShowStatus', - 'userPrivacySettingShowProfilePhoto' => 'UserPrivacySetting::ShowProfilePhoto', - 'userPrivacySettingShowLinkInForwardedMessages' => 'UserPrivacySetting::ShowLinkInForwardedMessages', - 'userPrivacySettingShowPhoneNumber' => 'UserPrivacySetting::ShowPhoneNumber', - 'userPrivacySettingAllowChatInvites' => 'UserPrivacySetting::AllowChatInvites', - 'userPrivacySettingAllowCalls' => 'UserPrivacySetting::AllowCalls', - 'userPrivacySettingAllowPeerToPeerCalls' => 'UserPrivacySetting::AllowPeerToPeerCalls', - 'userPrivacySettingAllowFindingByPhoneNumber' => 'UserPrivacySetting::AllowFindingByPhoneNumber', - 'accountTtl' => 'AccountTtl', - 'session' => 'Session', - 'sessions' => 'Sessions', - 'connectedWebsite' => 'ConnectedWebsite', - 'connectedWebsites' => 'ConnectedWebsites', - 'ChatReportReason' => 'ChatReportReason', - 'chatReportReasonSpam' => 'ChatReportReason::Spam', - 'chatReportReasonViolence' => 'ChatReportReason::Violence', - 'chatReportReasonPornography' => 'ChatReportReason::Pornography', - 'chatReportReasonChildAbuse' => 'ChatReportReason::ChildAbuse', - 'chatReportReasonCopyright' => 'ChatReportReason::Copyright', - 'chatReportReasonUnrelatedLocation' => 'ChatReportReason::UnrelatedLocation', - 'chatReportReasonFake' => 'ChatReportReason::Fake', - 'chatReportReasonCustom' => 'ChatReportReason::Custom', - 'messageLink' => 'MessageLink', - 'messageLinkInfo' => 'MessageLinkInfo', - 'filePart' => 'FilePart', - 'FileType' => 'FileType', - 'fileTypeNone' => 'FileType::None', - 'fileTypeAnimation' => 'FileType::Animation', - 'fileTypeAudio' => 'FileType::Audio', - 'fileTypeDocument' => 'FileType::Document', - 'fileTypePhoto' => 'FileType::Photo', - 'fileTypeProfilePhoto' => 'FileType::ProfilePhoto', - 'fileTypeSecret' => 'FileType::Secret', - 'fileTypeSecretThumbnail' => 'FileType::SecretThumbnail', - 'fileTypeSecure' => 'FileType::Secure', - 'fileTypeSticker' => 'FileType::Sticker', - 'fileTypeThumbnail' => 'FileType::Thumbnail', - 'fileTypeUnknown' => 'FileType::Unknown', - 'fileTypeVideo' => 'FileType::Video', - 'fileTypeVideoNote' => 'FileType::VideoNote', - 'fileTypeVoiceNote' => 'FileType::VoiceNote', - 'fileTypeWallpaper' => 'FileType::Wallpaper', - 'storageStatisticsByFileType' => 'StorageStatisticsByFileType', - 'storageStatisticsByChat' => 'StorageStatisticsByChat', - 'storageStatistics' => 'StorageStatistics', - 'storageStatisticsFast' => 'StorageStatisticsFast', - 'databaseStatistics' => 'DatabaseStatistics', - 'NetworkType' => 'NetworkType', - 'networkTypeNone' => 'NetworkType::None', - 'networkTypeMobile' => 'NetworkType::Mobile', - 'networkTypeMobileRoaming' => 'NetworkType::MobileRoaming', - 'networkTypeWiFi' => 'NetworkType::WiFi', - 'networkTypeOther' => 'NetworkType::Other', - 'NetworkStatisticsEntry' => 'NetworkStatisticsEntry', - 'networkStatisticsEntryFile' => 'NetworkStatisticsEntry::File', - 'networkStatisticsEntryCall' => 'NetworkStatisticsEntry::Call', - 'networkStatistics' => 'NetworkStatistics', - 'autoDownloadSettings' => 'AutoDownloadSettings', - 'autoDownloadSettingsPresets' => 'AutoDownloadSettingsPresets', - 'ConnectionState' => 'ConnectionState', - 'connectionStateWaitingForNetwork' => 'ConnectionState::WaitingForNetwork', - 'connectionStateConnectingToProxy' => 'ConnectionState::ConnectingToProxy', - 'connectionStateConnecting' => 'ConnectionState::Connecting', - 'connectionStateUpdating' => 'ConnectionState::Updating', - 'connectionStateReady' => 'ConnectionState::Ready', - 'TopChatCategory' => 'TopChatCategory', - 'topChatCategoryUsers' => 'TopChatCategory::Users', - 'topChatCategoryBots' => 'TopChatCategory::Bots', - 'topChatCategoryGroups' => 'TopChatCategory::Groups', - 'topChatCategoryChannels' => 'TopChatCategory::Channels', - 'topChatCategoryInlineBots' => 'TopChatCategory::InlineBots', - 'topChatCategoryCalls' => 'TopChatCategory::Calls', - 'topChatCategoryForwardChats' => 'TopChatCategory::ForwardChats', - 'TMeUrlType' => 'TMeUrlType', - 'tMeUrlTypeUser' => 'TMeUrlType::User', - 'tMeUrlTypeSupergroup' => 'TMeUrlType::Supergroup', - 'tMeUrlTypeChatInvite' => 'TMeUrlType::ChatInvite', - 'tMeUrlTypeStickerSet' => 'TMeUrlType::StickerSet', - 'tMeUrl' => 'TMeUrl', - 'tMeUrls' => 'TMeUrls', - 'SuggestedAction' => 'SuggestedAction', - 'suggestedActionEnableArchiveAndMuteNewChats' => 'SuggestedAction::EnableArchiveAndMuteNewChats', - 'suggestedActionCheckPhoneNumber' => 'SuggestedAction::CheckPhoneNumber', - 'suggestedActionSeeTicksHint' => 'SuggestedAction::SeeTicksHint', - 'suggestedActionConvertToBroadcastGroup' => 'SuggestedAction::ConvertToBroadcastGroup', - 'count' => 'Count', - 'text' => 'Text', - 'seconds' => 'Seconds', - 'deepLinkInfo' => 'DeepLinkInfo', - 'TextParseMode' => 'TextParseMode', - 'textParseModeMarkdown' => 'TextParseMode::Markdown', - 'textParseModeHTML' => 'TextParseMode::HTML', - 'ProxyType' => 'ProxyType', - 'proxyTypeSocks5' => 'ProxyType::Socks5', - 'proxyTypeHttp' => 'ProxyType::Http', - 'proxyTypeMtproto' => 'ProxyType::Mtproto', - 'proxy' => 'Proxy', - 'proxies' => 'Proxies', - 'InputSticker' => 'InputSticker', - 'inputStickerStatic' => 'InputSticker::Static', - 'inputStickerAnimated' => 'InputSticker::Animated', - 'dateRange' => 'DateRange', - 'statisticalValue' => 'StatisticalValue', - 'StatisticalGraph' => 'StatisticalGraph', - 'statisticalGraphData' => 'StatisticalGraph::Data', - 'statisticalGraphAsync' => 'StatisticalGraph::Async', - 'statisticalGraphError' => 'StatisticalGraph::Error', - 'chatStatisticsMessageInteractionInfo' => 'ChatStatisticsMessageInteractionInfo', - 'chatStatisticsMessageSenderInfo' => 'ChatStatisticsMessageSenderInfo', - 'chatStatisticsAdministratorActionsInfo' => 'ChatStatisticsAdministratorActionsInfo', - 'chatStatisticsInviterInfo' => 'ChatStatisticsInviterInfo', - 'ChatStatistics' => 'ChatStatistics', - 'chatStatisticsSupergroup' => 'ChatStatistics::Supergroup', - 'chatStatisticsChannel' => 'ChatStatistics::Channel', - 'messageStatistics' => 'MessageStatistics', - 'point' => 'Point', - 'VectorPathCommand' => 'VectorPathCommand', - 'vectorPathCommandLine' => 'VectorPathCommand::Line', - 'vectorPathCommandCubicBezierCurve' => 'VectorPathCommand::CubicBezierCurve', - 'Update' => 'Update', - 'updateAuthorizationState' => 'Update::AuthorizationState', - 'updateNewMessage' => 'Update::NewMessage', - 'updateMessageSendAcknowledged' => 'Update::MessageSendAcknowledged', - 'updateMessageSendSucceeded' => 'Update::MessageSendSucceeded', - 'updateMessageSendFailed' => 'Update::MessageSendFailed', - 'updateMessageContent' => 'Update::MessageContent', - 'updateMessageEdited' => 'Update::MessageEdited', - 'updateMessageIsPinned' => 'Update::MessageIsPinned', - 'updateMessageInteractionInfo' => 'Update::MessageInteractionInfo', - 'updateMessageContentOpened' => 'Update::MessageContentOpened', - 'updateMessageMentionRead' => 'Update::MessageMentionRead', - 'updateMessageLiveLocationViewed' => 'Update::MessageLiveLocationViewed', - 'updateNewChat' => 'Update::NewChat', - 'updateChatTitle' => 'Update::ChatTitle', - 'updateChatPhoto' => 'Update::ChatPhoto', - 'updateChatPermissions' => 'Update::ChatPermissions', - 'updateChatLastMessage' => 'Update::ChatLastMessage', - 'updateChatPosition' => 'Update::ChatPosition', - 'updateChatIsMarkedAsUnread' => 'Update::ChatIsMarkedAsUnread', - 'updateChatIsBlocked' => 'Update::ChatIsBlocked', - 'updateChatHasScheduledMessages' => 'Update::ChatHasScheduledMessages', - 'updateChatVoiceChat' => 'Update::ChatVoiceChat', - 'updateChatDefaultDisableNotification' => 'Update::ChatDefaultDisableNotification', - 'updateChatReadInbox' => 'Update::ChatReadInbox', - 'updateChatReadOutbox' => 'Update::ChatReadOutbox', - 'updateChatUnreadMentionCount' => 'Update::ChatUnreadMentionCount', - 'updateChatNotificationSettings' => 'Update::ChatNotificationSettings', - 'updateScopeNotificationSettings' => 'Update::ScopeNotificationSettings', - 'updateChatMessageTtlSetting' => 'Update::ChatMessageTtlSetting', - 'updateChatActionBar' => 'Update::ChatActionBar', - 'updateChatReplyMarkup' => 'Update::ChatReplyMarkup', - 'updateChatDraftMessage' => 'Update::ChatDraftMessage', - 'updateChatFilters' => 'Update::ChatFilters', - 'updateChatOnlineMemberCount' => 'Update::ChatOnlineMemberCount', - 'updateNotification' => 'Update::Notification', - 'updateNotificationGroup' => 'Update::NotificationGroup', - 'updateActiveNotifications' => 'Update::ActiveNotifications', - 'updateHavePendingNotifications' => 'Update::HavePendingNotifications', - 'updateDeleteMessages' => 'Update::DeleteMessages', - 'updateUserChatAction' => 'Update::UserChatAction', - 'updateUserStatus' => 'Update::UserStatus', - 'updateUser' => 'Update::User', - 'updateBasicGroup' => 'Update::BasicGroup', - 'updateSupergroup' => 'Update::Supergroup', - 'updateSecretChat' => 'Update::SecretChat', - 'updateUserFullInfo' => 'Update::UserFullInfo', - 'updateBasicGroupFullInfo' => 'Update::BasicGroupFullInfo', - 'updateSupergroupFullInfo' => 'Update::SupergroupFullInfo', - 'updateServiceNotification' => 'Update::ServiceNotification', - 'updateFile' => 'Update::File', - 'updateFileGenerationStart' => 'Update::FileGenerationStart', - 'updateFileGenerationStop' => 'Update::FileGenerationStop', - 'updateCall' => 'Update::Call', - 'updateGroupCall' => 'Update::GroupCall', - 'updateGroupCallParticipant' => 'Update::GroupCallParticipant', - 'updateNewCallSignalingData' => 'Update::NewCallSignalingData', - 'updateUserPrivacySettingRules' => 'Update::UserPrivacySettingRules', - 'updateUnreadMessageCount' => 'Update::UnreadMessageCount', - 'updateUnreadChatCount' => 'Update::UnreadChatCount', - 'updateOption' => 'Update::Option', - 'updateStickerSet' => 'Update::StickerSet', - 'updateInstalledStickerSets' => 'Update::InstalledStickerSets', - 'updateTrendingStickerSets' => 'Update::TrendingStickerSets', - 'updateRecentStickers' => 'Update::RecentStickers', - 'updateFavoriteStickers' => 'Update::FavoriteStickers', - 'updateSavedAnimations' => 'Update::SavedAnimations', - 'updateSelectedBackground' => 'Update::SelectedBackground', - 'updateLanguagePackStrings' => 'Update::LanguagePackStrings', - 'updateConnectionState' => 'Update::ConnectionState', - 'updateTermsOfService' => 'Update::TermsOfService', - 'updateUsersNearby' => 'Update::UsersNearby', - 'updateDiceEmojis' => 'Update::DiceEmojis', - 'updateAnimationSearchParameters' => 'Update::AnimationSearchParameters', - 'updateSuggestedActions' => 'Update::SuggestedActions', - 'updateNewInlineQuery' => 'Update::NewInlineQuery', - 'updateNewChosenInlineResult' => 'Update::NewChosenInlineResult', - 'updateNewCallbackQuery' => 'Update::NewCallbackQuery', - 'updateNewInlineCallbackQuery' => 'Update::NewInlineCallbackQuery', - 'updateNewShippingQuery' => 'Update::NewShippingQuery', - 'updateNewPreCheckoutQuery' => 'Update::NewPreCheckoutQuery', - 'updateNewCustomEvent' => 'Update::NewCustomEvent', - 'updateNewCustomQuery' => 'Update::NewCustomQuery', - 'updatePoll' => 'Update::Poll', - 'updatePollAnswer' => 'Update::PollAnswer', - 'updateChatMember' => 'Update::ChatMember', - 'updates' => 'Updates', - 'LogStream' => 'LogStream', - 'logStreamDefault' => 'LogStream::Default', - 'logStreamFile' => 'LogStream::File', - 'logStreamEmpty' => 'LogStream::Empty', - 'logVerbosityLevel' => 'LogVerbosityLevel', - 'logTags' => 'LogTags' + 'error' => 'Error', + 'ok' => 'Ok', + 'AuthenticationCodeType' => 'AuthenticationCodeType', + 'authenticationCodeTypeTelegramMessage' => 'AuthenticationCodeType::TelegramMessage', + 'authenticationCodeTypeSms' => 'AuthenticationCodeType::Sms', + 'authenticationCodeTypeSmsWord' => 'AuthenticationCodeType::SmsWord', + 'authenticationCodeTypeSmsPhrase' => 'AuthenticationCodeType::SmsPhrase', + 'authenticationCodeTypeCall' => 'AuthenticationCodeType::Call', + 'authenticationCodeTypeFlashCall' => 'AuthenticationCodeType::FlashCall', + 'authenticationCodeTypeMissedCall' => 'AuthenticationCodeType::MissedCall', + 'authenticationCodeTypeFragment' => 'AuthenticationCodeType::Fragment', + 'authenticationCodeTypeFirebaseAndroid' => 'AuthenticationCodeType::FirebaseAndroid', + 'authenticationCodeTypeFirebaseIos' => 'AuthenticationCodeType::FirebaseIos', + 'authenticationCodeInfo' => 'AuthenticationCodeInfo', + 'emailAddressAuthenticationCodeInfo' => 'EmailAddressAuthenticationCodeInfo', + 'EmailAddressAuthentication' => 'EmailAddressAuthentication', + 'emailAddressAuthenticationCode' => 'EmailAddressAuthentication::Code', + 'emailAddressAuthenticationAppleId' => 'EmailAddressAuthentication::AppleId', + 'emailAddressAuthenticationGoogleId' => 'EmailAddressAuthentication::GoogleId', + 'EmailAddressResetState' => 'EmailAddressResetState', + 'emailAddressResetStateAvailable' => 'EmailAddressResetState::Available', + 'emailAddressResetStatePending' => 'EmailAddressResetState::Pending', + 'textEntity' => 'TextEntity', + 'textEntities' => 'TextEntities', + 'formattedText' => 'FormattedText', + 'termsOfService' => 'TermsOfService', + 'AuthorizationState' => 'AuthorizationState', + 'authorizationStateWaitTdlibParameters' => 'AuthorizationState::WaitTdlibParameters', + 'authorizationStateWaitPhoneNumber' => 'AuthorizationState::WaitPhoneNumber', + 'authorizationStateWaitEmailAddress' => 'AuthorizationState::WaitEmailAddress', + 'authorizationStateWaitEmailCode' => 'AuthorizationState::WaitEmailCode', + 'authorizationStateWaitCode' => 'AuthorizationState::WaitCode', + 'authorizationStateWaitOtherDeviceConfirmation' => 'AuthorizationState::WaitOtherDeviceConfirmation', + 'authorizationStateWaitRegistration' => 'AuthorizationState::WaitRegistration', + 'authorizationStateWaitPassword' => 'AuthorizationState::WaitPassword', + 'authorizationStateReady' => 'AuthorizationState::Ready', + 'authorizationStateLoggingOut' => 'AuthorizationState::LoggingOut', + 'authorizationStateClosing' => 'AuthorizationState::Closing', + 'authorizationStateClosed' => 'AuthorizationState::Closed', + 'FirebaseDeviceVerificationParameters' => 'FirebaseDeviceVerificationParameters', + 'firebaseDeviceVerificationParametersSafetyNet' => 'FirebaseDeviceVerificationParameters::SafetyNet', + 'firebaseDeviceVerificationParametersPlayIntegrity' => 'FirebaseDeviceVerificationParameters::PlayIntegrity', + 'passwordState' => 'PasswordState', + 'recoveryEmailAddress' => 'RecoveryEmailAddress', + 'temporaryPasswordState' => 'TemporaryPasswordState', + 'localFile' => 'LocalFile', + 'remoteFile' => 'RemoteFile', + 'file' => 'File', + 'InputFile' => 'InputFile', + 'inputFileId' => 'InputFile::Id', + 'inputFileRemote' => 'InputFile::Remote', + 'inputFileLocal' => 'InputFile::Local', + 'inputFileGenerated' => 'InputFile::Generated', + 'photoSize' => 'PhotoSize', + 'minithumbnail' => 'Minithumbnail', + 'ThumbnailFormat' => 'ThumbnailFormat', + 'thumbnailFormatJpeg' => 'ThumbnailFormat::Jpeg', + 'thumbnailFormatGif' => 'ThumbnailFormat::Gif', + 'thumbnailFormatMpeg4' => 'ThumbnailFormat::Mpeg4', + 'thumbnailFormatPng' => 'ThumbnailFormat::Png', + 'thumbnailFormatTgs' => 'ThumbnailFormat::Tgs', + 'thumbnailFormatWebm' => 'ThumbnailFormat::Webm', + 'thumbnailFormatWebp' => 'ThumbnailFormat::Webp', + 'thumbnail' => 'Thumbnail', + 'MaskPoint' => 'MaskPoint', + 'maskPointForehead' => 'MaskPoint::Forehead', + 'maskPointEyes' => 'MaskPoint::Eyes', + 'maskPointMouth' => 'MaskPoint::Mouth', + 'maskPointChin' => 'MaskPoint::Chin', + 'maskPosition' => 'MaskPosition', + 'StickerFormat' => 'StickerFormat', + 'stickerFormatWebp' => 'StickerFormat::Webp', + 'stickerFormatTgs' => 'StickerFormat::Tgs', + 'stickerFormatWebm' => 'StickerFormat::Webm', + 'StickerType' => 'StickerType', + 'stickerTypeRegular' => 'StickerType::Regular', + 'stickerTypeMask' => 'StickerType::Mask', + 'stickerTypeCustomEmoji' => 'StickerType::CustomEmoji', + 'StickerFullType' => 'StickerFullType', + 'stickerFullTypeRegular' => 'StickerFullType::Regular', + 'stickerFullTypeMask' => 'StickerFullType::Mask', + 'stickerFullTypeCustomEmoji' => 'StickerFullType::CustomEmoji', + 'closedVectorPath' => 'ClosedVectorPath', + 'pollOption' => 'PollOption', + 'PollType' => 'PollType', + 'pollTypeRegular' => 'PollType::Regular', + 'pollTypeQuiz' => 'PollType::Quiz', + 'animation' => 'Animation', + 'audio' => 'Audio', + 'document' => 'Document', + 'photo' => 'Photo', + 'sticker' => 'Sticker', + 'video' => 'Video', + 'videoNote' => 'VideoNote', + 'voiceNote' => 'VoiceNote', + 'animatedEmoji' => 'AnimatedEmoji', + 'contact' => 'Contact', + 'location' => 'Location', + 'venue' => 'Venue', + 'game' => 'Game', + 'webApp' => 'WebApp', + 'poll' => 'Poll', + 'background' => 'Background', + 'backgrounds' => 'Backgrounds', + 'chatBackground' => 'ChatBackground', + 'profilePhoto' => 'ProfilePhoto', + 'chatPhotoInfo' => 'ChatPhotoInfo', + 'UserType' => 'UserType', + 'userTypeRegular' => 'UserType::Regular', + 'userTypeDeleted' => 'UserType::Deleted', + 'userTypeBot' => 'UserType::Bot', + 'userTypeUnknown' => 'UserType::Unknown', + 'botCommand' => 'BotCommand', + 'botCommands' => 'BotCommands', + 'botMenuButton' => 'BotMenuButton', + 'chatLocation' => 'ChatLocation', + 'birthdate' => 'Birthdate', + 'closeBirthdayUser' => 'CloseBirthdayUser', + 'BusinessAwayMessageSchedule' => 'BusinessAwayMessageSchedule', + 'businessAwayMessageScheduleAlways' => 'BusinessAwayMessageSchedule::Always', + 'businessAwayMessageScheduleOutsideOfOpeningHours' => 'BusinessAwayMessageSchedule::OutsideOfOpeningHours', + 'businessAwayMessageScheduleCustom' => 'BusinessAwayMessageSchedule::Custom', + 'businessLocation' => 'BusinessLocation', + 'businessRecipients' => 'BusinessRecipients', + 'businessAwayMessageSettings' => 'BusinessAwayMessageSettings', + 'businessGreetingMessageSettings' => 'BusinessGreetingMessageSettings', + 'businessConnectedBot' => 'BusinessConnectedBot', + 'businessStartPage' => 'BusinessStartPage', + 'inputBusinessStartPage' => 'InputBusinessStartPage', + 'businessOpeningHoursInterval' => 'BusinessOpeningHoursInterval', + 'businessOpeningHours' => 'BusinessOpeningHours', + 'businessInfo' => 'BusinessInfo', + 'businessChatLink' => 'BusinessChatLink', + 'businessChatLinks' => 'BusinessChatLinks', + 'inputBusinessChatLink' => 'InputBusinessChatLink', + 'businessChatLinkInfo' => 'BusinessChatLinkInfo', + 'ChatPhotoStickerType' => 'ChatPhotoStickerType', + 'chatPhotoStickerTypeRegularOrMask' => 'ChatPhotoStickerType::RegularOrMask', + 'chatPhotoStickerTypeCustomEmoji' => 'ChatPhotoStickerType::CustomEmoji', + 'chatPhotoSticker' => 'ChatPhotoSticker', + 'animatedChatPhoto' => 'AnimatedChatPhoto', + 'chatPhoto' => 'ChatPhoto', + 'chatPhotos' => 'ChatPhotos', + 'InputChatPhoto' => 'InputChatPhoto', + 'inputChatPhotoPrevious' => 'InputChatPhoto::Previous', + 'inputChatPhotoStatic' => 'InputChatPhoto::Static', + 'inputChatPhotoAnimation' => 'InputChatPhoto::Animation', + 'inputChatPhotoSticker' => 'InputChatPhoto::Sticker', + 'chatPermissions' => 'ChatPermissions', + 'chatAdministratorRights' => 'ChatAdministratorRights', + 'starSubscriptionPricing' => 'StarSubscriptionPricing', + 'starSubscription' => 'StarSubscription', + 'starSubscriptions' => 'StarSubscriptions', + 'productInfo' => 'ProductInfo', + 'premiumPaymentOption' => 'PremiumPaymentOption', + 'premiumStatePaymentOption' => 'PremiumStatePaymentOption', + 'premiumGiftCodePaymentOption' => 'PremiumGiftCodePaymentOption', + 'premiumGiftCodePaymentOptions' => 'PremiumGiftCodePaymentOptions', + 'premiumGiftCodeInfo' => 'PremiumGiftCodeInfo', + 'starPaymentOption' => 'StarPaymentOption', + 'starPaymentOptions' => 'StarPaymentOptions', + 'StarTransactionDirection' => 'StarTransactionDirection', + 'starTransactionDirectionIncoming' => 'StarTransactionDirection::Incoming', + 'starTransactionDirectionOutgoing' => 'StarTransactionDirection::Outgoing', + 'BotTransactionPurpose' => 'BotTransactionPurpose', + 'botTransactionPurposePaidMedia' => 'BotTransactionPurpose::PaidMedia', + 'botTransactionPurposeInvoicePayment' => 'BotTransactionPurpose::InvoicePayment', + 'ChannelTransactionPurpose' => 'ChannelTransactionPurpose', + 'channelTransactionPurposePaidMedia' => 'ChannelTransactionPurpose::PaidMedia', + 'channelTransactionPurposeJoin' => 'ChannelTransactionPurpose::Join', + 'channelTransactionPurposeReaction' => 'ChannelTransactionPurpose::Reaction', + 'StarTransactionPartner' => 'StarTransactionPartner', + 'starTransactionPartnerTelegram' => 'StarTransactionPartner::Telegram', + 'starTransactionPartnerAppStore' => 'StarTransactionPartner::AppStore', + 'starTransactionPartnerGooglePlay' => 'StarTransactionPartner::GooglePlay', + 'starTransactionPartnerFragment' => 'StarTransactionPartner::Fragment', + 'starTransactionPartnerTelegramAds' => 'StarTransactionPartner::TelegramAds', + 'starTransactionPartnerBot' => 'StarTransactionPartner::Bot', + 'starTransactionPartnerBusiness' => 'StarTransactionPartner::Business', + 'starTransactionPartnerChannel' => 'StarTransactionPartner::Channel', + 'starTransactionPartnerUser' => 'StarTransactionPartner::User', + 'starTransactionPartnerUnsupported' => 'StarTransactionPartner::Unsupported', + 'starTransaction' => 'StarTransaction', + 'starTransactions' => 'StarTransactions', + 'PremiumGiveawayParticipantStatus' => 'PremiumGiveawayParticipantStatus', + 'premiumGiveawayParticipantStatusEligible' => 'PremiumGiveawayParticipantStatus::Eligible', + 'premiumGiveawayParticipantStatusParticipating' => 'PremiumGiveawayParticipantStatus::Participating', + 'premiumGiveawayParticipantStatusAlreadyWasMember' => 'PremiumGiveawayParticipantStatus::AlreadyWasMember', + 'premiumGiveawayParticipantStatusAdministrator' => 'PremiumGiveawayParticipantStatus::Administrator', + 'premiumGiveawayParticipantStatusDisallowedCountry' => 'PremiumGiveawayParticipantStatus::DisallowedCountry', + 'PremiumGiveawayInfo' => 'PremiumGiveawayInfo', + 'premiumGiveawayInfoOngoing' => 'PremiumGiveawayInfo::Ongoing', + 'premiumGiveawayInfoCompleted' => 'PremiumGiveawayInfo::Completed', + 'accentColor' => 'AccentColor', + 'profileAccentColors' => 'ProfileAccentColors', + 'profileAccentColor' => 'ProfileAccentColor', + 'emojiStatus' => 'EmojiStatus', + 'emojiStatuses' => 'EmojiStatuses', + 'usernames' => 'Usernames', + 'user' => 'User', + 'botInfo' => 'BotInfo', + 'userFullInfo' => 'UserFullInfo', + 'users' => 'Users', + 'foundUsers' => 'FoundUsers', + 'chatAdministrator' => 'ChatAdministrator', + 'chatAdministrators' => 'ChatAdministrators', + 'ChatMemberStatus' => 'ChatMemberStatus', + 'chatMemberStatusCreator' => 'ChatMemberStatus::Creator', + 'chatMemberStatusAdministrator' => 'ChatMemberStatus::Administrator', + 'chatMemberStatusMember' => 'ChatMemberStatus::Member', + 'chatMemberStatusRestricted' => 'ChatMemberStatus::Restricted', + 'chatMemberStatusLeft' => 'ChatMemberStatus::Left', + 'chatMemberStatusBanned' => 'ChatMemberStatus::Banned', + 'chatMember' => 'ChatMember', + 'chatMembers' => 'ChatMembers', + 'ChatMembersFilter' => 'ChatMembersFilter', + 'chatMembersFilterContacts' => 'ChatMembersFilter::Contacts', + 'chatMembersFilterAdministrators' => 'ChatMembersFilter::Administrators', + 'chatMembersFilterMembers' => 'ChatMembersFilter::Members', + 'chatMembersFilterMention' => 'ChatMembersFilter::Mention', + 'chatMembersFilterRestricted' => 'ChatMembersFilter::Restricted', + 'chatMembersFilterBanned' => 'ChatMembersFilter::Banned', + 'chatMembersFilterBots' => 'ChatMembersFilter::Bots', + 'SupergroupMembersFilter' => 'SupergroupMembersFilter', + 'supergroupMembersFilterRecent' => 'SupergroupMembersFilter::Recent', + 'supergroupMembersFilterContacts' => 'SupergroupMembersFilter::Contacts', + 'supergroupMembersFilterAdministrators' => 'SupergroupMembersFilter::Administrators', + 'supergroupMembersFilterSearch' => 'SupergroupMembersFilter::Search', + 'supergroupMembersFilterRestricted' => 'SupergroupMembersFilter::Restricted', + 'supergroupMembersFilterBanned' => 'SupergroupMembersFilter::Banned', + 'supergroupMembersFilterMention' => 'SupergroupMembersFilter::Mention', + 'supergroupMembersFilterBots' => 'SupergroupMembersFilter::Bots', + 'chatInviteLink' => 'ChatInviteLink', + 'chatInviteLinks' => 'ChatInviteLinks', + 'chatInviteLinkCount' => 'ChatInviteLinkCount', + 'chatInviteLinkCounts' => 'ChatInviteLinkCounts', + 'chatInviteLinkMember' => 'ChatInviteLinkMember', + 'chatInviteLinkMembers' => 'ChatInviteLinkMembers', + 'InviteLinkChatType' => 'InviteLinkChatType', + 'inviteLinkChatTypeBasicGroup' => 'InviteLinkChatType::BasicGroup', + 'inviteLinkChatTypeSupergroup' => 'InviteLinkChatType::Supergroup', + 'inviteLinkChatTypeChannel' => 'InviteLinkChatType::Channel', + 'chatInviteLinkSubscriptionInfo' => 'ChatInviteLinkSubscriptionInfo', + 'chatInviteLinkInfo' => 'ChatInviteLinkInfo', + 'chatJoinRequest' => 'ChatJoinRequest', + 'chatJoinRequests' => 'ChatJoinRequests', + 'chatJoinRequestsInfo' => 'ChatJoinRequestsInfo', + 'basicGroup' => 'BasicGroup', + 'basicGroupFullInfo' => 'BasicGroupFullInfo', + 'supergroup' => 'Supergroup', + 'supergroupFullInfo' => 'SupergroupFullInfo', + 'SecretChatState' => 'SecretChatState', + 'secretChatStatePending' => 'SecretChatState::Pending', + 'secretChatStateReady' => 'SecretChatState::Ready', + 'secretChatStateClosed' => 'SecretChatState::Closed', + 'secretChat' => 'SecretChat', + 'MessageSender' => 'MessageSender', + 'messageSenderUser' => 'MessageSender::User', + 'messageSenderChat' => 'MessageSender::Chat', + 'messageSenders' => 'MessageSenders', + 'chatMessageSender' => 'ChatMessageSender', + 'chatMessageSenders' => 'ChatMessageSenders', + 'MessageReadDate' => 'MessageReadDate', + 'messageReadDateRead' => 'MessageReadDate::Read', + 'messageReadDateUnread' => 'MessageReadDate::Unread', + 'messageReadDateTooOld' => 'MessageReadDate::TooOld', + 'messageReadDateUserPrivacyRestricted' => 'MessageReadDate::UserPrivacyRestricted', + 'messageReadDateMyPrivacyRestricted' => 'MessageReadDate::MyPrivacyRestricted', + 'messageViewer' => 'MessageViewer', + 'messageViewers' => 'MessageViewers', + 'MessageOrigin' => 'MessageOrigin', + 'messageOriginUser' => 'MessageOrigin::User', + 'messageOriginHiddenUser' => 'MessageOrigin::HiddenUser', + 'messageOriginChat' => 'MessageOrigin::Chat', + 'messageOriginChannel' => 'MessageOrigin::Channel', + 'forwardSource' => 'ForwardSource', + 'ReactionType' => 'ReactionType', + 'reactionTypeEmoji' => 'ReactionType::Emoji', + 'reactionTypeCustomEmoji' => 'ReactionType::CustomEmoji', + 'reactionTypePaid' => 'ReactionType::Paid', + 'paidReactor' => 'PaidReactor', + 'messageForwardInfo' => 'MessageForwardInfo', + 'messageImportInfo' => 'MessageImportInfo', + 'messageReplyInfo' => 'MessageReplyInfo', + 'messageReaction' => 'MessageReaction', + 'messageReactions' => 'MessageReactions', + 'messageInteractionInfo' => 'MessageInteractionInfo', + 'unreadReaction' => 'UnreadReaction', + 'MessageEffectType' => 'MessageEffectType', + 'messageEffectTypeEmojiReaction' => 'MessageEffectType::EmojiReaction', + 'messageEffectTypePremiumSticker' => 'MessageEffectType::PremiumSticker', + 'messageEffect' => 'MessageEffect', + 'MessageSendingState' => 'MessageSendingState', + 'messageSendingStatePending' => 'MessageSendingState::Pending', + 'messageSendingStateFailed' => 'MessageSendingState::Failed', + 'textQuote' => 'TextQuote', + 'inputTextQuote' => 'InputTextQuote', + 'MessageReplyTo' => 'MessageReplyTo', + 'messageReplyToMessage' => 'MessageReplyTo::Message', + 'messageReplyToStory' => 'MessageReplyTo::Story', + 'InputMessageReplyTo' => 'InputMessageReplyTo', + 'inputMessageReplyToMessage' => 'InputMessageReplyTo::Message', + 'inputMessageReplyToExternalMessage' => 'InputMessageReplyTo::ExternalMessage', + 'inputMessageReplyToStory' => 'InputMessageReplyTo::Story', + 'factCheck' => 'FactCheck', + 'message' => 'Message', + 'messages' => 'Messages', + 'foundMessages' => 'FoundMessages', + 'foundChatMessages' => 'FoundChatMessages', + 'messagePosition' => 'MessagePosition', + 'messagePositions' => 'MessagePositions', + 'messageCalendarDay' => 'MessageCalendarDay', + 'messageCalendar' => 'MessageCalendar', + 'businessMessage' => 'BusinessMessage', + 'businessMessages' => 'BusinessMessages', + 'MessageSource' => 'MessageSource', + 'messageSourceChatHistory' => 'MessageSource::ChatHistory', + 'messageSourceMessageThreadHistory' => 'MessageSource::MessageThreadHistory', + 'messageSourceForumTopicHistory' => 'MessageSource::ForumTopicHistory', + 'messageSourceHistoryPreview' => 'MessageSource::HistoryPreview', + 'messageSourceChatList' => 'MessageSource::ChatList', + 'messageSourceSearch' => 'MessageSource::Search', + 'messageSourceChatEventLog' => 'MessageSource::ChatEventLog', + 'messageSourceNotification' => 'MessageSource::Notification', + 'messageSourceScreenshot' => 'MessageSource::Screenshot', + 'messageSourceOther' => 'MessageSource::Other', + 'messageSponsor' => 'MessageSponsor', + 'sponsoredMessage' => 'SponsoredMessage', + 'sponsoredMessages' => 'SponsoredMessages', + 'reportChatSponsoredMessageOption' => 'ReportChatSponsoredMessageOption', + 'ReportChatSponsoredMessageResult' => 'ReportChatSponsoredMessageResult', + 'reportChatSponsoredMessageResultOk' => 'ReportChatSponsoredMessageResult::Ok', + 'reportChatSponsoredMessageResultFailed' => 'ReportChatSponsoredMessageResult::Failed', + 'reportChatSponsoredMessageResultOptionRequired' => 'ReportChatSponsoredMessageResult::OptionRequired', + 'reportChatSponsoredMessageResultAdsHidden' => 'ReportChatSponsoredMessageResult::AdsHidden', + 'reportChatSponsoredMessageResultPremiumRequired' => 'ReportChatSponsoredMessageResult::PremiumRequired', + 'fileDownload' => 'FileDownload', + 'downloadedFileCounts' => 'DownloadedFileCounts', + 'foundFileDownloads' => 'FoundFileDownloads', + 'NotificationSettingsScope' => 'NotificationSettingsScope', + 'notificationSettingsScopePrivateChats' => 'NotificationSettingsScope::PrivateChats', + 'notificationSettingsScopeGroupChats' => 'NotificationSettingsScope::GroupChats', + 'notificationSettingsScopeChannelChats' => 'NotificationSettingsScope::ChannelChats', + 'chatNotificationSettings' => 'ChatNotificationSettings', + 'scopeNotificationSettings' => 'ScopeNotificationSettings', + 'ReactionNotificationSource' => 'ReactionNotificationSource', + 'reactionNotificationSourceNone' => 'ReactionNotificationSource::None', + 'reactionNotificationSourceContacts' => 'ReactionNotificationSource::Contacts', + 'reactionNotificationSourceAll' => 'ReactionNotificationSource::All', + 'reactionNotificationSettings' => 'ReactionNotificationSettings', + 'draftMessage' => 'DraftMessage', + 'ChatType' => 'ChatType', + 'chatTypePrivate' => 'ChatType::Private', + 'chatTypeBasicGroup' => 'ChatType::BasicGroup', + 'chatTypeSupergroup' => 'ChatType::Supergroup', + 'chatTypeSecret' => 'ChatType::Secret', + 'chatFolderIcon' => 'ChatFolderIcon', + 'chatFolder' => 'ChatFolder', + 'chatFolderInfo' => 'ChatFolderInfo', + 'chatFolderInviteLink' => 'ChatFolderInviteLink', + 'chatFolderInviteLinks' => 'ChatFolderInviteLinks', + 'chatFolderInviteLinkInfo' => 'ChatFolderInviteLinkInfo', + 'recommendedChatFolder' => 'RecommendedChatFolder', + 'recommendedChatFolders' => 'RecommendedChatFolders', + 'archiveChatListSettings' => 'ArchiveChatListSettings', + 'ChatList' => 'ChatList', + 'chatListMain' => 'ChatList::Main', + 'chatListArchive' => 'ChatList::Archive', + 'chatListFolder' => 'ChatList::Folder', + 'chatLists' => 'ChatLists', + 'ChatSource' => 'ChatSource', + 'chatSourceMtprotoProxy' => 'ChatSource::MtprotoProxy', + 'chatSourcePublicServiceAnnouncement' => 'ChatSource::PublicServiceAnnouncement', + 'chatPosition' => 'ChatPosition', + 'ChatAvailableReactions' => 'ChatAvailableReactions', + 'chatAvailableReactionsAll' => 'ChatAvailableReactions::All', + 'chatAvailableReactionsSome' => 'ChatAvailableReactions::Some', + 'savedMessagesTag' => 'SavedMessagesTag', + 'savedMessagesTags' => 'SavedMessagesTags', + 'businessBotManageBar' => 'BusinessBotManageBar', + 'videoChat' => 'VideoChat', + 'chat' => 'Chat', + 'chats' => 'Chats', + 'failedToAddMember' => 'FailedToAddMember', + 'failedToAddMembers' => 'FailedToAddMembers', + 'createdBasicGroupChat' => 'CreatedBasicGroupChat', + 'chatNearby' => 'ChatNearby', + 'chatsNearby' => 'ChatsNearby', + 'PublicChatType' => 'PublicChatType', + 'publicChatTypeHasUsername' => 'PublicChatType::HasUsername', + 'publicChatTypeIsLocationBased' => 'PublicChatType::IsLocationBased', + 'ChatActionBar' => 'ChatActionBar', + 'chatActionBarReportSpam' => 'ChatActionBar::ReportSpam', + 'chatActionBarReportUnrelatedLocation' => 'ChatActionBar::ReportUnrelatedLocation', + 'chatActionBarInviteMembers' => 'ChatActionBar::InviteMembers', + 'chatActionBarReportAddBlock' => 'ChatActionBar::ReportAddBlock', + 'chatActionBarAddContact' => 'ChatActionBar::AddContact', + 'chatActionBarSharePhoneNumber' => 'ChatActionBar::SharePhoneNumber', + 'chatActionBarJoinRequest' => 'ChatActionBar::JoinRequest', + 'KeyboardButtonType' => 'KeyboardButtonType', + 'keyboardButtonTypeText' => 'KeyboardButtonType::Text', + 'keyboardButtonTypeRequestPhoneNumber' => 'KeyboardButtonType::RequestPhoneNumber', + 'keyboardButtonTypeRequestLocation' => 'KeyboardButtonType::RequestLocation', + 'keyboardButtonTypeRequestPoll' => 'KeyboardButtonType::RequestPoll', + 'keyboardButtonTypeRequestUsers' => 'KeyboardButtonType::RequestUsers', + 'keyboardButtonTypeRequestChat' => 'KeyboardButtonType::RequestChat', + 'keyboardButtonTypeWebApp' => 'KeyboardButtonType::WebApp', + 'keyboardButton' => 'KeyboardButton', + 'InlineKeyboardButtonType' => 'InlineKeyboardButtonType', + 'inlineKeyboardButtonTypeUrl' => 'InlineKeyboardButtonType::Url', + 'inlineKeyboardButtonTypeLoginUrl' => 'InlineKeyboardButtonType::LoginUrl', + 'inlineKeyboardButtonTypeWebApp' => 'InlineKeyboardButtonType::WebApp', + 'inlineKeyboardButtonTypeCallback' => 'InlineKeyboardButtonType::Callback', + 'inlineKeyboardButtonTypeCallbackWithPassword' => 'InlineKeyboardButtonType::CallbackWithPassword', + 'inlineKeyboardButtonTypeCallbackGame' => 'InlineKeyboardButtonType::CallbackGame', + 'inlineKeyboardButtonTypeSwitchInline' => 'InlineKeyboardButtonType::SwitchInline', + 'inlineKeyboardButtonTypeBuy' => 'InlineKeyboardButtonType::Buy', + 'inlineKeyboardButtonTypeUser' => 'InlineKeyboardButtonType::User', + 'inlineKeyboardButton' => 'InlineKeyboardButton', + 'ReplyMarkup' => 'ReplyMarkup', + 'replyMarkupRemoveKeyboard' => 'ReplyMarkup::RemoveKeyboard', + 'replyMarkupForceReply' => 'ReplyMarkup::ForceReply', + 'replyMarkupShowKeyboard' => 'ReplyMarkup::ShowKeyboard', + 'replyMarkupInlineKeyboard' => 'ReplyMarkup::InlineKeyboard', + 'LoginUrlInfo' => 'LoginUrlInfo', + 'loginUrlInfoOpen' => 'LoginUrlInfo::Open', + 'loginUrlInfoRequestConfirmation' => 'LoginUrlInfo::RequestConfirmation', + 'foundWebApp' => 'FoundWebApp', + 'webAppInfo' => 'WebAppInfo', + 'mainWebApp' => 'MainWebApp', + 'messageThreadInfo' => 'MessageThreadInfo', + 'SavedMessagesTopicType' => 'SavedMessagesTopicType', + 'savedMessagesTopicTypeMyNotes' => 'SavedMessagesTopicType::MyNotes', + 'savedMessagesTopicTypeAuthorHidden' => 'SavedMessagesTopicType::AuthorHidden', + 'savedMessagesTopicTypeSavedFromChat' => 'SavedMessagesTopicType::SavedFromChat', + 'savedMessagesTopic' => 'SavedMessagesTopic', + 'forumTopicIcon' => 'ForumTopicIcon', + 'forumTopicInfo' => 'ForumTopicInfo', + 'forumTopic' => 'ForumTopic', + 'forumTopics' => 'ForumTopics', + 'linkPreviewOptions' => 'LinkPreviewOptions', + 'sharedUser' => 'SharedUser', + 'sharedChat' => 'SharedChat', + 'themeSettings' => 'ThemeSettings', + 'RichText' => 'RichText', + 'richTextPlain' => 'RichText::Plain', + 'richTextBold' => 'RichText::Bold', + 'richTextItalic' => 'RichText::Italic', + 'richTextUnderline' => 'RichText::Underline', + 'richTextStrikethrough' => 'RichText::Strikethrough', + 'richTextFixed' => 'RichText::Fixed', + 'richTextUrl' => 'RichText::Url', + 'richTextEmailAddress' => 'RichText::EmailAddress', + 'richTextSubscript' => 'RichText::Subscript', + 'richTextSuperscript' => 'RichText::Superscript', + 'richTextMarked' => 'RichText::Marked', + 'richTextPhoneNumber' => 'RichText::PhoneNumber', + 'richTextIcon' => 'RichText::Icon', + 'richTextReference' => 'RichText::Reference', + 'richTextAnchor' => 'RichText::Anchor', + 'richTextAnchorLink' => 'RichText::AnchorLink', + 'richTexts' => 'RichText::s', + 'pageBlockCaption' => 'PageBlockCaption', + 'pageBlockListItem' => 'PageBlockListItem', + 'PageBlockHorizontalAlignment' => 'PageBlockHorizontalAlignment', + 'pageBlockHorizontalAlignmentLeft' => 'PageBlockHorizontalAlignment::Left', + 'pageBlockHorizontalAlignmentCenter' => 'PageBlockHorizontalAlignment::Center', + 'pageBlockHorizontalAlignmentRight' => 'PageBlockHorizontalAlignment::Right', + 'PageBlockVerticalAlignment' => 'PageBlockVerticalAlignment', + 'pageBlockVerticalAlignmentTop' => 'PageBlockVerticalAlignment::Top', + 'pageBlockVerticalAlignmentMiddle' => 'PageBlockVerticalAlignment::Middle', + 'pageBlockVerticalAlignmentBottom' => 'PageBlockVerticalAlignment::Bottom', + 'pageBlockTableCell' => 'PageBlockTableCell', + 'pageBlockRelatedArticle' => 'PageBlockRelatedArticle', + 'PageBlock' => 'PageBlock', + 'pageBlockTitle' => 'PageBlock::Title', + 'pageBlockSubtitle' => 'PageBlock::Subtitle', + 'pageBlockAuthorDate' => 'PageBlock::AuthorDate', + 'pageBlockHeader' => 'PageBlock::Header', + 'pageBlockSubheader' => 'PageBlock::Subheader', + 'pageBlockKicker' => 'PageBlock::Kicker', + 'pageBlockParagraph' => 'PageBlock::Paragraph', + 'pageBlockPreformatted' => 'PageBlock::Preformatted', + 'pageBlockFooter' => 'PageBlock::Footer', + 'pageBlockDivider' => 'PageBlock::Divider', + 'pageBlockAnchor' => 'PageBlock::Anchor', + 'pageBlockList' => 'PageBlock::List', + 'pageBlockBlockQuote' => 'PageBlock::BlockQuote', + 'pageBlockPullQuote' => 'PageBlock::PullQuote', + 'pageBlockAnimation' => 'PageBlock::Animation', + 'pageBlockAudio' => 'PageBlock::Audio', + 'pageBlockPhoto' => 'PageBlock::Photo', + 'pageBlockVideo' => 'PageBlock::Video', + 'pageBlockVoiceNote' => 'PageBlock::VoiceNote', + 'pageBlockCover' => 'PageBlock::Cover', + 'pageBlockEmbedded' => 'PageBlock::Embedded', + 'pageBlockEmbeddedPost' => 'PageBlock::EmbeddedPost', + 'pageBlockCollage' => 'PageBlock::Collage', + 'pageBlockSlideshow' => 'PageBlock::Slideshow', + 'pageBlockChatLink' => 'PageBlock::ChatLink', + 'pageBlockTable' => 'PageBlock::Table', + 'pageBlockDetails' => 'PageBlock::Details', + 'pageBlockRelatedArticles' => 'PageBlock::RelatedArticles', + 'pageBlockMap' => 'PageBlock::Map', + 'webPageInstantView' => 'WebPageInstantView', + 'LinkPreviewAlbumMedia' => 'LinkPreviewAlbumMedia', + 'linkPreviewAlbumMediaPhoto' => 'LinkPreviewAlbumMedia::Photo', + 'linkPreviewAlbumMediaVideo' => 'LinkPreviewAlbumMedia::Video', + 'LinkPreviewType' => 'LinkPreviewType', + 'linkPreviewTypeAlbum' => 'LinkPreviewType::Album', + 'linkPreviewTypeAnimation' => 'LinkPreviewType::Animation', + 'linkPreviewTypeApp' => 'LinkPreviewType::App', + 'linkPreviewTypeArticle' => 'LinkPreviewType::Article', + 'linkPreviewTypeAudio' => 'LinkPreviewType::Audio', + 'linkPreviewTypeBackground' => 'LinkPreviewType::Background', + 'linkPreviewTypeChannelBoost' => 'LinkPreviewType::ChannelBoost', + 'linkPreviewTypeChat' => 'LinkPreviewType::Chat', + 'linkPreviewTypeDocument' => 'LinkPreviewType::Document', + 'linkPreviewTypeEmbeddedAnimationPlayer' => 'LinkPreviewType::EmbeddedAnimationPlayer', + 'linkPreviewTypeEmbeddedAudioPlayer' => 'LinkPreviewType::EmbeddedAudioPlayer', + 'linkPreviewTypeEmbeddedVideoPlayer' => 'LinkPreviewType::EmbeddedVideoPlayer', + 'linkPreviewTypeInvoice' => 'LinkPreviewType::Invoice', + 'linkPreviewTypeMessage' => 'LinkPreviewType::Message', + 'linkPreviewTypePhoto' => 'LinkPreviewType::Photo', + 'linkPreviewTypePremiumGiftCode' => 'LinkPreviewType::PremiumGiftCode', + 'linkPreviewTypeShareableChatFolder' => 'LinkPreviewType::ShareableChatFolder', + 'linkPreviewTypeSticker' => 'LinkPreviewType::Sticker', + 'linkPreviewTypeStickerSet' => 'LinkPreviewType::StickerSet', + 'linkPreviewTypeStory' => 'LinkPreviewType::Story', + 'linkPreviewTypeSupergroupBoost' => 'LinkPreviewType::SupergroupBoost', + 'linkPreviewTypeTheme' => 'LinkPreviewType::Theme', + 'linkPreviewTypeUnsupported' => 'LinkPreviewType::Unsupported', + 'linkPreviewTypeUser' => 'LinkPreviewType::User', + 'linkPreviewTypeVideo' => 'LinkPreviewType::Video', + 'linkPreviewTypeVideoChat' => 'LinkPreviewType::VideoChat', + 'linkPreviewTypeVideoNote' => 'LinkPreviewType::VideoNote', + 'linkPreviewTypeVoiceNote' => 'LinkPreviewType::VoiceNote', + 'linkPreviewTypeWebApp' => 'LinkPreviewType::WebApp', + 'linkPreview' => 'LinkPreview', + 'countryInfo' => 'CountryInfo', + 'countries' => 'Countries', + 'phoneNumberInfo' => 'PhoneNumberInfo', + 'CollectibleItemType' => 'CollectibleItemType', + 'collectibleItemTypeUsername' => 'CollectibleItemType::Username', + 'collectibleItemTypePhoneNumber' => 'CollectibleItemType::PhoneNumber', + 'collectibleItemInfo' => 'CollectibleItemInfo', + 'bankCardActionOpenUrl' => 'BankCardActionOpenUrl', + 'bankCardInfo' => 'BankCardInfo', + 'address' => 'Address', + 'locationAddress' => 'LocationAddress', + 'themeParameters' => 'ThemeParameters', + 'labeledPricePart' => 'LabeledPricePart', + 'invoice' => 'Invoice', + 'orderInfo' => 'OrderInfo', + 'shippingOption' => 'ShippingOption', + 'savedCredentials' => 'SavedCredentials', + 'InputCredentials' => 'InputCredentials', + 'inputCredentialsSaved' => 'InputCredentials::Saved', + 'inputCredentialsNew' => 'InputCredentials::New', + 'inputCredentialsApplePay' => 'InputCredentials::ApplePay', + 'inputCredentialsGooglePay' => 'InputCredentials::GooglePay', + 'PaymentProvider' => 'PaymentProvider', + 'paymentProviderSmartGlocal' => 'PaymentProvider::SmartGlocal', + 'paymentProviderStripe' => 'PaymentProvider::Stripe', + 'paymentProviderOther' => 'PaymentProvider::Other', + 'paymentOption' => 'PaymentOption', + 'PaymentFormType' => 'PaymentFormType', + 'paymentFormTypeRegular' => 'PaymentFormType::Regular', + 'paymentFormTypeStars' => 'PaymentFormType::Stars', + 'paymentForm' => 'PaymentForm', + 'validatedOrderInfo' => 'ValidatedOrderInfo', + 'paymentResult' => 'PaymentResult', + 'PaymentReceiptType' => 'PaymentReceiptType', + 'paymentReceiptTypeRegular' => 'PaymentReceiptType::Regular', + 'paymentReceiptTypeStars' => 'PaymentReceiptType::Stars', + 'paymentReceipt' => 'PaymentReceipt', + 'InputInvoice' => 'InputInvoice', + 'inputInvoiceMessage' => 'InputInvoice::Message', + 'inputInvoiceName' => 'InputInvoice::Name', + 'inputInvoiceTelegram' => 'InputInvoice::Telegram', + 'PaidMedia' => 'PaidMedia', + 'paidMediaPreview' => 'PaidMedia::Preview', + 'paidMediaPhoto' => 'PaidMedia::Photo', + 'paidMediaVideo' => 'PaidMedia::Video', + 'paidMediaUnsupported' => 'PaidMedia::Unsupported', + 'premiumGiveawayParameters' => 'PremiumGiveawayParameters', + 'datedFile' => 'DatedFile', + 'PassportElementType' => 'PassportElementType', + 'passportElementTypePersonalDetails' => 'PassportElementType::PersonalDetails', + 'passportElementTypePassport' => 'PassportElementType::Passport', + 'passportElementTypeDriverLicense' => 'PassportElementType::DriverLicense', + 'passportElementTypeIdentityCard' => 'PassportElementType::IdentityCard', + 'passportElementTypeInternalPassport' => 'PassportElementType::InternalPassport', + 'passportElementTypeAddress' => 'PassportElementType::Address', + 'passportElementTypeUtilityBill' => 'PassportElementType::UtilityBill', + 'passportElementTypeBankStatement' => 'PassportElementType::BankStatement', + 'passportElementTypeRentalAgreement' => 'PassportElementType::RentalAgreement', + 'passportElementTypePassportRegistration' => 'PassportElementType::PassportRegistration', + 'passportElementTypeTemporaryRegistration' => 'PassportElementType::TemporaryRegistration', + 'passportElementTypePhoneNumber' => 'PassportElementType::PhoneNumber', + 'passportElementTypeEmailAddress' => 'PassportElementType::EmailAddress', + 'date' => 'Date', + 'personalDetails' => 'PersonalDetails', + 'identityDocument' => 'IdentityDocument', + 'inputIdentityDocument' => 'InputIdentityDocument', + 'personalDocument' => 'PersonalDocument', + 'inputPersonalDocument' => 'InputPersonalDocument', + 'PassportElement' => 'PassportElement', + 'passportElementPersonalDetails' => 'PassportElement::PersonalDetails', + 'passportElementPassport' => 'PassportElement::Passport', + 'passportElementDriverLicense' => 'PassportElement::DriverLicense', + 'passportElementIdentityCard' => 'PassportElement::IdentityCard', + 'passportElementInternalPassport' => 'PassportElement::InternalPassport', + 'passportElementAddress' => 'PassportElement::Address', + 'passportElementUtilityBill' => 'PassportElement::UtilityBill', + 'passportElementBankStatement' => 'PassportElement::BankStatement', + 'passportElementRentalAgreement' => 'PassportElement::RentalAgreement', + 'passportElementPassportRegistration' => 'PassportElement::PassportRegistration', + 'passportElementTemporaryRegistration' => 'PassportElement::TemporaryRegistration', + 'passportElementPhoneNumber' => 'PassportElement::PhoneNumber', + 'passportElementEmailAddress' => 'PassportElement::EmailAddress', + 'InputPassportElement' => 'InputPassportElement', + 'inputPassportElementPersonalDetails' => 'InputPassportElement::PersonalDetails', + 'inputPassportElementPassport' => 'InputPassportElement::Passport', + 'inputPassportElementDriverLicense' => 'InputPassportElement::DriverLicense', + 'inputPassportElementIdentityCard' => 'InputPassportElement::IdentityCard', + 'inputPassportElementInternalPassport' => 'InputPassportElement::InternalPassport', + 'inputPassportElementAddress' => 'InputPassportElement::Address', + 'inputPassportElementUtilityBill' => 'InputPassportElement::UtilityBill', + 'inputPassportElementBankStatement' => 'InputPassportElement::BankStatement', + 'inputPassportElementRentalAgreement' => 'InputPassportElement::RentalAgreement', + 'inputPassportElementPassportRegistration' => 'InputPassportElement::PassportRegistration', + 'inputPassportElementTemporaryRegistration' => 'InputPassportElement::TemporaryRegistration', + 'inputPassportElementPhoneNumber' => 'InputPassportElement::PhoneNumber', + 'inputPassportElementEmailAddress' => 'InputPassportElement::EmailAddress', + 'passportElements' => 'PassportElements', + 'PassportElementErrorSource' => 'PassportElementErrorSource', + 'passportElementErrorSourceUnspecified' => 'PassportElementErrorSource::Unspecified', + 'passportElementErrorSourceDataField' => 'PassportElementErrorSource::DataField', + 'passportElementErrorSourceFrontSide' => 'PassportElementErrorSource::FrontSide', + 'passportElementErrorSourceReverseSide' => 'PassportElementErrorSource::ReverseSide', + 'passportElementErrorSourceSelfie' => 'PassportElementErrorSource::Selfie', + 'passportElementErrorSourceTranslationFile' => 'PassportElementErrorSource::TranslationFile', + 'passportElementErrorSourceTranslationFiles' => 'PassportElementErrorSource::TranslationFiles', + 'passportElementErrorSourceFile' => 'PassportElementErrorSource::File', + 'passportElementErrorSourceFiles' => 'PassportElementErrorSource::Files', + 'passportElementError' => 'PassportElementError', + 'passportSuitableElement' => 'PassportSuitableElement', + 'passportRequiredElement' => 'PassportRequiredElement', + 'passportAuthorizationForm' => 'PassportAuthorizationForm', + 'passportElementsWithErrors' => 'PassportElementsWithErrors', + 'encryptedCredentials' => 'EncryptedCredentials', + 'encryptedPassportElement' => 'EncryptedPassportElement', + 'InputPassportElementErrorSource' => 'InputPassportElementErrorSource', + 'inputPassportElementErrorSourceUnspecified' => 'InputPassportElementErrorSource::Unspecified', + 'inputPassportElementErrorSourceDataField' => 'InputPassportElementErrorSource::DataField', + 'inputPassportElementErrorSourceFrontSide' => 'InputPassportElementErrorSource::FrontSide', + 'inputPassportElementErrorSourceReverseSide' => 'InputPassportElementErrorSource::ReverseSide', + 'inputPassportElementErrorSourceSelfie' => 'InputPassportElementErrorSource::Selfie', + 'inputPassportElementErrorSourceTranslationFile' => 'InputPassportElementErrorSource::TranslationFile', + 'inputPassportElementErrorSourceTranslationFiles' => 'InputPassportElementErrorSource::TranslationFiles', + 'inputPassportElementErrorSourceFile' => 'InputPassportElementErrorSource::File', + 'inputPassportElementErrorSourceFiles' => 'InputPassportElementErrorSource::Files', + 'inputPassportElementError' => 'InputPassportElementError', + 'MessageContent' => 'MessageContent', + 'messageText' => 'MessageContent::Text', + 'messageAnimation' => 'MessageContent::Animation', + 'messageAudio' => 'MessageContent::Audio', + 'messageDocument' => 'MessageContent::Document', + 'messagePaidMedia' => 'MessageContent::PaidMedia', + 'messagePhoto' => 'MessageContent::Photo', + 'messageSticker' => 'MessageContent::Sticker', + 'messageVideo' => 'MessageContent::Video', + 'messageVideoNote' => 'MessageContent::VideoNote', + 'messageVoiceNote' => 'MessageContent::VoiceNote', + 'messageExpiredPhoto' => 'MessageContent::ExpiredPhoto', + 'messageExpiredVideo' => 'MessageContent::ExpiredVideo', + 'messageExpiredVideoNote' => 'MessageContent::ExpiredVideoNote', + 'messageExpiredVoiceNote' => 'MessageContent::ExpiredVoiceNote', + 'messageLocation' => 'MessageContent::Location', + 'messageVenue' => 'MessageContent::Venue', + 'messageContact' => 'MessageContent::Contact', + 'messageAnimatedEmoji' => 'MessageContent::AnimatedEmoji', + 'messageDice' => 'MessageContent::Dice', + 'messageGame' => 'MessageContent::Game', + 'messagePoll' => 'MessageContent::Poll', + 'messageStory' => 'MessageContent::Story', + 'messageInvoice' => 'MessageContent::Invoice', + 'messageCall' => 'MessageContent::Call', + 'messageVideoChatScheduled' => 'MessageContent::VideoChatScheduled', + 'messageVideoChatStarted' => 'MessageContent::VideoChatStarted', + 'messageVideoChatEnded' => 'MessageContent::VideoChatEnded', + 'messageInviteVideoChatParticipants' => 'MessageContent::InviteVideoChatParticipants', + 'messageBasicGroupChatCreate' => 'MessageContent::BasicGroupChatCreate', + 'messageSupergroupChatCreate' => 'MessageContent::SupergroupChatCreate', + 'messageChatChangeTitle' => 'MessageContent::ChatChangeTitle', + 'messageChatChangePhoto' => 'MessageContent::ChatChangePhoto', + 'messageChatDeletePhoto' => 'MessageContent::ChatDeletePhoto', + 'messageChatAddMembers' => 'MessageContent::ChatAddMembers', + 'messageChatJoinByLink' => 'MessageContent::ChatJoinByLink', + 'messageChatJoinByRequest' => 'MessageContent::ChatJoinByRequest', + 'messageChatDeleteMember' => 'MessageContent::ChatDeleteMember', + 'messageChatUpgradeTo' => 'MessageContent::ChatUpgradeTo', + 'messageChatUpgradeFrom' => 'MessageContent::ChatUpgradeFrom', + 'messagePinMessage' => 'MessageContent::PinMessage', + 'messageScreenshotTaken' => 'MessageContent::ScreenshotTaken', + 'messageChatSetBackground' => 'MessageContent::ChatSetBackground', + 'messageChatSetTheme' => 'MessageContent::ChatSetTheme', + 'messageChatSetMessageAutoDeleteTime' => 'MessageContent::ChatSetMessageAutoDeleteTime', + 'messageChatBoost' => 'MessageContent::ChatBoost', + 'messageForumTopicCreated' => 'MessageContent::ForumTopicCreated', + 'messageForumTopicEdited' => 'MessageContent::ForumTopicEdited', + 'messageForumTopicIsClosedToggled' => 'MessageContent::ForumTopicIsClosedToggled', + 'messageForumTopicIsHiddenToggled' => 'MessageContent::ForumTopicIsHiddenToggled', + 'messageSuggestProfilePhoto' => 'MessageContent::SuggestProfilePhoto', + 'messageCustomServiceAction' => 'MessageContent::CustomServiceAction', + 'messageGameScore' => 'MessageContent::GameScore', + 'messagePaymentSuccessful' => 'MessageContent::PaymentSuccessful', + 'messagePaymentSuccessfulBot' => 'MessageContent::PaymentSuccessfulBot', + 'messagePaymentRefunded' => 'MessageContent::PaymentRefunded', + 'messageGiftedPremium' => 'MessageContent::GiftedPremium', + 'messagePremiumGiftCode' => 'MessageContent::PremiumGiftCode', + 'messagePremiumGiveawayCreated' => 'MessageContent::PremiumGiveawayCreated', + 'messagePremiumGiveaway' => 'MessageContent::PremiumGiveaway', + 'messagePremiumGiveawayCompleted' => 'MessageContent::PremiumGiveawayCompleted', + 'messagePremiumGiveawayWinners' => 'MessageContent::PremiumGiveawayWinners', + 'messageGiftedStars' => 'MessageContent::GiftedStars', + 'messageContactRegistered' => 'MessageContent::ContactRegistered', + 'messageUsersShared' => 'MessageContent::UsersShared', + 'messageChatShared' => 'MessageContent::ChatShared', + 'messageBotWriteAccessAllowed' => 'MessageContent::BotWriteAccessAllowed', + 'messageWebAppDataSent' => 'MessageContent::WebAppDataSent', + 'messageWebAppDataReceived' => 'MessageContent::WebAppDataReceived', + 'messagePassportDataSent' => 'MessageContent::PassportDataSent', + 'messagePassportDataReceived' => 'MessageContent::PassportDataReceived', + 'messageProximityAlertTriggered' => 'MessageContent::ProximityAlertTriggered', + 'messageUnsupported' => 'MessageContent::Unsupported', + 'TextEntityType' => 'TextEntityType', + 'textEntityTypeMention' => 'TextEntityType::Mention', + 'textEntityTypeHashtag' => 'TextEntityType::Hashtag', + 'textEntityTypeCashtag' => 'TextEntityType::Cashtag', + 'textEntityTypeBotCommand' => 'TextEntityType::BotCommand', + 'textEntityTypeUrl' => 'TextEntityType::Url', + 'textEntityTypeEmailAddress' => 'TextEntityType::EmailAddress', + 'textEntityTypePhoneNumber' => 'TextEntityType::PhoneNumber', + 'textEntityTypeBankCardNumber' => 'TextEntityType::BankCardNumber', + 'textEntityTypeBold' => 'TextEntityType::Bold', + 'textEntityTypeItalic' => 'TextEntityType::Italic', + 'textEntityTypeUnderline' => 'TextEntityType::Underline', + 'textEntityTypeStrikethrough' => 'TextEntityType::Strikethrough', + 'textEntityTypeSpoiler' => 'TextEntityType::Spoiler', + 'textEntityTypeCode' => 'TextEntityType::Code', + 'textEntityTypePre' => 'TextEntityType::Pre', + 'textEntityTypePreCode' => 'TextEntityType::PreCode', + 'textEntityTypeBlockQuote' => 'TextEntityType::BlockQuote', + 'textEntityTypeExpandableBlockQuote' => 'TextEntityType::ExpandableBlockQuote', + 'textEntityTypeTextUrl' => 'TextEntityType::TextUrl', + 'textEntityTypeMentionName' => 'TextEntityType::MentionName', + 'textEntityTypeCustomEmoji' => 'TextEntityType::CustomEmoji', + 'textEntityTypeMediaTimestamp' => 'TextEntityType::MediaTimestamp', + 'inputThumbnail' => 'InputThumbnail', + 'InputPaidMediaType' => 'InputPaidMediaType', + 'inputPaidMediaTypePhoto' => 'InputPaidMediaType::Photo', + 'inputPaidMediaTypeVideo' => 'InputPaidMediaType::Video', + 'inputPaidMedia' => 'InputPaidMedia', + 'MessageSchedulingState' => 'MessageSchedulingState', + 'messageSchedulingStateSendAtDate' => 'MessageSchedulingState::SendAtDate', + 'messageSchedulingStateSendWhenOnline' => 'MessageSchedulingState::SendWhenOnline', + 'MessageSelfDestructType' => 'MessageSelfDestructType', + 'messageSelfDestructTypeTimer' => 'MessageSelfDestructType::Timer', + 'messageSelfDestructTypeImmediately' => 'MessageSelfDestructType::Immediately', + 'messageSendOptions' => 'MessageSendOptions', + 'messageCopyOptions' => 'MessageCopyOptions', + 'InputMessageContent' => 'InputMessageContent', + 'inputMessageText' => 'InputMessageContent::Text', + 'inputMessageAnimation' => 'InputMessageContent::Animation', + 'inputMessageAudio' => 'InputMessageContent::Audio', + 'inputMessageDocument' => 'InputMessageContent::Document', + 'inputMessagePaidMedia' => 'InputMessageContent::PaidMedia', + 'inputMessagePhoto' => 'InputMessageContent::Photo', + 'inputMessageSticker' => 'InputMessageContent::Sticker', + 'inputMessageVideo' => 'InputMessageContent::Video', + 'inputMessageVideoNote' => 'InputMessageContent::VideoNote', + 'inputMessageVoiceNote' => 'InputMessageContent::VoiceNote', + 'inputMessageLocation' => 'InputMessageContent::Location', + 'inputMessageVenue' => 'InputMessageContent::Venue', + 'inputMessageContact' => 'InputMessageContent::Contact', + 'inputMessageDice' => 'InputMessageContent::Dice', + 'inputMessageGame' => 'InputMessageContent::Game', + 'inputMessageInvoice' => 'InputMessageContent::Invoice', + 'inputMessagePoll' => 'InputMessageContent::Poll', + 'inputMessageStory' => 'InputMessageContent::Story', + 'inputMessageForwarded' => 'InputMessageContent::Forwarded', + 'messageProperties' => 'MessageProperties', + 'SearchMessagesFilter' => 'SearchMessagesFilter', + 'searchMessagesFilterEmpty' => 'SearchMessagesFilter::Empty', + 'searchMessagesFilterAnimation' => 'SearchMessagesFilter::Animation', + 'searchMessagesFilterAudio' => 'SearchMessagesFilter::Audio', + 'searchMessagesFilterDocument' => 'SearchMessagesFilter::Document', + 'searchMessagesFilterPhoto' => 'SearchMessagesFilter::Photo', + 'searchMessagesFilterVideo' => 'SearchMessagesFilter::Video', + 'searchMessagesFilterVoiceNote' => 'SearchMessagesFilter::VoiceNote', + 'searchMessagesFilterPhotoAndVideo' => 'SearchMessagesFilter::PhotoAndVideo', + 'searchMessagesFilterUrl' => 'SearchMessagesFilter::Url', + 'searchMessagesFilterChatPhoto' => 'SearchMessagesFilter::ChatPhoto', + 'searchMessagesFilterVideoNote' => 'SearchMessagesFilter::VideoNote', + 'searchMessagesFilterVoiceAndVideoNote' => 'SearchMessagesFilter::VoiceAndVideoNote', + 'searchMessagesFilterMention' => 'SearchMessagesFilter::Mention', + 'searchMessagesFilterUnreadMention' => 'SearchMessagesFilter::UnreadMention', + 'searchMessagesFilterUnreadReaction' => 'SearchMessagesFilter::UnreadReaction', + 'searchMessagesFilterFailedToSend' => 'SearchMessagesFilter::FailedToSend', + 'searchMessagesFilterPinned' => 'SearchMessagesFilter::Pinned', + 'ChatAction' => 'ChatAction', + 'chatActionTyping' => 'ChatAction::Typing', + 'chatActionRecordingVideo' => 'ChatAction::RecordingVideo', + 'chatActionUploadingVideo' => 'ChatAction::UploadingVideo', + 'chatActionRecordingVoiceNote' => 'ChatAction::RecordingVoiceNote', + 'chatActionUploadingVoiceNote' => 'ChatAction::UploadingVoiceNote', + 'chatActionUploadingPhoto' => 'ChatAction::UploadingPhoto', + 'chatActionUploadingDocument' => 'ChatAction::UploadingDocument', + 'chatActionChoosingSticker' => 'ChatAction::ChoosingSticker', + 'chatActionChoosingLocation' => 'ChatAction::ChoosingLocation', + 'chatActionChoosingContact' => 'ChatAction::ChoosingContact', + 'chatActionStartPlayingGame' => 'ChatAction::StartPlayingGame', + 'chatActionRecordingVideoNote' => 'ChatAction::RecordingVideoNote', + 'chatActionUploadingVideoNote' => 'ChatAction::UploadingVideoNote', + 'chatActionWatchingAnimations' => 'ChatAction::WatchingAnimations', + 'chatActionCancel' => 'ChatAction::Cancel', + 'UserStatus' => 'UserStatus', + 'userStatusEmpty' => 'UserStatus::Empty', + 'userStatusOnline' => 'UserStatus::Online', + 'userStatusOffline' => 'UserStatus::Offline', + 'userStatusRecently' => 'UserStatus::Recently', + 'userStatusLastWeek' => 'UserStatus::LastWeek', + 'userStatusLastMonth' => 'UserStatus::LastMonth', + 'emojiKeyword' => 'EmojiKeyword', + 'emojiKeywords' => 'EmojiKeywords', + 'stickers' => 'Stickers', + 'emojis' => 'Emojis', + 'stickerSet' => 'StickerSet', + 'stickerSetInfo' => 'StickerSetInfo', + 'stickerSets' => 'StickerSets', + 'trendingStickerSets' => 'TrendingStickerSets', + 'EmojiCategorySource' => 'EmojiCategorySource', + 'emojiCategorySourceSearch' => 'EmojiCategorySource::Search', + 'emojiCategorySourcePremium' => 'EmojiCategorySource::Premium', + 'emojiCategory' => 'EmojiCategory', + 'emojiCategories' => 'EmojiCategories', + 'EmojiCategoryType' => 'EmojiCategoryType', + 'emojiCategoryTypeDefault' => 'EmojiCategoryType::Default', + 'emojiCategoryTypeRegularStickers' => 'EmojiCategoryType::RegularStickers', + 'emojiCategoryTypeEmojiStatus' => 'EmojiCategoryType::EmojiStatus', + 'emojiCategoryTypeChatPhoto' => 'EmojiCategoryType::ChatPhoto', + 'currentWeather' => 'CurrentWeather', + 'storyAreaPosition' => 'StoryAreaPosition', + 'StoryAreaType' => 'StoryAreaType', + 'storyAreaTypeLocation' => 'StoryAreaType::Location', + 'storyAreaTypeVenue' => 'StoryAreaType::Venue', + 'storyAreaTypeSuggestedReaction' => 'StoryAreaType::SuggestedReaction', + 'storyAreaTypeMessage' => 'StoryAreaType::Message', + 'storyAreaTypeLink' => 'StoryAreaType::Link', + 'storyAreaTypeWeather' => 'StoryAreaType::Weather', + 'storyArea' => 'StoryArea', + 'InputStoryAreaType' => 'InputStoryAreaType', + 'inputStoryAreaTypeLocation' => 'InputStoryAreaType::Location', + 'inputStoryAreaTypeFoundVenue' => 'InputStoryAreaType::FoundVenue', + 'inputStoryAreaTypePreviousVenue' => 'InputStoryAreaType::PreviousVenue', + 'inputStoryAreaTypeSuggestedReaction' => 'InputStoryAreaType::SuggestedReaction', + 'inputStoryAreaTypeMessage' => 'InputStoryAreaType::Message', + 'inputStoryAreaTypeLink' => 'InputStoryAreaType::Link', + 'inputStoryAreaTypeWeather' => 'InputStoryAreaType::Weather', + 'inputStoryArea' => 'InputStoryArea', + 'inputStoryAreas' => 'InputStoryAreas', + 'storyVideo' => 'StoryVideo', + 'StoryContent' => 'StoryContent', + 'storyContentPhoto' => 'StoryContent::Photo', + 'storyContentVideo' => 'StoryContent::Video', + 'storyContentUnsupported' => 'StoryContent::Unsupported', + 'InputStoryContent' => 'InputStoryContent', + 'inputStoryContentPhoto' => 'InputStoryContent::Photo', + 'inputStoryContentVideo' => 'InputStoryContent::Video', + 'StoryList' => 'StoryList', + 'storyListMain' => 'StoryList::Main', + 'storyListArchive' => 'StoryList::Archive', + 'StoryOrigin' => 'StoryOrigin', + 'storyOriginPublicStory' => 'StoryOrigin::PublicStory', + 'storyOriginHiddenUser' => 'StoryOrigin::HiddenUser', + 'storyRepostInfo' => 'StoryRepostInfo', + 'storyInteractionInfo' => 'StoryInteractionInfo', + 'story' => 'Story', + 'stories' => 'Stories', + 'foundStories' => 'FoundStories', + 'storyFullId' => 'StoryFullId', + 'storyInfo' => 'StoryInfo', + 'chatActiveStories' => 'ChatActiveStories', + 'StoryInteractionType' => 'StoryInteractionType', + 'storyInteractionTypeView' => 'StoryInteractionType::View', + 'storyInteractionTypeForward' => 'StoryInteractionType::Forward', + 'storyInteractionTypeRepost' => 'StoryInteractionType::Repost', + 'storyInteraction' => 'StoryInteraction', + 'storyInteractions' => 'StoryInteractions', + 'quickReplyMessage' => 'QuickReplyMessage', + 'quickReplyMessages' => 'QuickReplyMessages', + 'quickReplyShortcut' => 'QuickReplyShortcut', + 'PublicForward' => 'PublicForward', + 'publicForwardMessage' => 'PublicForward::Message', + 'publicForwardStory' => 'PublicForward::Story', + 'publicForwards' => 'PublicForwards', + 'botMediaPreview' => 'BotMediaPreview', + 'botMediaPreviews' => 'BotMediaPreviews', + 'botMediaPreviewInfo' => 'BotMediaPreviewInfo', + 'chatBoostLevelFeatures' => 'ChatBoostLevelFeatures', + 'chatBoostFeatures' => 'ChatBoostFeatures', + 'ChatBoostSource' => 'ChatBoostSource', + 'chatBoostSourceGiftCode' => 'ChatBoostSource::GiftCode', + 'chatBoostSourceGiveaway' => 'ChatBoostSource::Giveaway', + 'chatBoostSourcePremium' => 'ChatBoostSource::Premium', + 'prepaidPremiumGiveaway' => 'PrepaidPremiumGiveaway', + 'chatBoostStatus' => 'ChatBoostStatus', + 'chatBoost' => 'ChatBoost', + 'foundChatBoosts' => 'FoundChatBoosts', + 'chatBoostSlot' => 'ChatBoostSlot', + 'chatBoostSlots' => 'ChatBoostSlots', + 'ResendCodeReason' => 'ResendCodeReason', + 'resendCodeReasonUserRequest' => 'ResendCodeReason::UserRequest', + 'resendCodeReasonVerificationFailed' => 'ResendCodeReason::VerificationFailed', + 'CallDiscardReason' => 'CallDiscardReason', + 'callDiscardReasonEmpty' => 'CallDiscardReason::Empty', + 'callDiscardReasonMissed' => 'CallDiscardReason::Missed', + 'callDiscardReasonDeclined' => 'CallDiscardReason::Declined', + 'callDiscardReasonDisconnected' => 'CallDiscardReason::Disconnected', + 'callDiscardReasonHungUp' => 'CallDiscardReason::HungUp', + 'callProtocol' => 'CallProtocol', + 'CallServerType' => 'CallServerType', + 'callServerTypeTelegramReflector' => 'CallServerType::TelegramReflector', + 'callServerTypeWebrtc' => 'CallServerType::Webrtc', + 'callServer' => 'CallServer', + 'callId' => 'CallId', + 'groupCallId' => 'GroupCallId', + 'CallState' => 'CallState', + 'callStatePending' => 'CallState::Pending', + 'callStateExchangingKeys' => 'CallState::ExchangingKeys', + 'callStateReady' => 'CallState::Ready', + 'callStateHangingUp' => 'CallState::HangingUp', + 'callStateDiscarded' => 'CallState::Discarded', + 'callStateError' => 'CallState::Error', + 'GroupCallVideoQuality' => 'GroupCallVideoQuality', + 'groupCallVideoQualityThumbnail' => 'GroupCallVideoQuality::Thumbnail', + 'groupCallVideoQualityMedium' => 'GroupCallVideoQuality::Medium', + 'groupCallVideoQualityFull' => 'GroupCallVideoQuality::Full', + 'groupCallStream' => 'GroupCallStream', + 'groupCallStreams' => 'GroupCallStreams', + 'rtmpUrl' => 'RtmpUrl', + 'groupCallRecentSpeaker' => 'GroupCallRecentSpeaker', + 'groupCall' => 'GroupCall', + 'groupCallVideoSourceGroup' => 'GroupCallVideoSourceGroup', + 'groupCallParticipantVideoInfo' => 'GroupCallParticipantVideoInfo', + 'groupCallParticipant' => 'GroupCallParticipant', + 'CallProblem' => 'CallProblem', + 'callProblemEcho' => 'CallProblem::Echo', + 'callProblemNoise' => 'CallProblem::Noise', + 'callProblemInterruptions' => 'CallProblem::Interruptions', + 'callProblemDistortedSpeech' => 'CallProblem::DistortedSpeech', + 'callProblemSilentLocal' => 'CallProblem::SilentLocal', + 'callProblemSilentRemote' => 'CallProblem::SilentRemote', + 'callProblemDropped' => 'CallProblem::Dropped', + 'callProblemDistortedVideo' => 'CallProblem::DistortedVideo', + 'callProblemPixelatedVideo' => 'CallProblem::PixelatedVideo', + 'call' => 'Call', + 'FirebaseAuthenticationSettings' => 'FirebaseAuthenticationSettings', + 'firebaseAuthenticationSettingsAndroid' => 'FirebaseAuthenticationSettings::Android', + 'firebaseAuthenticationSettingsIos' => 'FirebaseAuthenticationSettings::Ios', + 'phoneNumberAuthenticationSettings' => 'PhoneNumberAuthenticationSettings', + 'addedReaction' => 'AddedReaction', + 'addedReactions' => 'AddedReactions', + 'availableReaction' => 'AvailableReaction', + 'availableReactions' => 'AvailableReactions', + 'emojiReaction' => 'EmojiReaction', + 'ReactionUnavailabilityReason' => 'ReactionUnavailabilityReason', + 'reactionUnavailabilityReasonAnonymousAdministrator' => 'ReactionUnavailabilityReason::AnonymousAdministrator', + 'reactionUnavailabilityReasonGuest' => 'ReactionUnavailabilityReason::Guest', + 'animations' => 'Animations', + 'DiceStickers' => 'DiceStickers', + 'diceStickersRegular' => 'DiceStickers::Regular', + 'diceStickersSlotMachine' => 'DiceStickers::SlotMachine', + 'importedContacts' => 'ImportedContacts', + 'SpeechRecognitionResult' => 'SpeechRecognitionResult', + 'speechRecognitionResultPending' => 'SpeechRecognitionResult::Pending', + 'speechRecognitionResultText' => 'SpeechRecognitionResult::Text', + 'speechRecognitionResultError' => 'SpeechRecognitionResult::Error', + 'businessConnection' => 'BusinessConnection', + 'attachmentMenuBotColor' => 'AttachmentMenuBotColor', + 'attachmentMenuBot' => 'AttachmentMenuBot', + 'sentWebAppMessage' => 'SentWebAppMessage', + 'BotWriteAccessAllowReason' => 'BotWriteAccessAllowReason', + 'botWriteAccessAllowReasonConnectedWebsite' => 'BotWriteAccessAllowReason::ConnectedWebsite', + 'botWriteAccessAllowReasonAddedToAttachmentMenu' => 'BotWriteAccessAllowReason::AddedToAttachmentMenu', + 'botWriteAccessAllowReasonLaunchedWebApp' => 'BotWriteAccessAllowReason::LaunchedWebApp', + 'botWriteAccessAllowReasonAcceptedRequest' => 'BotWriteAccessAllowReason::AcceptedRequest', + 'httpUrl' => 'HttpUrl', + 'userLink' => 'UserLink', + 'InputInlineQueryResult' => 'InputInlineQueryResult', + 'inputInlineQueryResultAnimation' => 'InputInlineQueryResult::Animation', + 'inputInlineQueryResultArticle' => 'InputInlineQueryResult::Article', + 'inputInlineQueryResultAudio' => 'InputInlineQueryResult::Audio', + 'inputInlineQueryResultContact' => 'InputInlineQueryResult::Contact', + 'inputInlineQueryResultDocument' => 'InputInlineQueryResult::Document', + 'inputInlineQueryResultGame' => 'InputInlineQueryResult::Game', + 'inputInlineQueryResultLocation' => 'InputInlineQueryResult::Location', + 'inputInlineQueryResultPhoto' => 'InputInlineQueryResult::Photo', + 'inputInlineQueryResultSticker' => 'InputInlineQueryResult::Sticker', + 'inputInlineQueryResultVenue' => 'InputInlineQueryResult::Venue', + 'inputInlineQueryResultVideo' => 'InputInlineQueryResult::Video', + 'inputInlineQueryResultVoiceNote' => 'InputInlineQueryResult::VoiceNote', + 'InlineQueryResult' => 'InlineQueryResult', + 'inlineQueryResultArticle' => 'InlineQueryResult::Article', + 'inlineQueryResultContact' => 'InlineQueryResult::Contact', + 'inlineQueryResultLocation' => 'InlineQueryResult::Location', + 'inlineQueryResultVenue' => 'InlineQueryResult::Venue', + 'inlineQueryResultGame' => 'InlineQueryResult::Game', + 'inlineQueryResultAnimation' => 'InlineQueryResult::Animation', + 'inlineQueryResultAudio' => 'InlineQueryResult::Audio', + 'inlineQueryResultDocument' => 'InlineQueryResult::Document', + 'inlineQueryResultPhoto' => 'InlineQueryResult::Photo', + 'inlineQueryResultSticker' => 'InlineQueryResult::Sticker', + 'inlineQueryResultVideo' => 'InlineQueryResult::Video', + 'inlineQueryResultVoiceNote' => 'InlineQueryResult::VoiceNote', + 'InlineQueryResultsButtonType' => 'InlineQueryResultsButtonType', + 'inlineQueryResultsButtonTypeStartBot' => 'InlineQueryResultsButtonType::StartBot', + 'inlineQueryResultsButtonTypeWebApp' => 'InlineQueryResultsButtonType::WebApp', + 'inlineQueryResultsButton' => 'InlineQueryResultsButton', + 'inlineQueryResults' => 'InlineQueryResults', + 'CallbackQueryPayload' => 'CallbackQueryPayload', + 'callbackQueryPayloadData' => 'CallbackQueryPayload::Data', + 'callbackQueryPayloadDataWithPassword' => 'CallbackQueryPayload::DataWithPassword', + 'callbackQueryPayloadGame' => 'CallbackQueryPayload::Game', + 'callbackQueryAnswer' => 'CallbackQueryAnswer', + 'customRequestResult' => 'CustomRequestResult', + 'gameHighScore' => 'GameHighScore', + 'gameHighScores' => 'GameHighScores', + 'ChatEventAction' => 'ChatEventAction', + 'chatEventMessageEdited' => 'ChatEventAction::MessageEdited', + 'chatEventMessageDeleted' => 'ChatEventAction::MessageDeleted', + 'chatEventMessagePinned' => 'ChatEventAction::MessagePinned', + 'chatEventMessageUnpinned' => 'ChatEventAction::MessageUnpinned', + 'chatEventPollStopped' => 'ChatEventAction::PollStopped', + 'chatEventMemberJoined' => 'ChatEventAction::MemberJoined', + 'chatEventMemberJoinedByInviteLink' => 'ChatEventAction::MemberJoinedByInviteLink', + 'chatEventMemberJoinedByRequest' => 'ChatEventAction::MemberJoinedByRequest', + 'chatEventMemberInvited' => 'ChatEventAction::MemberInvited', + 'chatEventMemberLeft' => 'ChatEventAction::MemberLeft', + 'chatEventMemberPromoted' => 'ChatEventAction::MemberPromoted', + 'chatEventMemberRestricted' => 'ChatEventAction::MemberRestricted', + 'chatEventAvailableReactionsChanged' => 'ChatEventAction::AvailableReactionsChanged', + 'chatEventBackgroundChanged' => 'ChatEventAction::BackgroundChanged', + 'chatEventDescriptionChanged' => 'ChatEventAction::DescriptionChanged', + 'chatEventEmojiStatusChanged' => 'ChatEventAction::EmojiStatusChanged', + 'chatEventLinkedChatChanged' => 'ChatEventAction::LinkedChatChanged', + 'chatEventLocationChanged' => 'ChatEventAction::LocationChanged', + 'chatEventMessageAutoDeleteTimeChanged' => 'ChatEventAction::MessageAutoDeleteTimeChanged', + 'chatEventPermissionsChanged' => 'ChatEventAction::PermissionsChanged', + 'chatEventPhotoChanged' => 'ChatEventAction::PhotoChanged', + 'chatEventSlowModeDelayChanged' => 'ChatEventAction::SlowModeDelayChanged', + 'chatEventStickerSetChanged' => 'ChatEventAction::StickerSetChanged', + 'chatEventCustomEmojiStickerSetChanged' => 'ChatEventAction::CustomEmojiStickerSetChanged', + 'chatEventTitleChanged' => 'ChatEventAction::TitleChanged', + 'chatEventUsernameChanged' => 'ChatEventAction::UsernameChanged', + 'chatEventActiveUsernamesChanged' => 'ChatEventAction::ActiveUsernamesChanged', + 'chatEventAccentColorChanged' => 'ChatEventAction::AccentColorChanged', + 'chatEventProfileAccentColorChanged' => 'ChatEventAction::ProfileAccentColorChanged', + 'chatEventHasProtectedContentToggled' => 'ChatEventAction::HasProtectedContentToggled', + 'chatEventInvitesToggled' => 'ChatEventAction::InvitesToggled', + 'chatEventIsAllHistoryAvailableToggled' => 'ChatEventAction::IsAllHistoryAvailableToggled', + 'chatEventHasAggressiveAntiSpamEnabledToggled' => 'ChatEventAction::HasAggressiveAntiSpamEnabledToggled', + 'chatEventSignMessagesToggled' => 'ChatEventAction::SignMessagesToggled', + 'chatEventShowMessageSenderToggled' => 'ChatEventAction::ShowMessageSenderToggled', + 'chatEventInviteLinkEdited' => 'ChatEventAction::InviteLinkEdited', + 'chatEventInviteLinkRevoked' => 'ChatEventAction::InviteLinkRevoked', + 'chatEventInviteLinkDeleted' => 'ChatEventAction::InviteLinkDeleted', + 'chatEventVideoChatCreated' => 'ChatEventAction::VideoChatCreated', + 'chatEventVideoChatEnded' => 'ChatEventAction::VideoChatEnded', + 'chatEventVideoChatMuteNewParticipantsToggled' => 'ChatEventAction::VideoChatMuteNewParticipantsToggled', + 'chatEventVideoChatParticipantIsMutedToggled' => 'ChatEventAction::VideoChatParticipantIsMutedToggled', + 'chatEventVideoChatParticipantVolumeLevelChanged' => 'ChatEventAction::VideoChatParticipantVolumeLevelChanged', + 'chatEventIsForumToggled' => 'ChatEventAction::IsForumToggled', + 'chatEventForumTopicCreated' => 'ChatEventAction::ForumTopicCreated', + 'chatEventForumTopicEdited' => 'ChatEventAction::ForumTopicEdited', + 'chatEventForumTopicToggleIsClosed' => 'ChatEventAction::ForumTopicToggleIsClosed', + 'chatEventForumTopicToggleIsHidden' => 'ChatEventAction::ForumTopicToggleIsHidden', + 'chatEventForumTopicDeleted' => 'ChatEventAction::ForumTopicDeleted', + 'chatEventForumTopicPinned' => 'ChatEventAction::ForumTopicPinned', + 'chatEvent' => 'ChatEvent', + 'chatEvents' => 'ChatEvents', + 'chatEventLogFilters' => 'ChatEventLogFilters', + 'LanguagePackStringValue' => 'LanguagePackStringValue', + 'languagePackStringValueOrdinary' => 'LanguagePackStringValue::Ordinary', + 'languagePackStringValuePluralized' => 'LanguagePackStringValue::Pluralized', + 'languagePackStringValueDeleted' => 'LanguagePackStringValue::Deleted', + 'languagePackString' => 'LanguagePackString', + 'languagePackStrings' => 'LanguagePackStrings', + 'languagePackInfo' => 'LanguagePackInfo', + 'localizationTargetInfo' => 'LocalizationTargetInfo', + 'PremiumLimitType' => 'PremiumLimitType', + 'premiumLimitTypeSupergroupCount' => 'PremiumLimitType::SupergroupCount', + 'premiumLimitTypePinnedChatCount' => 'PremiumLimitType::PinnedChatCount', + 'premiumLimitTypeCreatedPublicChatCount' => 'PremiumLimitType::CreatedPublicChatCount', + 'premiumLimitTypeSavedAnimationCount' => 'PremiumLimitType::SavedAnimationCount', + 'premiumLimitTypeFavoriteStickerCount' => 'PremiumLimitType::FavoriteStickerCount', + 'premiumLimitTypeChatFolderCount' => 'PremiumLimitType::ChatFolderCount', + 'premiumLimitTypeChatFolderChosenChatCount' => 'PremiumLimitType::ChatFolderChosenChatCount', + 'premiumLimitTypePinnedArchivedChatCount' => 'PremiumLimitType::PinnedArchivedChatCount', + 'premiumLimitTypePinnedSavedMessagesTopicCount' => 'PremiumLimitType::PinnedSavedMessagesTopicCount', + 'premiumLimitTypeCaptionLength' => 'PremiumLimitType::CaptionLength', + 'premiumLimitTypeBioLength' => 'PremiumLimitType::BioLength', + 'premiumLimitTypeChatFolderInviteLinkCount' => 'PremiumLimitType::ChatFolderInviteLinkCount', + 'premiumLimitTypeShareableChatFolderCount' => 'PremiumLimitType::ShareableChatFolderCount', + 'premiumLimitTypeActiveStoryCount' => 'PremiumLimitType::ActiveStoryCount', + 'premiumLimitTypeWeeklySentStoryCount' => 'PremiumLimitType::WeeklySentStoryCount', + 'premiumLimitTypeMonthlySentStoryCount' => 'PremiumLimitType::MonthlySentStoryCount', + 'premiumLimitTypeStoryCaptionLength' => 'PremiumLimitType::StoryCaptionLength', + 'premiumLimitTypeStorySuggestedReactionAreaCount' => 'PremiumLimitType::StorySuggestedReactionAreaCount', + 'premiumLimitTypeSimilarChatCount' => 'PremiumLimitType::SimilarChatCount', + 'PremiumFeature' => 'PremiumFeature', + 'premiumFeatureIncreasedLimits' => 'PremiumFeature::IncreasedLimits', + 'premiumFeatureIncreasedUploadFileSize' => 'PremiumFeature::IncreasedUploadFileSize', + 'premiumFeatureImprovedDownloadSpeed' => 'PremiumFeature::ImprovedDownloadSpeed', + 'premiumFeatureVoiceRecognition' => 'PremiumFeature::VoiceRecognition', + 'premiumFeatureDisabledAds' => 'PremiumFeature::DisabledAds', + 'premiumFeatureUniqueReactions' => 'PremiumFeature::UniqueReactions', + 'premiumFeatureUniqueStickers' => 'PremiumFeature::UniqueStickers', + 'premiumFeatureCustomEmoji' => 'PremiumFeature::CustomEmoji', + 'premiumFeatureAdvancedChatManagement' => 'PremiumFeature::AdvancedChatManagement', + 'premiumFeatureProfileBadge' => 'PremiumFeature::ProfileBadge', + 'premiumFeatureEmojiStatus' => 'PremiumFeature::EmojiStatus', + 'premiumFeatureAnimatedProfilePhoto' => 'PremiumFeature::AnimatedProfilePhoto', + 'premiumFeatureForumTopicIcon' => 'PremiumFeature::ForumTopicIcon', + 'premiumFeatureAppIcons' => 'PremiumFeature::AppIcons', + 'premiumFeatureRealTimeChatTranslation' => 'PremiumFeature::RealTimeChatTranslation', + 'premiumFeatureUpgradedStories' => 'PremiumFeature::UpgradedStories', + 'premiumFeatureChatBoost' => 'PremiumFeature::ChatBoost', + 'premiumFeatureAccentColor' => 'PremiumFeature::AccentColor', + 'premiumFeatureBackgroundForBoth' => 'PremiumFeature::BackgroundForBoth', + 'premiumFeatureSavedMessagesTags' => 'PremiumFeature::SavedMessagesTags', + 'premiumFeatureMessagePrivacy' => 'PremiumFeature::MessagePrivacy', + 'premiumFeatureLastSeenTimes' => 'PremiumFeature::LastSeenTimes', + 'premiumFeatureBusiness' => 'PremiumFeature::Business', + 'premiumFeatureMessageEffects' => 'PremiumFeature::MessageEffects', + 'BusinessFeature' => 'BusinessFeature', + 'businessFeatureLocation' => 'BusinessFeature::Location', + 'businessFeatureOpeningHours' => 'BusinessFeature::OpeningHours', + 'businessFeatureQuickReplies' => 'BusinessFeature::QuickReplies', + 'businessFeatureGreetingMessage' => 'BusinessFeature::GreetingMessage', + 'businessFeatureAwayMessage' => 'BusinessFeature::AwayMessage', + 'businessFeatureAccountLinks' => 'BusinessFeature::AccountLinks', + 'businessFeatureStartPage' => 'BusinessFeature::StartPage', + 'businessFeatureBots' => 'BusinessFeature::Bots', + 'businessFeatureEmojiStatus' => 'BusinessFeature::EmojiStatus', + 'businessFeatureChatFolderTags' => 'BusinessFeature::ChatFolderTags', + 'businessFeatureUpgradedStories' => 'BusinessFeature::UpgradedStories', + 'PremiumStoryFeature' => 'PremiumStoryFeature', + 'premiumStoryFeaturePriorityOrder' => 'PremiumStoryFeature::PriorityOrder', + 'premiumStoryFeatureStealthMode' => 'PremiumStoryFeature::StealthMode', + 'premiumStoryFeaturePermanentViewsHistory' => 'PremiumStoryFeature::PermanentViewsHistory', + 'premiumStoryFeatureCustomExpirationDuration' => 'PremiumStoryFeature::CustomExpirationDuration', + 'premiumStoryFeatureSaveStories' => 'PremiumStoryFeature::SaveStories', + 'premiumStoryFeatureLinksAndFormatting' => 'PremiumStoryFeature::LinksAndFormatting', + 'premiumStoryFeatureVideoQuality' => 'PremiumStoryFeature::VideoQuality', + 'premiumLimit' => 'PremiumLimit', + 'premiumFeatures' => 'PremiumFeatures', + 'businessFeatures' => 'BusinessFeatures', + 'PremiumSource' => 'PremiumSource', + 'premiumSourceLimitExceeded' => 'PremiumSource::LimitExceeded', + 'premiumSourceFeature' => 'PremiumSource::Feature', + 'premiumSourceBusinessFeature' => 'PremiumSource::BusinessFeature', + 'premiumSourceStoryFeature' => 'PremiumSource::StoryFeature', + 'premiumSourceLink' => 'PremiumSource::Link', + 'premiumSourceSettings' => 'PremiumSource::Settings', + 'premiumFeaturePromotionAnimation' => 'PremiumFeaturePromotionAnimation', + 'businessFeaturePromotionAnimation' => 'BusinessFeaturePromotionAnimation', + 'premiumState' => 'PremiumState', + 'StorePaymentPurpose' => 'StorePaymentPurpose', + 'storePaymentPurposePremiumSubscription' => 'StorePaymentPurpose::PremiumSubscription', + 'storePaymentPurposeGiftedPremium' => 'StorePaymentPurpose::GiftedPremium', + 'storePaymentPurposePremiumGiftCodes' => 'StorePaymentPurpose::PremiumGiftCodes', + 'storePaymentPurposePremiumGiveaway' => 'StorePaymentPurpose::PremiumGiveaway', + 'storePaymentPurposeStars' => 'StorePaymentPurpose::Stars', + 'storePaymentPurposeGiftedStars' => 'StorePaymentPurpose::GiftedStars', + 'TelegramPaymentPurpose' => 'TelegramPaymentPurpose', + 'telegramPaymentPurposePremiumGiftCodes' => 'TelegramPaymentPurpose::PremiumGiftCodes', + 'telegramPaymentPurposePremiumGiveaway' => 'TelegramPaymentPurpose::PremiumGiveaway', + 'telegramPaymentPurposeStars' => 'TelegramPaymentPurpose::Stars', + 'telegramPaymentPurposeGiftedStars' => 'TelegramPaymentPurpose::GiftedStars', + 'telegramPaymentPurposeJoinChat' => 'TelegramPaymentPurpose::JoinChat', + 'DeviceToken' => 'DeviceToken', + 'deviceTokenFirebaseCloudMessaging' => 'DeviceToken::FirebaseCloudMessaging', + 'deviceTokenApplePush' => 'DeviceToken::ApplePush', + 'deviceTokenApplePushVoIP' => 'DeviceToken::ApplePushVoIP', + 'deviceTokenWindowsPush' => 'DeviceToken::WindowsPush', + 'deviceTokenMicrosoftPush' => 'DeviceToken::MicrosoftPush', + 'deviceTokenMicrosoftPushVoIP' => 'DeviceToken::MicrosoftPushVoIP', + 'deviceTokenWebPush' => 'DeviceToken::WebPush', + 'deviceTokenSimplePush' => 'DeviceToken::SimplePush', + 'deviceTokenUbuntuPush' => 'DeviceToken::UbuntuPush', + 'deviceTokenBlackBerryPush' => 'DeviceToken::BlackBerryPush', + 'deviceTokenTizenPush' => 'DeviceToken::TizenPush', + 'deviceTokenHuaweiPush' => 'DeviceToken::HuaweiPush', + 'pushReceiverId' => 'PushReceiverId', + 'BackgroundFill' => 'BackgroundFill', + 'backgroundFillSolid' => 'BackgroundFill::Solid', + 'backgroundFillGradient' => 'BackgroundFill::Gradient', + 'backgroundFillFreeformGradient' => 'BackgroundFill::FreeformGradient', + 'BackgroundType' => 'BackgroundType', + 'backgroundTypeWallpaper' => 'BackgroundType::Wallpaper', + 'backgroundTypePattern' => 'BackgroundType::Pattern', + 'backgroundTypeFill' => 'BackgroundType::Fill', + 'backgroundTypeChatTheme' => 'BackgroundType::ChatTheme', + 'InputBackground' => 'InputBackground', + 'inputBackgroundLocal' => 'InputBackground::Local', + 'inputBackgroundRemote' => 'InputBackground::Remote', + 'inputBackgroundPrevious' => 'InputBackground::Previous', + 'chatTheme' => 'ChatTheme', + 'timeZone' => 'TimeZone', + 'timeZones' => 'TimeZones', + 'hashtags' => 'Hashtags', + 'CanSendStoryResult' => 'CanSendStoryResult', + 'canSendStoryResultOk' => 'CanSendStoryResult::Ok', + 'canSendStoryResultPremiumNeeded' => 'CanSendStoryResult::PremiumNeeded', + 'canSendStoryResultBoostNeeded' => 'CanSendStoryResult::BoostNeeded', + 'canSendStoryResultActiveStoryLimitExceeded' => 'CanSendStoryResult::ActiveStoryLimitExceeded', + 'canSendStoryResultWeeklyLimitExceeded' => 'CanSendStoryResult::WeeklyLimitExceeded', + 'canSendStoryResultMonthlyLimitExceeded' => 'CanSendStoryResult::MonthlyLimitExceeded', + 'CanTransferOwnershipResult' => 'CanTransferOwnershipResult', + 'canTransferOwnershipResultOk' => 'CanTransferOwnershipResult::Ok', + 'canTransferOwnershipResultPasswordNeeded' => 'CanTransferOwnershipResult::PasswordNeeded', + 'canTransferOwnershipResultPasswordTooFresh' => 'CanTransferOwnershipResult::PasswordTooFresh', + 'canTransferOwnershipResultSessionTooFresh' => 'CanTransferOwnershipResult::SessionTooFresh', + 'CheckChatUsernameResult' => 'CheckChatUsernameResult', + 'checkChatUsernameResultOk' => 'CheckChatUsernameResult::Ok', + 'checkChatUsernameResultUsernameInvalid' => 'CheckChatUsernameResult::UsernameInvalid', + 'checkChatUsernameResultUsernameOccupied' => 'CheckChatUsernameResult::UsernameOccupied', + 'checkChatUsernameResultUsernamePurchasable' => 'CheckChatUsernameResult::UsernamePurchasable', + 'checkChatUsernameResultPublicChatsTooMany' => 'CheckChatUsernameResult::PublicChatsTooMany', + 'checkChatUsernameResultPublicGroupsUnavailable' => 'CheckChatUsernameResult::PublicGroupsUnavailable', + 'CheckStickerSetNameResult' => 'CheckStickerSetNameResult', + 'checkStickerSetNameResultOk' => 'CheckStickerSetNameResult::Ok', + 'checkStickerSetNameResultNameInvalid' => 'CheckStickerSetNameResult::NameInvalid', + 'checkStickerSetNameResultNameOccupied' => 'CheckStickerSetNameResult::NameOccupied', + 'ResetPasswordResult' => 'ResetPasswordResult', + 'resetPasswordResultOk' => 'ResetPasswordResult::Ok', + 'resetPasswordResultPending' => 'ResetPasswordResult::Pending', + 'resetPasswordResultDeclined' => 'ResetPasswordResult::Declined', + 'MessageFileType' => 'MessageFileType', + 'messageFileTypePrivate' => 'MessageFileType::Private', + 'messageFileTypeGroup' => 'MessageFileType::Group', + 'messageFileTypeUnknown' => 'MessageFileType::Unknown', + 'PushMessageContent' => 'PushMessageContent', + 'pushMessageContentHidden' => 'PushMessageContent::Hidden', + 'pushMessageContentAnimation' => 'PushMessageContent::Animation', + 'pushMessageContentAudio' => 'PushMessageContent::Audio', + 'pushMessageContentContact' => 'PushMessageContent::Contact', + 'pushMessageContentContactRegistered' => 'PushMessageContent::ContactRegistered', + 'pushMessageContentDocument' => 'PushMessageContent::Document', + 'pushMessageContentGame' => 'PushMessageContent::Game', + 'pushMessageContentGameScore' => 'PushMessageContent::GameScore', + 'pushMessageContentInvoice' => 'PushMessageContent::Invoice', + 'pushMessageContentLocation' => 'PushMessageContent::Location', + 'pushMessageContentPaidMedia' => 'PushMessageContent::PaidMedia', + 'pushMessageContentPhoto' => 'PushMessageContent::Photo', + 'pushMessageContentPoll' => 'PushMessageContent::Poll', + 'pushMessageContentPremiumGiftCode' => 'PushMessageContent::PremiumGiftCode', + 'pushMessageContentPremiumGiveaway' => 'PushMessageContent::PremiumGiveaway', + 'pushMessageContentScreenshotTaken' => 'PushMessageContent::ScreenshotTaken', + 'pushMessageContentSticker' => 'PushMessageContent::Sticker', + 'pushMessageContentStory' => 'PushMessageContent::Story', + 'pushMessageContentText' => 'PushMessageContent::Text', + 'pushMessageContentVideo' => 'PushMessageContent::Video', + 'pushMessageContentVideoNote' => 'PushMessageContent::VideoNote', + 'pushMessageContentVoiceNote' => 'PushMessageContent::VoiceNote', + 'pushMessageContentBasicGroupChatCreate' => 'PushMessageContent::BasicGroupChatCreate', + 'pushMessageContentChatAddMembers' => 'PushMessageContent::ChatAddMembers', + 'pushMessageContentChatChangePhoto' => 'PushMessageContent::ChatChangePhoto', + 'pushMessageContentChatChangeTitle' => 'PushMessageContent::ChatChangeTitle', + 'pushMessageContentChatSetBackground' => 'PushMessageContent::ChatSetBackground', + 'pushMessageContentChatSetTheme' => 'PushMessageContent::ChatSetTheme', + 'pushMessageContentChatDeleteMember' => 'PushMessageContent::ChatDeleteMember', + 'pushMessageContentChatJoinByLink' => 'PushMessageContent::ChatJoinByLink', + 'pushMessageContentChatJoinByRequest' => 'PushMessageContent::ChatJoinByRequest', + 'pushMessageContentRecurringPayment' => 'PushMessageContent::RecurringPayment', + 'pushMessageContentSuggestProfilePhoto' => 'PushMessageContent::SuggestProfilePhoto', + 'pushMessageContentMessageForwards' => 'PushMessageContent::MessageForwards', + 'pushMessageContentMediaAlbum' => 'PushMessageContent::MediaAlbum', + 'NotificationType' => 'NotificationType', + 'notificationTypeNewMessage' => 'NotificationType::NewMessage', + 'notificationTypeNewSecretChat' => 'NotificationType::NewSecretChat', + 'notificationTypeNewCall' => 'NotificationType::NewCall', + 'notificationTypeNewPushMessage' => 'NotificationType::NewPushMessage', + 'NotificationGroupType' => 'NotificationGroupType', + 'notificationGroupTypeMessages' => 'NotificationGroupType::Messages', + 'notificationGroupTypeMentions' => 'NotificationGroupType::Mentions', + 'notificationGroupTypeSecretChat' => 'NotificationGroupType::SecretChat', + 'notificationGroupTypeCalls' => 'NotificationGroupType::Calls', + 'notificationSound' => 'NotificationSound', + 'notificationSounds' => 'NotificationSounds', + 'notification' => 'Notification', + 'notificationGroup' => 'NotificationGroup', + 'OptionValue' => 'OptionValue', + 'optionValueBoolean' => 'OptionValue::Boolean', + 'optionValueEmpty' => 'OptionValue::Empty', + 'optionValueInteger' => 'OptionValue::Integer', + 'optionValueString' => 'OptionValue::String', + 'jsonObjectMember' => 'JsonObjectMember', + 'JsonValue' => 'JsonValue', + 'jsonValueNull' => 'JsonValue::Null', + 'jsonValueBoolean' => 'JsonValue::Boolean', + 'jsonValueNumber' => 'JsonValue::Number', + 'jsonValueString' => 'JsonValue::String', + 'jsonValueArray' => 'JsonValue::Array', + 'jsonValueObject' => 'JsonValue::Object', + 'StoryPrivacySettings' => 'StoryPrivacySettings', + 'storyPrivacySettingsEveryone' => 'StoryPrivacySettings::Everyone', + 'storyPrivacySettingsContacts' => 'StoryPrivacySettings::Contacts', + 'storyPrivacySettingsCloseFriends' => 'StoryPrivacySettings::CloseFriends', + 'storyPrivacySettingsSelectedUsers' => 'StoryPrivacySettings::SelectedUsers', + 'UserPrivacySettingRule' => 'UserPrivacySettingRule', + 'userPrivacySettingRuleAllowAll' => 'UserPrivacySettingRule::AllowAll', + 'userPrivacySettingRuleAllowContacts' => 'UserPrivacySettingRule::AllowContacts', + 'userPrivacySettingRuleAllowPremiumUsers' => 'UserPrivacySettingRule::AllowPremiumUsers', + 'userPrivacySettingRuleAllowUsers' => 'UserPrivacySettingRule::AllowUsers', + 'userPrivacySettingRuleAllowChatMembers' => 'UserPrivacySettingRule::AllowChatMembers', + 'userPrivacySettingRuleRestrictAll' => 'UserPrivacySettingRule::RestrictAll', + 'userPrivacySettingRuleRestrictContacts' => 'UserPrivacySettingRule::RestrictContacts', + 'userPrivacySettingRuleRestrictUsers' => 'UserPrivacySettingRule::RestrictUsers', + 'userPrivacySettingRuleRestrictChatMembers' => 'UserPrivacySettingRule::RestrictChatMembers', + 'userPrivacySettingRules' => 'UserPrivacySettingRules', + 'UserPrivacySetting' => 'UserPrivacySetting', + 'userPrivacySettingShowStatus' => 'UserPrivacySetting::ShowStatus', + 'userPrivacySettingShowProfilePhoto' => 'UserPrivacySetting::ShowProfilePhoto', + 'userPrivacySettingShowLinkInForwardedMessages' => 'UserPrivacySetting::ShowLinkInForwardedMessages', + 'userPrivacySettingShowPhoneNumber' => 'UserPrivacySetting::ShowPhoneNumber', + 'userPrivacySettingShowBio' => 'UserPrivacySetting::ShowBio', + 'userPrivacySettingShowBirthdate' => 'UserPrivacySetting::ShowBirthdate', + 'userPrivacySettingAllowChatInvites' => 'UserPrivacySetting::AllowChatInvites', + 'userPrivacySettingAllowCalls' => 'UserPrivacySetting::AllowCalls', + 'userPrivacySettingAllowPeerToPeerCalls' => 'UserPrivacySetting::AllowPeerToPeerCalls', + 'userPrivacySettingAllowFindingByPhoneNumber' => 'UserPrivacySetting::AllowFindingByPhoneNumber', + 'userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages' => 'UserPrivacySetting::AllowPrivateVoiceAndVideoNoteMessages', + 'readDatePrivacySettings' => 'ReadDatePrivacySettings', + 'newChatPrivacySettings' => 'NewChatPrivacySettings', + 'CanSendMessageToUserResult' => 'CanSendMessageToUserResult', + 'canSendMessageToUserResultOk' => 'CanSendMessageToUserResult::Ok', + 'canSendMessageToUserResultUserIsDeleted' => 'CanSendMessageToUserResult::UserIsDeleted', + 'canSendMessageToUserResultUserRestrictsNewChats' => 'CanSendMessageToUserResult::UserRestrictsNewChats', + 'accountTtl' => 'AccountTtl', + 'messageAutoDeleteTime' => 'MessageAutoDeleteTime', + 'SessionType' => 'SessionType', + 'sessionTypeAndroid' => 'SessionType::Android', + 'sessionTypeApple' => 'SessionType::Apple', + 'sessionTypeBrave' => 'SessionType::Brave', + 'sessionTypeChrome' => 'SessionType::Chrome', + 'sessionTypeEdge' => 'SessionType::Edge', + 'sessionTypeFirefox' => 'SessionType::Firefox', + 'sessionTypeIpad' => 'SessionType::Ipad', + 'sessionTypeIphone' => 'SessionType::Iphone', + 'sessionTypeLinux' => 'SessionType::Linux', + 'sessionTypeMac' => 'SessionType::Mac', + 'sessionTypeOpera' => 'SessionType::Opera', + 'sessionTypeSafari' => 'SessionType::Safari', + 'sessionTypeUbuntu' => 'SessionType::Ubuntu', + 'sessionTypeUnknown' => 'SessionType::Unknown', + 'sessionTypeVivaldi' => 'SessionType::Vivaldi', + 'sessionTypeWindows' => 'SessionType::Windows', + 'sessionTypeXbox' => 'SessionType::Xbox', + 'session' => 'Session', + 'sessions' => 'Sessions', + 'unconfirmedSession' => 'UnconfirmedSession', + 'connectedWebsite' => 'ConnectedWebsite', + 'connectedWebsites' => 'ConnectedWebsites', + 'ReportReason' => 'ReportReason', + 'reportReasonSpam' => 'ReportReason::Spam', + 'reportReasonViolence' => 'ReportReason::Violence', + 'reportReasonPornography' => 'ReportReason::Pornography', + 'reportReasonChildAbuse' => 'ReportReason::ChildAbuse', + 'reportReasonCopyright' => 'ReportReason::Copyright', + 'reportReasonUnrelatedLocation' => 'ReportReason::UnrelatedLocation', + 'reportReasonFake' => 'ReportReason::Fake', + 'reportReasonIllegalDrugs' => 'ReportReason::IllegalDrugs', + 'reportReasonPersonalDetails' => 'ReportReason::PersonalDetails', + 'reportReasonCustom' => 'ReportReason::Custom', + 'TargetChat' => 'TargetChat', + 'targetChatCurrent' => 'TargetChat::Current', + 'targetChatChosen' => 'TargetChat::Chosen', + 'targetChatInternalLink' => 'TargetChat::InternalLink', + 'InternalLinkType' => 'InternalLinkType', + 'internalLinkTypeActiveSessions' => 'InternalLinkType::ActiveSessions', + 'internalLinkTypeAttachmentMenuBot' => 'InternalLinkType::AttachmentMenuBot', + 'internalLinkTypeAuthenticationCode' => 'InternalLinkType::AuthenticationCode', + 'internalLinkTypeBackground' => 'InternalLinkType::Background', + 'internalLinkTypeBotAddToChannel' => 'InternalLinkType::BotAddToChannel', + 'internalLinkTypeBotStart' => 'InternalLinkType::BotStart', + 'internalLinkTypeBotStartInGroup' => 'InternalLinkType::BotStartInGroup', + 'internalLinkTypeBusinessChat' => 'InternalLinkType::BusinessChat', + 'internalLinkTypeBuyStars' => 'InternalLinkType::BuyStars', + 'internalLinkTypeChangePhoneNumber' => 'InternalLinkType::ChangePhoneNumber', + 'internalLinkTypeChatBoost' => 'InternalLinkType::ChatBoost', + 'internalLinkTypeChatFolderInvite' => 'InternalLinkType::ChatFolderInvite', + 'internalLinkTypeChatFolderSettings' => 'InternalLinkType::ChatFolderSettings', + 'internalLinkTypeChatInvite' => 'InternalLinkType::ChatInvite', + 'internalLinkTypeDefaultMessageAutoDeleteTimerSettings' => 'InternalLinkType::DefaultMessageAutoDeleteTimerSettings', + 'internalLinkTypeEditProfileSettings' => 'InternalLinkType::EditProfileSettings', + 'internalLinkTypeGame' => 'InternalLinkType::Game', + 'internalLinkTypeInstantView' => 'InternalLinkType::InstantView', + 'internalLinkTypeInvoice' => 'InternalLinkType::Invoice', + 'internalLinkTypeLanguagePack' => 'InternalLinkType::LanguagePack', + 'internalLinkTypeLanguageSettings' => 'InternalLinkType::LanguageSettings', + 'internalLinkTypeMainWebApp' => 'InternalLinkType::MainWebApp', + 'internalLinkTypeMessage' => 'InternalLinkType::Message', + 'internalLinkTypeMessageDraft' => 'InternalLinkType::MessageDraft', + 'internalLinkTypePassportDataRequest' => 'InternalLinkType::PassportDataRequest', + 'internalLinkTypePhoneNumberConfirmation' => 'InternalLinkType::PhoneNumberConfirmation', + 'internalLinkTypePremiumFeatures' => 'InternalLinkType::PremiumFeatures', + 'internalLinkTypePremiumGift' => 'InternalLinkType::PremiumGift', + 'internalLinkTypePremiumGiftCode' => 'InternalLinkType::PremiumGiftCode', + 'internalLinkTypePrivacyAndSecuritySettings' => 'InternalLinkType::PrivacyAndSecuritySettings', + 'internalLinkTypeProxy' => 'InternalLinkType::Proxy', + 'internalLinkTypePublicChat' => 'InternalLinkType::PublicChat', + 'internalLinkTypeQrCodeAuthentication' => 'InternalLinkType::QrCodeAuthentication', + 'internalLinkTypeRestorePurchases' => 'InternalLinkType::RestorePurchases', + 'internalLinkTypeSettings' => 'InternalLinkType::Settings', + 'internalLinkTypeStickerSet' => 'InternalLinkType::StickerSet', + 'internalLinkTypeStory' => 'InternalLinkType::Story', + 'internalLinkTypeTheme' => 'InternalLinkType::Theme', + 'internalLinkTypeThemeSettings' => 'InternalLinkType::ThemeSettings', + 'internalLinkTypeUnknownDeepLink' => 'InternalLinkType::UnknownDeepLink', + 'internalLinkTypeUnsupportedProxy' => 'InternalLinkType::UnsupportedProxy', + 'internalLinkTypeUserPhoneNumber' => 'InternalLinkType::UserPhoneNumber', + 'internalLinkTypeUserToken' => 'InternalLinkType::UserToken', + 'internalLinkTypeVideoChat' => 'InternalLinkType::VideoChat', + 'internalLinkTypeWebApp' => 'InternalLinkType::WebApp', + 'messageLink' => 'MessageLink', + 'messageLinkInfo' => 'MessageLinkInfo', + 'chatBoostLink' => 'ChatBoostLink', + 'chatBoostLinkInfo' => 'ChatBoostLinkInfo', + 'BlockList' => 'BlockList', + 'blockListMain' => 'BlockList::Main', + 'blockListStories' => 'BlockList::Stories', + 'filePart' => 'FilePart', + 'FileType' => 'FileType', + 'fileTypeNone' => 'FileType::None', + 'fileTypeAnimation' => 'FileType::Animation', + 'fileTypeAudio' => 'FileType::Audio', + 'fileTypeDocument' => 'FileType::Document', + 'fileTypeNotificationSound' => 'FileType::NotificationSound', + 'fileTypePhoto' => 'FileType::Photo', + 'fileTypePhotoStory' => 'FileType::PhotoStory', + 'fileTypeProfilePhoto' => 'FileType::ProfilePhoto', + 'fileTypeSecret' => 'FileType::Secret', + 'fileTypeSecretThumbnail' => 'FileType::SecretThumbnail', + 'fileTypeSecure' => 'FileType::Secure', + 'fileTypeSticker' => 'FileType::Sticker', + 'fileTypeThumbnail' => 'FileType::Thumbnail', + 'fileTypeUnknown' => 'FileType::Unknown', + 'fileTypeVideo' => 'FileType::Video', + 'fileTypeVideoNote' => 'FileType::VideoNote', + 'fileTypeVideoStory' => 'FileType::VideoStory', + 'fileTypeVoiceNote' => 'FileType::VoiceNote', + 'fileTypeWallpaper' => 'FileType::Wallpaper', + 'storageStatisticsByFileType' => 'StorageStatisticsByFileType', + 'storageStatisticsByChat' => 'StorageStatisticsByChat', + 'storageStatistics' => 'StorageStatistics', + 'storageStatisticsFast' => 'StorageStatisticsFast', + 'databaseStatistics' => 'DatabaseStatistics', + 'NetworkType' => 'NetworkType', + 'networkTypeNone' => 'NetworkType::None', + 'networkTypeMobile' => 'NetworkType::Mobile', + 'networkTypeMobileRoaming' => 'NetworkType::MobileRoaming', + 'networkTypeWiFi' => 'NetworkType::WiFi', + 'networkTypeOther' => 'NetworkType::Other', + 'NetworkStatisticsEntry' => 'NetworkStatisticsEntry', + 'networkStatisticsEntryFile' => 'NetworkStatisticsEntry::File', + 'networkStatisticsEntryCall' => 'NetworkStatisticsEntry::Call', + 'networkStatistics' => 'NetworkStatistics', + 'autoDownloadSettings' => 'AutoDownloadSettings', + 'autoDownloadSettingsPresets' => 'AutoDownloadSettingsPresets', + 'AutosaveSettingsScope' => 'AutosaveSettingsScope', + 'autosaveSettingsScopePrivateChats' => 'AutosaveSettingsScope::PrivateChats', + 'autosaveSettingsScopeGroupChats' => 'AutosaveSettingsScope::GroupChats', + 'autosaveSettingsScopeChannelChats' => 'AutosaveSettingsScope::ChannelChats', + 'autosaveSettingsScopeChat' => 'AutosaveSettingsScope::Chat', + 'scopeAutosaveSettings' => 'ScopeAutosaveSettings', + 'autosaveSettingsException' => 'AutosaveSettingsException', + 'autosaveSettings' => 'AutosaveSettings', + 'ConnectionState' => 'ConnectionState', + 'connectionStateWaitingForNetwork' => 'ConnectionState::WaitingForNetwork', + 'connectionStateConnectingToProxy' => 'ConnectionState::ConnectingToProxy', + 'connectionStateConnecting' => 'ConnectionState::Connecting', + 'connectionStateUpdating' => 'ConnectionState::Updating', + 'connectionStateReady' => 'ConnectionState::Ready', + 'TopChatCategory' => 'TopChatCategory', + 'topChatCategoryUsers' => 'TopChatCategory::Users', + 'topChatCategoryBots' => 'TopChatCategory::Bots', + 'topChatCategoryGroups' => 'TopChatCategory::Groups', + 'topChatCategoryChannels' => 'TopChatCategory::Channels', + 'topChatCategoryInlineBots' => 'TopChatCategory::InlineBots', + 'topChatCategoryWebAppBots' => 'TopChatCategory::WebAppBots', + 'topChatCategoryCalls' => 'TopChatCategory::Calls', + 'topChatCategoryForwardChats' => 'TopChatCategory::ForwardChats', + 'foundPosition' => 'FoundPosition', + 'foundPositions' => 'FoundPositions', + 'TMeUrlType' => 'TMeUrlType', + 'tMeUrlTypeUser' => 'TMeUrlType::User', + 'tMeUrlTypeSupergroup' => 'TMeUrlType::Supergroup', + 'tMeUrlTypeChatInvite' => 'TMeUrlType::ChatInvite', + 'tMeUrlTypeStickerSet' => 'TMeUrlType::StickerSet', + 'tMeUrl' => 'TMeUrl', + 'tMeUrls' => 'TMeUrls', + 'SuggestedAction' => 'SuggestedAction', + 'suggestedActionEnableArchiveAndMuteNewChats' => 'SuggestedAction::EnableArchiveAndMuteNewChats', + 'suggestedActionCheckPassword' => 'SuggestedAction::CheckPassword', + 'suggestedActionCheckPhoneNumber' => 'SuggestedAction::CheckPhoneNumber', + 'suggestedActionViewChecksHint' => 'SuggestedAction::ViewChecksHint', + 'suggestedActionConvertToBroadcastGroup' => 'SuggestedAction::ConvertToBroadcastGroup', + 'suggestedActionSetPassword' => 'SuggestedAction::SetPassword', + 'suggestedActionUpgradePremium' => 'SuggestedAction::UpgradePremium', + 'suggestedActionRestorePremium' => 'SuggestedAction::RestorePremium', + 'suggestedActionSubscribeToAnnualPremium' => 'SuggestedAction::SubscribeToAnnualPremium', + 'suggestedActionGiftPremiumForChristmas' => 'SuggestedAction::GiftPremiumForChristmas', + 'suggestedActionSetBirthdate' => 'SuggestedAction::SetBirthdate', + 'suggestedActionExtendPremium' => 'SuggestedAction::ExtendPremium', + 'suggestedActionExtendStarSubscriptions' => 'SuggestedAction::ExtendStarSubscriptions', + 'count' => 'Count', + 'text' => 'Text', + 'seconds' => 'Seconds', + 'fileDownloadedPrefixSize' => 'FileDownloadedPrefixSize', + 'deepLinkInfo' => 'DeepLinkInfo', + 'TextParseMode' => 'TextParseMode', + 'textParseModeMarkdown' => 'TextParseMode::Markdown', + 'textParseModeHTML' => 'TextParseMode::HTML', + 'ProxyType' => 'ProxyType', + 'proxyTypeSocks5' => 'ProxyType::Socks5', + 'proxyTypeHttp' => 'ProxyType::Http', + 'proxyTypeMtproto' => 'ProxyType::Mtproto', + 'proxy' => 'Proxy', + 'proxies' => 'Proxies', + 'inputSticker' => 'InputSticker', + 'dateRange' => 'DateRange', + 'statisticalValue' => 'StatisticalValue', + 'StatisticalGraph' => 'StatisticalGraph', + 'statisticalGraphData' => 'StatisticalGraph::Data', + 'statisticalGraphAsync' => 'StatisticalGraph::Async', + 'statisticalGraphError' => 'StatisticalGraph::Error', + 'ChatStatisticsObjectType' => 'ChatStatisticsObjectType', + 'chatStatisticsObjectTypeMessage' => 'ChatStatisticsObjectType::Message', + 'chatStatisticsObjectTypeStory' => 'ChatStatisticsObjectType::Story', + 'chatStatisticsInteractionInfo' => 'ChatStatisticsInteractionInfo', + 'chatStatisticsMessageSenderInfo' => 'ChatStatisticsMessageSenderInfo', + 'chatStatisticsAdministratorActionsInfo' => 'ChatStatisticsAdministratorActionsInfo', + 'chatStatisticsInviterInfo' => 'ChatStatisticsInviterInfo', + 'ChatStatistics' => 'ChatStatistics', + 'chatStatisticsSupergroup' => 'ChatStatistics::Supergroup', + 'chatStatisticsChannel' => 'ChatStatistics::Channel', + 'chatRevenueAmount' => 'ChatRevenueAmount', + 'chatRevenueStatistics' => 'ChatRevenueStatistics', + 'messageStatistics' => 'MessageStatistics', + 'storyStatistics' => 'StoryStatistics', + 'RevenueWithdrawalState' => 'RevenueWithdrawalState', + 'revenueWithdrawalStatePending' => 'RevenueWithdrawalState::Pending', + 'revenueWithdrawalStateSucceeded' => 'RevenueWithdrawalState::Succeeded', + 'revenueWithdrawalStateFailed' => 'RevenueWithdrawalState::Failed', + 'ChatRevenueTransactionType' => 'ChatRevenueTransactionType', + 'chatRevenueTransactionTypeEarnings' => 'ChatRevenueTransactionType::Earnings', + 'chatRevenueTransactionTypeWithdrawal' => 'ChatRevenueTransactionType::Withdrawal', + 'chatRevenueTransactionTypeRefund' => 'ChatRevenueTransactionType::Refund', + 'chatRevenueTransaction' => 'ChatRevenueTransaction', + 'chatRevenueTransactions' => 'ChatRevenueTransactions', + 'starRevenueStatus' => 'StarRevenueStatus', + 'starRevenueStatistics' => 'StarRevenueStatistics', + 'point' => 'Point', + 'VectorPathCommand' => 'VectorPathCommand', + 'vectorPathCommandLine' => 'VectorPathCommand::Line', + 'vectorPathCommandCubicBezierCurve' => 'VectorPathCommand::CubicBezierCurve', + 'BotCommandScope' => 'BotCommandScope', + 'botCommandScopeDefault' => 'BotCommandScope::Default', + 'botCommandScopeAllPrivateChats' => 'BotCommandScope::AllPrivateChats', + 'botCommandScopeAllGroupChats' => 'BotCommandScope::AllGroupChats', + 'botCommandScopeAllChatAdministrators' => 'BotCommandScope::AllChatAdministrators', + 'botCommandScopeChat' => 'BotCommandScope::Chat', + 'botCommandScopeChatAdministrators' => 'BotCommandScope::ChatAdministrators', + 'botCommandScopeChatMember' => 'BotCommandScope::ChatMember', + 'PhoneNumberCodeType' => 'PhoneNumberCodeType', + 'phoneNumberCodeTypeChange' => 'PhoneNumberCodeType::Change', + 'phoneNumberCodeTypeVerify' => 'PhoneNumberCodeType::Verify', + 'phoneNumberCodeTypeConfirmOwnership' => 'PhoneNumberCodeType::ConfirmOwnership', + 'Update' => 'Update', + 'updateAuthorizationState' => 'Update::AuthorizationState', + 'updateNewMessage' => 'Update::NewMessage', + 'updateMessageSendAcknowledged' => 'Update::MessageSendAcknowledged', + 'updateMessageSendSucceeded' => 'Update::MessageSendSucceeded', + 'updateMessageSendFailed' => 'Update::MessageSendFailed', + 'updateMessageContent' => 'Update::MessageContent', + 'updateMessageEdited' => 'Update::MessageEdited', + 'updateMessageIsPinned' => 'Update::MessageIsPinned', + 'updateMessageInteractionInfo' => 'Update::MessageInteractionInfo', + 'updateMessageContentOpened' => 'Update::MessageContentOpened', + 'updateMessageMentionRead' => 'Update::MessageMentionRead', + 'updateMessageUnreadReactions' => 'Update::MessageUnreadReactions', + 'updateMessageFactCheck' => 'Update::MessageFactCheck', + 'updateMessageLiveLocationViewed' => 'Update::MessageLiveLocationViewed', + 'updateNewChat' => 'Update::NewChat', + 'updateChatTitle' => 'Update::ChatTitle', + 'updateChatPhoto' => 'Update::ChatPhoto', + 'updateChatAccentColors' => 'Update::ChatAccentColors', + 'updateChatPermissions' => 'Update::ChatPermissions', + 'updateChatLastMessage' => 'Update::ChatLastMessage', + 'updateChatPosition' => 'Update::ChatPosition', + 'updateChatAddedToList' => 'Update::ChatAddedToList', + 'updateChatRemovedFromList' => 'Update::ChatRemovedFromList', + 'updateChatReadInbox' => 'Update::ChatReadInbox', + 'updateChatReadOutbox' => 'Update::ChatReadOutbox', + 'updateChatActionBar' => 'Update::ChatActionBar', + 'updateChatBusinessBotManageBar' => 'Update::ChatBusinessBotManageBar', + 'updateChatAvailableReactions' => 'Update::ChatAvailableReactions', + 'updateChatDraftMessage' => 'Update::ChatDraftMessage', + 'updateChatEmojiStatus' => 'Update::ChatEmojiStatus', + 'updateChatMessageSender' => 'Update::ChatMessageSender', + 'updateChatMessageAutoDeleteTime' => 'Update::ChatMessageAutoDeleteTime', + 'updateChatNotificationSettings' => 'Update::ChatNotificationSettings', + 'updateChatPendingJoinRequests' => 'Update::ChatPendingJoinRequests', + 'updateChatReplyMarkup' => 'Update::ChatReplyMarkup', + 'updateChatBackground' => 'Update::ChatBackground', + 'updateChatTheme' => 'Update::ChatTheme', + 'updateChatUnreadMentionCount' => 'Update::ChatUnreadMentionCount', + 'updateChatUnreadReactionCount' => 'Update::ChatUnreadReactionCount', + 'updateChatVideoChat' => 'Update::ChatVideoChat', + 'updateChatDefaultDisableNotification' => 'Update::ChatDefaultDisableNotification', + 'updateChatHasProtectedContent' => 'Update::ChatHasProtectedContent', + 'updateChatIsTranslatable' => 'Update::ChatIsTranslatable', + 'updateChatIsMarkedAsUnread' => 'Update::ChatIsMarkedAsUnread', + 'updateChatViewAsTopics' => 'Update::ChatViewAsTopics', + 'updateChatBlockList' => 'Update::ChatBlockList', + 'updateChatHasScheduledMessages' => 'Update::ChatHasScheduledMessages', + 'updateChatFolders' => 'Update::ChatFolders', + 'updateChatOnlineMemberCount' => 'Update::ChatOnlineMemberCount', + 'updateSavedMessagesTopic' => 'Update::SavedMessagesTopic', + 'updateSavedMessagesTopicCount' => 'Update::SavedMessagesTopicCount', + 'updateQuickReplyShortcut' => 'Update::QuickReplyShortcut', + 'updateQuickReplyShortcutDeleted' => 'Update::QuickReplyShortcutDeleted', + 'updateQuickReplyShortcuts' => 'Update::QuickReplyShortcuts', + 'updateQuickReplyShortcutMessages' => 'Update::QuickReplyShortcutMessages', + 'updateForumTopicInfo' => 'Update::ForumTopicInfo', + 'updateScopeNotificationSettings' => 'Update::ScopeNotificationSettings', + 'updateReactionNotificationSettings' => 'Update::ReactionNotificationSettings', + 'updateNotification' => 'Update::Notification', + 'updateNotificationGroup' => 'Update::NotificationGroup', + 'updateActiveNotifications' => 'Update::ActiveNotifications', + 'updateHavePendingNotifications' => 'Update::HavePendingNotifications', + 'updateDeleteMessages' => 'Update::DeleteMessages', + 'updateChatAction' => 'Update::ChatAction', + 'updateUserStatus' => 'Update::UserStatus', + 'updateUser' => 'Update::User', + 'updateBasicGroup' => 'Update::BasicGroup', + 'updateSupergroup' => 'Update::Supergroup', + 'updateSecretChat' => 'Update::SecretChat', + 'updateUserFullInfo' => 'Update::UserFullInfo', + 'updateBasicGroupFullInfo' => 'Update::BasicGroupFullInfo', + 'updateSupergroupFullInfo' => 'Update::SupergroupFullInfo', + 'updateServiceNotification' => 'Update::ServiceNotification', + 'updateFile' => 'Update::File', + 'updateFileGenerationStart' => 'Update::FileGenerationStart', + 'updateFileGenerationStop' => 'Update::FileGenerationStop', + 'updateFileDownloads' => 'Update::FileDownloads', + 'updateFileAddedToDownloads' => 'Update::FileAddedToDownloads', + 'updateFileDownload' => 'Update::FileDownload', + 'updateFileRemovedFromDownloads' => 'Update::FileRemovedFromDownloads', + 'updateApplicationVerificationRequired' => 'Update::ApplicationVerificationRequired', + 'updateCall' => 'Update::Call', + 'updateGroupCall' => 'Update::GroupCall', + 'updateGroupCallParticipant' => 'Update::GroupCallParticipant', + 'updateNewCallSignalingData' => 'Update::NewCallSignalingData', + 'updateUserPrivacySettingRules' => 'Update::UserPrivacySettingRules', + 'updateUnreadMessageCount' => 'Update::UnreadMessageCount', + 'updateUnreadChatCount' => 'Update::UnreadChatCount', + 'updateStory' => 'Update::Story', + 'updateStoryDeleted' => 'Update::StoryDeleted', + 'updateStorySendSucceeded' => 'Update::StorySendSucceeded', + 'updateStorySendFailed' => 'Update::StorySendFailed', + 'updateChatActiveStories' => 'Update::ChatActiveStories', + 'updateStoryListChatCount' => 'Update::StoryListChatCount', + 'updateStoryStealthMode' => 'Update::StoryStealthMode', + 'updateOption' => 'Update::Option', + 'updateStickerSet' => 'Update::StickerSet', + 'updateInstalledStickerSets' => 'Update::InstalledStickerSets', + 'updateTrendingStickerSets' => 'Update::TrendingStickerSets', + 'updateRecentStickers' => 'Update::RecentStickers', + 'updateFavoriteStickers' => 'Update::FavoriteStickers', + 'updateSavedAnimations' => 'Update::SavedAnimations', + 'updateSavedNotificationSounds' => 'Update::SavedNotificationSounds', + 'updateDefaultBackground' => 'Update::DefaultBackground', + 'updateChatThemes' => 'Update::ChatThemes', + 'updateAccentColors' => 'Update::AccentColors', + 'updateProfileAccentColors' => 'Update::ProfileAccentColors', + 'updateLanguagePackStrings' => 'Update::LanguagePackStrings', + 'updateConnectionState' => 'Update::ConnectionState', + 'updateTermsOfService' => 'Update::TermsOfService', + 'updateUsersNearby' => 'Update::UsersNearby', + 'updateUnconfirmedSession' => 'Update::UnconfirmedSession', + 'updateAttachmentMenuBots' => 'Update::AttachmentMenuBots', + 'updateWebAppMessageSent' => 'Update::WebAppMessageSent', + 'updateActiveEmojiReactions' => 'Update::ActiveEmojiReactions', + 'updateAvailableMessageEffects' => 'Update::AvailableMessageEffects', + 'updateDefaultReactionType' => 'Update::DefaultReactionType', + 'updateSavedMessagesTags' => 'Update::SavedMessagesTags', + 'updateActiveLiveLocationMessages' => 'Update::ActiveLiveLocationMessages', + 'updateOwnedStarCount' => 'Update::OwnedStarCount', + 'updateChatRevenueAmount' => 'Update::ChatRevenueAmount', + 'updateStarRevenueStatus' => 'Update::StarRevenueStatus', + 'updateSpeechRecognitionTrial' => 'Update::SpeechRecognitionTrial', + 'updateDiceEmojis' => 'Update::DiceEmojis', + 'updateAnimatedEmojiMessageClicked' => 'Update::AnimatedEmojiMessageClicked', + 'updateAnimationSearchParameters' => 'Update::AnimationSearchParameters', + 'updateSuggestedActions' => 'Update::SuggestedActions', + 'updateSpeedLimitNotification' => 'Update::SpeedLimitNotification', + 'updateContactCloseBirthdays' => 'Update::ContactCloseBirthdays', + 'updateAutosaveSettings' => 'Update::AutosaveSettings', + 'updateBusinessConnection' => 'Update::BusinessConnection', + 'updateNewBusinessMessage' => 'Update::NewBusinessMessage', + 'updateBusinessMessageEdited' => 'Update::BusinessMessageEdited', + 'updateBusinessMessagesDeleted' => 'Update::BusinessMessagesDeleted', + 'updateNewInlineQuery' => 'Update::NewInlineQuery', + 'updateNewChosenInlineResult' => 'Update::NewChosenInlineResult', + 'updateNewCallbackQuery' => 'Update::NewCallbackQuery', + 'updateNewInlineCallbackQuery' => 'Update::NewInlineCallbackQuery', + 'updateNewBusinessCallbackQuery' => 'Update::NewBusinessCallbackQuery', + 'updateNewShippingQuery' => 'Update::NewShippingQuery', + 'updateNewPreCheckoutQuery' => 'Update::NewPreCheckoutQuery', + 'updateNewCustomEvent' => 'Update::NewCustomEvent', + 'updateNewCustomQuery' => 'Update::NewCustomQuery', + 'updatePoll' => 'Update::Poll', + 'updatePollAnswer' => 'Update::PollAnswer', + 'updateChatMember' => 'Update::ChatMember', + 'updateNewChatJoinRequest' => 'Update::NewChatJoinRequest', + 'updateChatBoost' => 'Update::ChatBoost', + 'updateMessageReaction' => 'Update::MessageReaction', + 'updateMessageReactions' => 'Update::MessageReactions', + 'updates' => 'Updates', + 'LogStream' => 'LogStream', + 'logStreamDefault' => 'LogStream::Default', + 'logStreamFile' => 'LogStream::File', + 'logStreamEmpty' => 'LogStream::Empty', + 'logVerbosityLevel' => 'LogVerbosityLevel', + 'logTags' => 'LogTags', + 'userSupportInfo' => 'UserSupportInfo' }.freeze module_function @@ -1000,17 +1794,29 @@ def camelize(str) end %w[ + accent_color account_ttl + added_reaction + added_reactions address animated_chat_photo + animated_emoji animation animations + archive_chat_list_settings + attachment_menu_bot + attachment_menu_bot_color audio authentication_code_info authentication_code_type authorization_state auto_download_settings auto_download_settings_presets + autosave_settings + autosave_settings_exception + autosave_settings_scope + available_reaction + available_reactions background background_fill background_type @@ -1020,8 +1826,38 @@ def camelize(str) base basic_group basic_group_full_info + birthdate + block_list bot_command + bot_command_scope + bot_commands bot_info + bot_media_preview + bot_media_preview_info + bot_media_previews + bot_menu_button + bot_transaction_purpose + bot_write_access_allow_reason + business_away_message_schedule + business_away_message_settings + business_bot_manage_bar + business_chat_link + business_chat_link_info + business_chat_links + business_connected_bot + business_connection + business_feature + business_feature_promotion_animation + business_features + business_greeting_message_settings + business_info + business_location + business_message + business_messages + business_opening_hours + business_opening_hours_interval + business_recipients + business_start_page call call_discard_reason call_id @@ -1032,25 +1868,49 @@ def camelize(str) call_state callback_query_answer callback_query_payload + can_send_message_to_user_result + can_send_story_result can_transfer_ownership_result + channel_transaction_purpose chat chat_action chat_action_bar + chat_active_stories chat_administrator + chat_administrator_rights chat_administrators + chat_available_reactions + chat_background + chat_boost + chat_boost_features + chat_boost_level_features + chat_boost_link + chat_boost_link_info + chat_boost_slot + chat_boost_slots + chat_boost_source + chat_boost_status chat_event chat_event_action chat_event_log_filters chat_events - chat_filter - chat_filter_info + chat_folder + chat_folder_icon + chat_folder_info + chat_folder_invite_link + chat_folder_invite_link_info + chat_folder_invite_links chat_invite_link chat_invite_link_count chat_invite_link_counts chat_invite_link_info chat_invite_link_member chat_invite_link_members + chat_invite_link_subscription_info chat_invite_links + chat_join_request + chat_join_requests + chat_join_requests_info chat_list chat_lists chat_location @@ -1058,25 +1918,39 @@ def camelize(str) chat_member_status chat_members chat_members_filter + chat_message_sender + chat_message_senders chat_nearby chat_notification_settings chat_permissions chat_photo chat_photo_info + chat_photo_sticker + chat_photo_sticker_type chat_photos chat_position - chat_report_reason + chat_revenue_amount + chat_revenue_statistics + chat_revenue_transaction + chat_revenue_transaction_type + chat_revenue_transactions chat_source chat_statistics chat_statistics_administrator_actions_info + chat_statistics_interaction_info chat_statistics_inviter_info - chat_statistics_message_interaction_info chat_statistics_message_sender_info + chat_statistics_object_type + chat_theme chat_type chats chats_nearby check_chat_username_result + check_sticker_set_name_result + close_birthday_user closed_vector_path + collectible_item_info + collectible_item_type connected_website connected_websites connection_state @@ -1084,6 +1958,8 @@ def camelize(str) count countries country_info + created_basic_group_chat + current_weather custom_request_result database_statistics date @@ -1093,28 +1969,61 @@ def camelize(str) device_token dice_stickers document + downloaded_file_counts draft_message + email_address_authentication email_address_authentication_code_info + email_address_reset_state + emoji_categories + emoji_category + emoji_category_source + emoji_category_type + emoji_keyword + emoji_keywords + emoji_reaction + emoji_status + emoji_statuses emojis encrypted_credentials encrypted_passport_element error + fact_check + failed_to_add_member + failed_to_add_members file + file_download + file_downloaded_prefix_size file_part file_type + firebase_authentication_settings + firebase_device_verification_parameters formatted_text + forum_topic + forum_topic_icon + forum_topic_info + forum_topics + forward_source + found_chat_boosts + found_chat_messages + found_file_downloads found_messages + found_position + found_positions + found_stories + found_users + found_web_app game game_high_score game_high_scores group_call group_call_id - group_call_join_response - group_call_join_response_candidate group_call_participant - group_call_payload - group_call_payload_fingerprint + group_call_participant_video_info group_call_recent_speaker + group_call_stream + group_call_streams + group_call_video_quality + group_call_video_source_group hashtags http_url identity_document @@ -1123,19 +2032,34 @@ def camelize(str) inline_keyboard_button_type inline_query_result inline_query_results + inline_query_results_button + inline_query_results_button_type input_background + input_business_chat_link + input_business_start_page input_chat_photo input_credentials input_file input_identity_document input_inline_query_result + input_invoice input_message_content + input_message_reply_to + input_paid_media + input_paid_media_type input_passport_element input_passport_element_error input_passport_element_error_source input_personal_document input_sticker + input_story_area + input_story_area_type + input_story_areas + input_story_content + input_text_quote input_thumbnail + internal_link_type + invite_link_chat_type invoice json_object_member json_value @@ -1146,41 +2070,68 @@ def camelize(str) language_pack_string language_pack_string_value language_pack_strings + link_preview + link_preview_album_media + link_preview_options + link_preview_type local_file localization_target_info location + location_address log_stream log_tags log_verbosity_level login_url_info + main_web_app mask_point mask_position message + message_auto_delete_time + message_calendar + message_calendar_day message_content message_copy_options + message_effect + message_effect_type message_file_type message_forward_info - message_forward_origin + message_import_info message_interaction_info message_link message_link_info + message_origin + message_position + message_positions + message_properties + message_reaction + message_reactions + message_read_date message_reply_info + message_reply_to message_scheduling_state + message_self_destruct_type message_send_options message_sender message_senders message_sending_state + message_source + message_sponsor message_statistics message_thread_info + message_viewer + message_viewers messages minithumbnail network_statistics network_statistics_entry network_type + new_chat_privacy_settings notification notification_group notification_group_type notification_settings_scope + notification_sound + notification_sounds notification_type ok option_value @@ -1192,6 +2143,8 @@ def camelize(str) page_block_related_article page_block_table_cell page_block_vertical_alignment + paid_media + paid_reactor passport_authorization_form passport_element passport_element_error @@ -1203,13 +2156,16 @@ def camelize(str) passport_suitable_element password_state payment_form - payment_form_theme + payment_form_type + payment_option + payment_provider payment_receipt + payment_receipt_type payment_result - payments_provider_stripe personal_details personal_document phone_number_authentication_settings + phone_number_code_type phone_number_info photo photo_size @@ -1217,39 +2173,121 @@ def camelize(str) poll poll_option poll_type + premium_feature + premium_feature_promotion_animation + premium_features + premium_gift_code_info + premium_gift_code_payment_option + premium_gift_code_payment_options + premium_giveaway_info + premium_giveaway_parameters + premium_giveaway_participant_status + premium_limit + premium_limit_type + premium_payment_option + premium_source + premium_state + premium_state_payment_option + premium_story_feature + prepaid_premium_giveaway + product_info + profile_accent_color + profile_accent_colors profile_photo proxies proxy proxy_type public_chat_type + public_forward + public_forwards push_message_content push_receiver_id - recommended_chat_filter - recommended_chat_filters + quick_reply_message + quick_reply_messages + quick_reply_shortcut + reaction_notification_settings + reaction_notification_source + reaction_type + reaction_unavailability_reason + read_date_privacy_settings + recommended_chat_folder + recommended_chat_folders recovery_email_address remote_file reply_markup + report_chat_sponsored_message_option + report_chat_sponsored_message_result + report_reason + resend_code_reason + reset_password_result + revenue_withdrawal_state rich_text + rtmp_url saved_credentials + saved_messages_tag + saved_messages_tags + saved_messages_topic + saved_messages_topic_type + scope_autosave_settings scope_notification_settings search_messages_filter seconds secret_chat secret_chat_state + sent_web_app_message session + session_type sessions + shared_chat + shared_user shipping_option + speech_recognition_result + sponsored_message + sponsored_messages + star_payment_option + star_payment_options + star_revenue_statistics + star_revenue_status + star_subscription + star_subscription_pricing + star_subscriptions + star_transaction + star_transaction_direction + star_transaction_partner + star_transactions statistical_graph statistical_value sticker + sticker_format + sticker_full_type sticker_set sticker_set_info sticker_sets + sticker_type stickers storage_statistics storage_statistics_by_chat storage_statistics_by_file_type storage_statistics_fast + store_payment_purpose + stories + story + story_area + story_area_position + story_area_type + story_content + story_full_id + story_info + story_interaction + story_interaction_info + story_interaction_type + story_interactions + story_list + story_origin + story_privacy_settings + story_repost_info + story_statistics + story_video suggested_action supergroup supergroup_full_info @@ -1257,7 +2295,8 @@ def camelize(str) t_me_url t_me_url_type t_me_urls - tdlib_parameters + target_chat + telegram_payment_purpose temporary_password_state terms_of_service text @@ -1265,27 +2304,39 @@ def camelize(str) text_entity text_entity_type text_parse_mode + text_quote + theme_parameters + theme_settings thumbnail thumbnail_format + time_zone + time_zones top_chat_category + trending_sticker_sets + unconfirmed_session + unread_reaction update updates user user_full_info + user_link user_privacy_setting user_privacy_setting_rule user_privacy_setting_rules user_status + user_support_info user_type + usernames users validated_order_info vector_path_command venue video + video_chat video_note - voice_chat voice_note - web_page + web_app + web_app_info web_page_instant_view ].each do |type| autoload camelize(type), "tdlib/types/#{type}" diff --git a/lib/tdlib/types/accent_color.rb b/lib/tdlib/types/accent_color.rb new file mode 100644 index 00000000..4ded4ba1 --- /dev/null +++ b/lib/tdlib/types/accent_color.rb @@ -0,0 +1,21 @@ +module TD::Types + # Contains information about supported accent color for user/chat name, background of empty chat photo, replies to + # messages and link previews. + # + # @attr id [Integer] Accent color identifier. + # @attr built_in_accent_color_id [Integer] Identifier of a built-in color to use in places, where only one color is + # needed; 0-6. + # @attr light_theme_colors [Array] The list of 1-3 colors in RGB format, describing the accent color, as + # expected to be shown in light themes. + # @attr dark_theme_colors [Array] The list of 1-3 colors in RGB format, describing the accent color, as + # expected to be shown in dark themes. + # @attr min_channel_chat_boost_level [Integer] The minimum chat boost level required to use the color in a channel + # chat. + class AccentColor < Base + attribute :id, TD::Types::Coercible::Integer + attribute :built_in_accent_color_id, TD::Types::Coercible::Integer + attribute :light_theme_colors, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :dark_theme_colors, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :min_channel_chat_boost_level, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/account_ttl.rb b/lib/tdlib/types/account_ttl.rb index 38402fb6..1851e6d8 100644 --- a/lib/tdlib/types/account_ttl.rb +++ b/lib/tdlib/types/account_ttl.rb @@ -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 diff --git a/lib/tdlib/types/added_reaction.rb b/lib/tdlib/types/added_reaction.rb new file mode 100644 index 00000000..6a6dc156 --- /dev/null +++ b/lib/tdlib/types/added_reaction.rb @@ -0,0 +1,14 @@ +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. + # @attr is_outgoing [Boolean] True, if the reaction was added by the current user. + # @attr date [Integer] Point in time (Unix timestamp) when the reaction was added. + class AddedReaction < Base + attribute :type, TD::Types::ReactionType + attribute :sender_id, TD::Types::MessageSender + attribute :is_outgoing, TD::Types::Bool + attribute :date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/added_reactions.rb b/lib/tdlib/types/added_reactions.rb new file mode 100644 index 00000000..faf1d456 --- /dev/null +++ b/lib/tdlib/types/added_reactions.rb @@ -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] The list of added reactions. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then 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 diff --git a/lib/tdlib/types/animated_emoji.rb b/lib/tdlib/types/animated_emoji.rb new file mode 100644 index 00000000..d9e3f302 --- /dev/null +++ b/lib/tdlib/types/animated_emoji.rb @@ -0,0 +1,18 @@ +module TD::Types + # Describes an animated or custom representation of an emoji. + # + # @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, then it can have arbitrary format. + # @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.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 diff --git a/lib/tdlib/types/archive_chat_list_settings.rb b/lib/tdlib/types/archive_chat_list_settings.rb new file mode 100644 index 00000000..1300e0cc --- /dev/null +++ b/lib/tdlib/types/archive_chat_list_settings.rb @@ -0,0 +1,17 @@ +module TD::Types + # Contains settings for automatic moving of chats to and from the Archive chat lists. + # + # @attr archive_and_mute_new_chats_from_unknown_users [Boolean] True, if new chats from non-contacts will be + # automatically archived and muted. + # Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true. + # @attr keep_unmuted_chats_archived [Boolean] True, if unmuted chats will be kept in the Archive chat list when they + # get a new message. + # @attr keep_chats_from_folders_archived [Boolean] True, if unmuted chats, that are always included or pinned in a + # folder, will be kept in the Archive chat list when they get a new message. + # Ignored if keep_unmuted_chats_archived == true. + class ArchiveChatListSettings < Base + attribute :archive_and_mute_new_chats_from_unknown_users, TD::Types::Bool + attribute :keep_unmuted_chats_archived, TD::Types::Bool + attribute :keep_chats_from_folders_archived, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/attachment_menu_bot.rb b/lib/tdlib/types/attachment_menu_bot.rb new file mode 100644 index 00000000..d68c9b54 --- /dev/null +++ b/lib/tdlib/types/attachment_menu_bot.rb @@ -0,0 +1,67 @@ +module TD::Types + # Represents a bot, which can be added to attachment or side menu. + # + # @attr bot_user_id [Integer] User identifier of the bot. + # @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 request_write_access [Boolean] True, if the user must be asked for the permission to send messages to the + # bot. + # @attr is_added [Boolean] True, if the bot was explicitly added by the user. + # If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot + # must be added or removed. + # @attr show_in_attachment_menu [Boolean] True, if the bot must be shown in the attachment menu. + # @attr show_in_side_menu [Boolean] True, if the bot must be shown in the side menu. + # @attr show_disclaimer_in_side_menu [Boolean] True, if a disclaimer, why the bot is shown in the side menu, is + # needed. + # @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 icon for the bot in SVG format; may be null. + # @attr ios_static_icon [TD::Types::File, nil] Icon for the bot in SVG format for the official iOS app; may be null. + # @attr ios_animated_icon [TD::Types::File, nil] Icon for the bot in TGS format for the official iOS app; may be + # null. + # @attr ios_side_menu_icon [TD::Types::File, nil] Icon for the bot in PNG format for the official iOS app side menu; + # may be null. + # @attr android_icon [TD::Types::File, nil] Icon for the bot in TGS format for the official Android app; may be null. + # @attr android_side_menu_icon [TD::Types::File, nil] Icon for the bot in SVG format for the official Android app + # side menu; may be null. + # @attr macos_icon [TD::Types::File, nil] Icon for the bot in TGS format for the official native macOS app; may be + # null. + # @attr macos_side_menu_icon [TD::Types::File, nil] Icon for the bot in PNG format for the official macOS app side + # menu; 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 :request_write_access, TD::Types::Bool + attribute :is_added, TD::Types::Bool + attribute :show_in_attachment_menu, TD::Types::Bool + attribute :show_in_side_menu, TD::Types::Bool + attribute :show_disclaimer_in_side_menu, 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 :ios_side_menu_icon, TD::Types::File.optional.default(nil) + attribute :android_icon, TD::Types::File.optional.default(nil) + attribute :android_side_menu_icon, TD::Types::File.optional.default(nil) + attribute :macos_icon, TD::Types::File.optional.default(nil) + attribute :macos_side_menu_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 diff --git a/lib/tdlib/types/attachment_menu_bot_color.rb b/lib/tdlib/types/attachment_menu_bot_color.rb new file mode 100644 index 00000000..fd90ff1c --- /dev/null +++ b/lib/tdlib/types/attachment_menu_bot_color.rb @@ -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 diff --git a/lib/tdlib/types/audio.rb b/lib/tdlib/types/audio.rb index 23b3b5e1..b0507167 100644 --- a/lib/tdlib/types/audio.rb +++ b/lib/tdlib/types/audio.rb @@ -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 should 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] 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 @@ -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 diff --git a/lib/tdlib/types/authentication_code_info.rb b/lib/tdlib/types/authentication_code_info.rb index d795fa09..99dfe2f8 100644 --- a/lib/tdlib/types/authentication_code_info.rb +++ b/lib/tdlib/types/authentication_code_info.rb @@ -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 diff --git a/lib/tdlib/types/authentication_code_type.rb b/lib/tdlib/types/authentication_code_type.rb index f4ce5226..5f51f396 100644 --- a/lib/tdlib/types/authentication_code_type.rb +++ b/lib/tdlib/types/authentication_code_type.rb @@ -4,8 +4,14 @@ class AuthenticationCodeType < Base %w[ telegram_message sms + sms_word + sms_phrase call flash_call + missed_call + fragment + firebase_android + firebase_ios ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/authentication_code_type/#{type}" end diff --git a/lib/tdlib/types/authentication_code_type/call.rb b/lib/tdlib/types/authentication_code_type/call.rb index 37270787..0766f8ac 100644 --- a/lib/tdlib/types/authentication_code_type/call.rb +++ b/lib/tdlib/types/authentication_code_type/call.rb @@ -1,5 +1,5 @@ module TD::Types - # An authentication code is delivered via a phone call to the specified phone number. + # A digit-only authentication code is delivered via a phone call to the specified phone number. # # @attr length [Integer] Length of the code. class AuthenticationCodeType::Call < AuthenticationCodeType diff --git a/lib/tdlib/types/authentication_code_type/firebase_android.rb b/lib/tdlib/types/authentication_code_type/firebase_android.rb new file mode 100644 index 00000000..2026a279 --- /dev/null +++ b/lib/tdlib/types/authentication_code_type/firebase_android.rb @@ -0,0 +1,11 @@ +module TD::Types + # A digit-only authentication code is delivered via Firebase Authentication to the official Android application. + # + # @attr device_verification_parameters [TD::Types::FirebaseDeviceVerificationParameters] Parameters to be used for + # device verification. + # @attr length [Integer] Length of the code. + class AuthenticationCodeType::FirebaseAndroid < AuthenticationCodeType + attribute :device_verification_parameters, TD::Types::FirebaseDeviceVerificationParameters + attribute :length, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/authentication_code_type/firebase_ios.rb b/lib/tdlib/types/authentication_code_type/firebase_ios.rb new file mode 100644 index 00000000..1f36b18d --- /dev/null +++ b/lib/tdlib/types/authentication_code_type/firebase_ios.rb @@ -0,0 +1,14 @@ +module TD::Types + # A digit-only authentication code is delivered via Firebase Authentication to the official iOS application. + # + # @attr receipt [TD::Types::String] Receipt of successful application token validation to compare with receipt from + # push notification. + # @attr push_timeout [Integer] Time after the next authentication method is supposed to be used if verification push + # notification isn't received, in seconds. + # @attr length [Integer] Length of the code. + class AuthenticationCodeType::FirebaseIos < AuthenticationCodeType + attribute :receipt, TD::Types::String + attribute :push_timeout, TD::Types::Coercible::Integer + attribute :length, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/authentication_code_type/flash_call.rb b/lib/tdlib/types/authentication_code_type/flash_call.rb index 1a4f75b1..58fd4136 100644 --- a/lib/tdlib/types/authentication_code_type/flash_call.rb +++ b/lib/tdlib/types/authentication_code_type/flash_call.rb @@ -1,6 +1,6 @@ module TD::Types - # An authentication code is delivered by an immediately cancelled call to the specified phone number. - # The number from which the call was made is the code. + # An authentication code is delivered by an immediately canceled call to the specified phone number. + # 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 diff --git a/lib/tdlib/types/authentication_code_type/fragment.rb b/lib/tdlib/types/authentication_code_type/fragment.rb new file mode 100644 index 00000000..14016747 --- /dev/null +++ b/lib/tdlib/types/authentication_code_type/fragment.rb @@ -0,0 +1,11 @@ +module TD::Types + # A digit-only 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 diff --git a/lib/tdlib/types/authentication_code_type/missed_call.rb b/lib/tdlib/types/authentication_code_type/missed_call.rb new file mode 100644 index 00000000..68b20275 --- /dev/null +++ b/lib/tdlib/types/authentication_code_type/missed_call.rb @@ -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 diff --git a/lib/tdlib/types/authentication_code_type/sms.rb b/lib/tdlib/types/authentication_code_type/sms.rb index 63335d1d..ab4f68f0 100644 --- a/lib/tdlib/types/authentication_code_type/sms.rb +++ b/lib/tdlib/types/authentication_code_type/sms.rb @@ -1,5 +1,6 @@ module TD::Types - # An authentication code is delivered via an SMS message to the specified phone number. + # A digit-only authentication code is delivered via an SMS message to the specified phone number; non-official + # applications may not receive this type of code. # # @attr length [Integer] Length of the code. class AuthenticationCodeType::Sms < AuthenticationCodeType diff --git a/lib/tdlib/types/authentication_code_type/sms_phrase.rb b/lib/tdlib/types/authentication_code_type/sms_phrase.rb new file mode 100644 index 00000000..f15ad30b --- /dev/null +++ b/lib/tdlib/types/authentication_code_type/sms_phrase.rb @@ -0,0 +1,9 @@ +module TD::Types + # An authentication code is a phrase from multiple words delivered via an SMS message to the specified phone number; + # non-official applications may not receive this type of code. + # + # @attr first_word [TD::Types::String] The first word of the phrase if known. + class AuthenticationCodeType::SmsPhrase < AuthenticationCodeType + attribute :first_word, TD::Types::String + end +end diff --git a/lib/tdlib/types/authentication_code_type/sms_word.rb b/lib/tdlib/types/authentication_code_type/sms_word.rb new file mode 100644 index 00000000..0d76c7d2 --- /dev/null +++ b/lib/tdlib/types/authentication_code_type/sms_word.rb @@ -0,0 +1,9 @@ +module TD::Types + # An authentication code is a word delivered via an SMS message to the specified phone number; non-official + # applications may not receive this type of code. + # + # @attr first_letter [TD::Types::String] The first letters of the word if known. + class AuthenticationCodeType::SmsWord < AuthenticationCodeType + attribute :first_letter, TD::Types::String + end +end diff --git a/lib/tdlib/types/authentication_code_type/telegram_message.rb b/lib/tdlib/types/authentication_code_type/telegram_message.rb index 2de53f24..d7b4c4da 100644 --- a/lib/tdlib/types/authentication_code_type/telegram_message.rb +++ b/lib/tdlib/types/authentication_code_type/telegram_message.rb @@ -1,6 +1,6 @@ module TD::Types - # An authentication code is delivered via a private Telegram message, which can be viewed from another active - # session. + # A digit-only authentication code is delivered via a private Telegram message, which can be viewed from another + # active session. # # @attr length [Integer] Length of the code. class AuthenticationCodeType::TelegramMessage < AuthenticationCodeType diff --git a/lib/tdlib/types/authorization_state.rb b/lib/tdlib/types/authorization_state.rb index 078d4e64..d091e0f8 100644 --- a/lib/tdlib/types/authorization_state.rb +++ b/lib/tdlib/types/authorization_state.rb @@ -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 diff --git a/lib/tdlib/types/authorization_state/closed.rb b/lib/tdlib/types/authorization_state/closed.rb index e2f190da..c553e22f 100644 --- a/lib/tdlib/types/authorization_state/closed.rb +++ b/lib/tdlib/types/authorization_state/closed.rb @@ -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 diff --git a/lib/tdlib/types/authorization_state/ready.rb b/lib/tdlib/types/authorization_state/ready.rb index 2d776473..39b27cbb 100644 --- a/lib/tdlib/types/authorization_state/ready.rb +++ b/lib/tdlib/types/authorization_state/ready.rb @@ -1,6 +1,6 @@ module TD::Types # The user has been successfully authorized. - # TDLib is now ready to answer queries. + # TDLib is now ready to answer general requests. class AuthorizationState::Ready < AuthorizationState end end diff --git a/lib/tdlib/types/authorization_state/wait_code.rb b/lib/tdlib/types/authorization_state/wait_code.rb index a42734b9..cba9ab14 100644 --- a/lib/tdlib/types/authorization_state/wait_code.rb +++ b/lib/tdlib/types/authorization_state/wait_code.rb @@ -1,5 +1,6 @@ module TD::Types # TDLib needs the user's authentication code to authorize. + # Call checkAuthenticationCode to check the code. # # @attr code_info [TD::Types::AuthenticationCodeInfo] Information about the authorization code that was sent. class AuthorizationState::WaitCode < AuthorizationState diff --git a/lib/tdlib/types/authorization_state/wait_email_address.rb b/lib/tdlib/types/authorization_state/wait_email_address.rb new file mode 100644 index 00000000..e6fd86d6 --- /dev/null +++ b/lib/tdlib/types/authorization_state/wait_email_address.rb @@ -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 diff --git a/lib/tdlib/types/authorization_state/wait_email_code.rb b/lib/tdlib/types/authorization_state/wait_email_code.rb new file mode 100644 index 00000000..06297f8a --- /dev/null +++ b/lib/tdlib/types/authorization_state/wait_email_code.rb @@ -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 email_address_reset_state [TD::Types::EmailAddressResetState, nil] Reset state of the email address; may be + # null if the email address can't be reset. + 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 :email_address_reset_state, TD::Types::EmailAddressResetState.optional.default(nil) + end +end diff --git a/lib/tdlib/types/authorization_state/wait_encryption_key.rb b/lib/tdlib/types/authorization_state/wait_encryption_key.rb deleted file mode 100644 index f4aef82a..00000000 --- a/lib/tdlib/types/authorization_state/wait_encryption_key.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # TDLib needs an encryption key to decrypt the local database. - # - # @attr is_encrypted [Boolean] True, if the database is currently encrypted. - class AuthorizationState::WaitEncryptionKey < AuthorizationState - attribute :is_encrypted, TD::Types::Bool - end -end diff --git a/lib/tdlib/types/authorization_state/wait_password.rb b/lib/tdlib/types/authorization_state/wait_password.rb index 4764700d..b5ab202c 100644 --- a/lib/tdlib/types/authorization_state/wait_password.rb +++ b/lib/tdlib/types/authorization_state/wait_password.rb @@ -1,13 +1,17 @@ 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. + # Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the + # password, or deleteAccount to delete the account after a week. # # @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. + # @attr has_passport_data [Boolean] True, if some Telegram Passport elements were saved. # @attr recovery_email_address_pattern [TD::Types::String, nil] Pattern of the email address to which the recovery # email was sent; empty until a recovery email has been sent. class AuthorizationState::WaitPassword < AuthorizationState attribute :password_hint, TD::Types::String.optional.default(nil) attribute :has_recovery_email_address, TD::Types::Bool + attribute :has_passport_data, TD::Types::Bool attribute :recovery_email_address_pattern, TD::Types::String.optional.default(nil) end end diff --git a/lib/tdlib/types/authorization_state/wait_phone_number.rb b/lib/tdlib/types/authorization_state/wait_phone_number.rb index 962ede32..31d1e45a 100644 --- a/lib/tdlib/types/authorization_state/wait_phone_number.rb +++ b/lib/tdlib/types/authorization_state/wait_phone_number.rb @@ -1,7 +1,7 @@ module TD::Types # TDLib needs the user's phone number to authorize. - # Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or - # `checkAuthenticationBotToken` for other authentication options. + # Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or + # checkAuthenticationBotToken for other authentication options. class AuthorizationState::WaitPhoneNumber < AuthorizationState end end diff --git a/lib/tdlib/types/authorization_state/wait_registration.rb b/lib/tdlib/types/authorization_state/wait_registration.rb index f543d02c..5bf21ea0 100644 --- a/lib/tdlib/types/authorization_state/wait_registration.rb +++ b/lib/tdlib/types/authorization_state/wait_registration.rb @@ -1,6 +1,7 @@ module TD::Types # The user is unregistered and need to accept terms of service and enter their first name and last name to finish # registration. + # Call registerUser to accept the terms of service and provide the data. # # @attr terms_of_service [TD::Types::TermsOfService] Telegram terms of service. class AuthorizationState::WaitRegistration < AuthorizationState diff --git a/lib/tdlib/types/authorization_state/wait_tdlib_parameters.rb b/lib/tdlib/types/authorization_state/wait_tdlib_parameters.rb index e61f8cb0..ecaaae28 100644 --- a/lib/tdlib/types/authorization_state/wait_tdlib_parameters.rb +++ b/lib/tdlib/types/authorization_state/wait_tdlib_parameters.rb @@ -1,5 +1,6 @@ module TD::Types - # TDLib needs TdlibParameters for initialization. + # Initialization parameters are needed. + # Call setTdlibParameters to provide them. class AuthorizationState::WaitTdlibParameters < AuthorizationState end end diff --git a/lib/tdlib/types/auto_download_settings.rb b/lib/tdlib/types/auto_download_settings.rb index 66d74acf..db443c8c 100644 --- a/lib/tdlib/types/auto_download_settings.rb +++ b/lib/tdlib/types/auto_download_settings.rb @@ -2,14 +2,15 @@ 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 # to an audio file. + # @attr preload_stories [Boolean] True, if stories needs to be preloaded. # @attr use_less_data_for_calls [Boolean] True, if "use less data for calls" option needs to be enabled. class AutoDownloadSettings < Base attribute :is_auto_download_enabled, TD::Types::Bool @@ -19,6 +20,7 @@ class AutoDownloadSettings < Base attribute :video_upload_bitrate, TD::Types::Coercible::Integer attribute :preload_large_videos, TD::Types::Bool attribute :preload_next_audio, TD::Types::Bool + attribute :preload_stories, TD::Types::Bool attribute :use_less_data_for_calls, TD::Types::Bool end end diff --git a/lib/tdlib/types/auto_download_settings_presets.rb b/lib/tdlib/types/auto_download_settings_presets.rb index 99e9ea0e..fda55531 100644 --- a/lib/tdlib/types/auto_download_settings_presets.rb +++ b/lib/tdlib/types/auto_download_settings_presets.rb @@ -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. diff --git a/lib/tdlib/types/autosave_settings.rb b/lib/tdlib/types/autosave_settings.rb new file mode 100644 index 00000000..9ab58b12 --- /dev/null +++ b/lib/tdlib/types/autosave_settings.rb @@ -0,0 +1,15 @@ +module TD::Types + # Describes autosave settings. + # + # @attr private_chat_settings [TD::Types::ScopeAutosaveSettings] Default autosave settings for private chats. + # @attr group_settings [TD::Types::ScopeAutosaveSettings] Default autosave settings for basic group and supergroup + # chats. + # @attr channel_settings [TD::Types::ScopeAutosaveSettings] Default autosave settings for channel chats. + # @attr exceptions [Array] Autosave settings for specific chats. + class AutosaveSettings < Base + attribute :private_chat_settings, TD::Types::ScopeAutosaveSettings + attribute :group_settings, TD::Types::ScopeAutosaveSettings + attribute :channel_settings, TD::Types::ScopeAutosaveSettings + attribute :exceptions, TD::Types::Array.of(TD::Types::AutosaveSettingsException) + end +end diff --git a/lib/tdlib/types/autosave_settings_exception.rb b/lib/tdlib/types/autosave_settings_exception.rb new file mode 100644 index 00000000..c3202456 --- /dev/null +++ b/lib/tdlib/types/autosave_settings_exception.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains autosave settings for a chat, which overrides default settings for the corresponding scope. + # + # @attr chat_id [Integer] Chat identifier. + # @attr settings [TD::Types::ScopeAutosaveSettings] Autosave settings for the chat. + class AutosaveSettingsException < Base + attribute :chat_id, TD::Types::Coercible::Integer + attribute :settings, TD::Types::ScopeAutosaveSettings + end +end diff --git a/lib/tdlib/types/autosave_settings_scope.rb b/lib/tdlib/types/autosave_settings_scope.rb new file mode 100644 index 00000000..19ec523e --- /dev/null +++ b/lib/tdlib/types/autosave_settings_scope.rb @@ -0,0 +1,13 @@ +module TD::Types + # Describes scope of autosave settings. + class AutosaveSettingsScope < Base + %w[ + private_chats + group_chats + channel_chats + chat + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/autosave_settings_scope/#{type}" + end + end +end diff --git a/lib/tdlib/types/autosave_settings_scope/channel_chats.rb b/lib/tdlib/types/autosave_settings_scope/channel_chats.rb new file mode 100644 index 00000000..07b68b9b --- /dev/null +++ b/lib/tdlib/types/autosave_settings_scope/channel_chats.rb @@ -0,0 +1,5 @@ +module TD::Types + # Autosave settings applied to all channel chats without chat-specific settings. + class AutosaveSettingsScope::ChannelChats < AutosaveSettingsScope + end +end diff --git a/lib/tdlib/types/autosave_settings_scope/chat.rb b/lib/tdlib/types/autosave_settings_scope/chat.rb new file mode 100644 index 00000000..e5372191 --- /dev/null +++ b/lib/tdlib/types/autosave_settings_scope/chat.rb @@ -0,0 +1,8 @@ +module TD::Types + # Autosave settings applied to a chat. + # + # @attr chat_id [Integer] Chat identifier. + class AutosaveSettingsScope::Chat < AutosaveSettingsScope + attribute :chat_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/autosave_settings_scope/group_chats.rb b/lib/tdlib/types/autosave_settings_scope/group_chats.rb new file mode 100644 index 00000000..a2c9d97d --- /dev/null +++ b/lib/tdlib/types/autosave_settings_scope/group_chats.rb @@ -0,0 +1,5 @@ +module TD::Types + # Autosave settings applied to all basic group and supergroup chats without chat-specific settings. + class AutosaveSettingsScope::GroupChats < AutosaveSettingsScope + end +end diff --git a/lib/tdlib/types/autosave_settings_scope/private_chats.rb b/lib/tdlib/types/autosave_settings_scope/private_chats.rb new file mode 100644 index 00000000..9cd880af --- /dev/null +++ b/lib/tdlib/types/autosave_settings_scope/private_chats.rb @@ -0,0 +1,5 @@ +module TD::Types + # Autosave settings applied to all private chats without chat-specific settings. + class AutosaveSettingsScope::PrivateChats < AutosaveSettingsScope + end +end diff --git a/lib/tdlib/types/available_reaction.rb b/lib/tdlib/types/available_reaction.rb new file mode 100644 index 00000000..ad37b82e --- /dev/null +++ b/lib/tdlib/types/available_reaction.rb @@ -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 diff --git a/lib/tdlib/types/available_reactions.rb b/lib/tdlib/types/available_reactions.rb new file mode 100644 index 00000000..ab224acd --- /dev/null +++ b/lib/tdlib/types/available_reactions.rb @@ -0,0 +1,19 @@ +module TD::Types + # Represents a list of reactions that can be added to a message. + # + # @attr top_reactions [Array] List of reactions to be shown at the top. + # @attr recent_reactions [Array] List of recently used reactions. + # @attr popular_reactions [Array] List of popular reactions. + # @attr allow_custom_emoji [Boolean] True, if any custom emoji reaction can be added by Telegram Premium subscribers. + # @attr are_tags [Boolean] True, if the reactions will be tags and the message can be found by them. + # @attr unavailability_reason [TD::Types::ReactionUnavailabilityReason, nil] The reason why the current user can't + # add reactions to the message, despite some other users can; may be null if none. + 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 + attribute :are_tags, TD::Types::Bool + attribute :unavailability_reason, TD::Types::ReactionUnavailabilityReason.optional.default(nil) + end +end diff --git a/lib/tdlib/types/background.rb b/lib/tdlib/types/background.rb index ab5bb0f6..e6b77556 100644 --- a/lib/tdlib/types/background.rb +++ b/lib/tdlib/types/background.rb @@ -6,7 +6,7 @@ module TD::Types # @attr is_dark [Boolean] True, if the background is dark and is recommended to be used with dark theme. # @attr name [TD::Types::String] Unique background name. # @attr document [TD::Types::Document, nil] Document with the background; may be null. - # Null only for filled backgrounds. + # Null only for filled and chat theme backgrounds. # @attr type [TD::Types::BackgroundType] Type of the background. class Background < Base attribute :id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/background_fill.rb b/lib/tdlib/types/background_fill.rb index 2c47d37b..609ceec7 100644 --- a/lib/tdlib/types/background_fill.rb +++ b/lib/tdlib/types/background_fill.rb @@ -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 diff --git a/lib/tdlib/types/background_fill/freeform_gradient.rb b/lib/tdlib/types/background_fill/freeform_gradient.rb new file mode 100644 index 00000000..ab2fcb16 --- /dev/null +++ b/lib/tdlib/types/background_fill/freeform_gradient.rb @@ -0,0 +1,8 @@ +module TD::Types + # Describes a freeform gradient fill of a background. + # + # @attr colors [Array] A list of 3 or 4 colors of the freeform gradient in the RGB24 format. + class BackgroundFill::FreeformGradient < BackgroundFill + attribute :colors, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/background_fill/gradient.rb b/lib/tdlib/types/background_fill/gradient.rb index 52afba3d..5de2f6ec 100644 --- a/lib/tdlib/types/background_fill/gradient.rb +++ b/lib/tdlib/types/background_fill/gradient.rb @@ -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 always be divisible by 45. class BackgroundFill::Gradient < BackgroundFill attribute :top_color, TD::Types::Coercible::Integer attribute :bottom_color, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/background_type.rb b/lib/tdlib/types/background_type.rb index 50c97c6e..bf51ca0e 100644 --- a/lib/tdlib/types/background_type.rb +++ b/lib/tdlib/types/background_type.rb @@ -1,10 +1,11 @@ module TD::Types - # Describes the type of a background. + # Describes the type of background. class BackgroundType < Base %w[ wallpaper pattern fill + chat_theme ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/background_type/#{type}" end diff --git a/lib/tdlib/types/background_type/chat_theme.rb b/lib/tdlib/types/background_type/chat_theme.rb new file mode 100644 index 00000000..2a21d1e4 --- /dev/null +++ b/lib/tdlib/types/background_type/chat_theme.rb @@ -0,0 +1,8 @@ +module TD::Types + # A background from a chat theme; can be used only as a chat background in channels. + # + # @attr theme_name [TD::Types::String] Name of the chat theme. + class BackgroundType::ChatTheme < BackgroundType + attribute :theme_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/background_type/fill.rb b/lib/tdlib/types/background_type/fill.rb index 0c0644a8..bdec6928 100644 --- a/lib/tdlib/types/background_type/fill.rb +++ b/lib/tdlib/types/background_type/fill.rb @@ -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 diff --git a/lib/tdlib/types/background_type/pattern.rb b/lib/tdlib/types/background_type/pattern.rb index 589e7898..5b65499a 100644 --- a/lib/tdlib/types/background_type/pattern.rb +++ b/lib/tdlib/types/background_type/pattern.rb @@ -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 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 diff --git a/lib/tdlib/types/basic_group_full_info.rb b/lib/tdlib/types/basic_group_full_info.rb index 04a7622f..0b3efac5 100644 --- a/lib/tdlib/types/basic_group_full_info.rb +++ b/lib/tdlib/types/basic_group_full_info.rb @@ -1,19 +1,28 @@ 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. # @attr members [Array] Group members. + # @attr can_hide_members [Boolean] True, if non-administrators and non-bots can be hidden in responses to + # getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup. + # @attr can_toggle_aggressive_anti_spam [Boolean] True, if aggressive anti-spam checks can be enabled or disabled in + # the supergroup after upgrading the basic group to a supergroup. # @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] 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 :can_hide_members, TD::Types::Bool + attribute :can_toggle_aggressive_anti_spam, TD::Types::Bool attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil) + attribute :bot_commands, TD::Types::Array.of(TD::Types::BotCommands) end end diff --git a/lib/tdlib/types/birthdate.rb b/lib/tdlib/types/birthdate.rb new file mode 100644 index 00000000..f6bf749b --- /dev/null +++ b/lib/tdlib/types/birthdate.rb @@ -0,0 +1,12 @@ +module TD::Types + # Represents a birthdate of a user. + # + # @attr day [Integer] Day of the month; 1-31. + # @attr month [Integer] Month of the year; 1-12. + # @attr year [Integer] Birth year; 0 if unknown. + class Birthdate < Base + attribute :day, TD::Types::Coercible::Integer + attribute :month, TD::Types::Coercible::Integer + attribute :year, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/block_list.rb b/lib/tdlib/types/block_list.rb new file mode 100644 index 00000000..410d2db7 --- /dev/null +++ b/lib/tdlib/types/block_list.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes type of block list. + class BlockList < Base + %w[ + main + stories + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/block_list/#{type}" + end + end +end diff --git a/lib/tdlib/types/block_list/main.rb b/lib/tdlib/types/block_list/main.rb new file mode 100644 index 00000000..f447d453 --- /dev/null +++ b/lib/tdlib/types/block_list/main.rb @@ -0,0 +1,6 @@ +module TD::Types + # The main block list that disallows writing messages to the current user, receiving their status and photo, viewing + # of stories, and some other actions. + class BlockList::Main < BlockList + end +end diff --git a/lib/tdlib/types/block_list/stories.rb b/lib/tdlib/types/block_list/stories.rb new file mode 100644 index 00000000..32090a88 --- /dev/null +++ b/lib/tdlib/types/block_list/stories.rb @@ -0,0 +1,5 @@ +module TD::Types + # The block list that disallows viewing of stories of the current user. + class BlockList::Stories < BlockList + end +end diff --git a/lib/tdlib/types/bot_command_scope.rb b/lib/tdlib/types/bot_command_scope.rb new file mode 100644 index 00000000..2c8ba72e --- /dev/null +++ b/lib/tdlib/types/bot_command_scope.rb @@ -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 diff --git a/lib/tdlib/types/bot_command_scope/all_chat_administrators.rb b/lib/tdlib/types/bot_command_scope/all_chat_administrators.rb new file mode 100644 index 00000000..df849722 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/all_chat_administrators.rb @@ -0,0 +1,5 @@ +module TD::Types + # A scope covering all group and supergroup chat administrators. + class BotCommandScope::AllChatAdministrators < BotCommandScope + end +end diff --git a/lib/tdlib/types/bot_command_scope/all_group_chats.rb b/lib/tdlib/types/bot_command_scope/all_group_chats.rb new file mode 100644 index 00000000..f93919f0 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/all_group_chats.rb @@ -0,0 +1,5 @@ +module TD::Types + # A scope covering all group and supergroup chats. + class BotCommandScope::AllGroupChats < BotCommandScope + end +end diff --git a/lib/tdlib/types/bot_command_scope/all_private_chats.rb b/lib/tdlib/types/bot_command_scope/all_private_chats.rb new file mode 100644 index 00000000..dcd226fa --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/all_private_chats.rb @@ -0,0 +1,5 @@ +module TD::Types + # A scope covering all private chats. + class BotCommandScope::AllPrivateChats < BotCommandScope + end +end diff --git a/lib/tdlib/types/bot_command_scope/chat.rb b/lib/tdlib/types/bot_command_scope/chat.rb new file mode 100644 index 00000000..4355c451 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/chat.rb @@ -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 diff --git a/lib/tdlib/types/bot_command_scope/chat_administrators.rb b/lib/tdlib/types/bot_command_scope/chat_administrators.rb new file mode 100644 index 00000000..60807522 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/chat_administrators.rb @@ -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 diff --git a/lib/tdlib/types/bot_command_scope/chat_member.rb b/lib/tdlib/types/bot_command_scope/chat_member.rb new file mode 100644 index 00000000..f52bac4c --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/chat_member.rb @@ -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 diff --git a/lib/tdlib/types/bot_command_scope/default.rb b/lib/tdlib/types/bot_command_scope/default.rb new file mode 100644 index 00000000..a235c604 --- /dev/null +++ b/lib/tdlib/types/bot_command_scope/default.rb @@ -0,0 +1,5 @@ +module TD::Types + # A scope covering all users. + class BotCommandScope::Default < BotCommandScope + end +end diff --git a/lib/tdlib/types/bot_commands.rb b/lib/tdlib/types/bot_commands.rb new file mode 100644 index 00000000..3ec6ec31 --- /dev/null +++ b/lib/tdlib/types/bot_commands.rb @@ -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] 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 diff --git a/lib/tdlib/types/bot_info.rb b/lib/tdlib/types/bot_info.rb index 288988b4..3ce47d22 100644 --- a/lib/tdlib/types/bot_info.rb +++ b/lib/tdlib/types/bot_info.rb @@ -1,10 +1,45 @@ module TD::Types - # Provides information about a bot and its supported commands. + # Contains information about a bot. # - # @attr description [TD::Types::String] Long description shown on the user info page. - # @attr commands [Array] A list of commands supported by the bot. + # @attr short_description [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] List of the bot commands. + # @attr privacy_policy_url [TD::Types::String] The HTTP link to the privacy policy of the bot. + # If empty, then /privacy command must be used if supported by the bot. + # If the command isn't supported, then https://telegram.org/privacy-tpa must be opened. + # @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. + # @attr has_media_previews [Boolean] True, if the bot has media previews. + # @attr edit_commands_link [TD::Types::InternalLinkType, nil] The internal link, which can be used to edit bot + # commands; may be null. + # @attr edit_description_link [TD::Types::InternalLinkType, nil] The internal link, which can be used to edit bot + # description; may be null. + # @attr edit_description_media_link [TD::Types::InternalLinkType, nil] The internal link, which can be used to edit + # the photo or animation shown in the chat with the bot if the chat is empty; may be null. + # @attr edit_settings_link [TD::Types::InternalLinkType, nil] The internal link, which can be used to edit bot + # settings; may be null. class BotInfo < Base + attribute :short_description, 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 :privacy_policy_url, TD::Types::String + attribute :default_group_administrator_rights, TD::Types::ChatAdministratorRights.optional.default(nil) + attribute :default_channel_administrator_rights, TD::Types::ChatAdministratorRights.optional.default(nil) + attribute :has_media_previews, TD::Types::Bool + attribute :edit_commands_link, TD::Types::InternalLinkType.optional.default(nil) + attribute :edit_description_link, TD::Types::InternalLinkType.optional.default(nil) + attribute :edit_description_media_link, TD::Types::InternalLinkType.optional.default(nil) + attribute :edit_settings_link, TD::Types::InternalLinkType.optional.default(nil) end end diff --git a/lib/tdlib/types/bot_media_preview.rb b/lib/tdlib/types/bot_media_preview.rb new file mode 100644 index 00000000..7e245bbf --- /dev/null +++ b/lib/tdlib/types/bot_media_preview.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes media previews of a bot. + # + # @attr date [Integer] Point in time (Unix timestamp) when the preview was added or changed last time. + # @attr content [TD::Types::StoryContent] Content of the preview. + class BotMediaPreview < Base + attribute :date, TD::Types::Coercible::Integer + attribute :content, TD::Types::StoryContent + end +end diff --git a/lib/tdlib/types/bot_media_preview_info.rb b/lib/tdlib/types/bot_media_preview_info.rb new file mode 100644 index 00000000..7146e7fb --- /dev/null +++ b/lib/tdlib/types/bot_media_preview_info.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains a list of media previews of a bot for the given language and the list of languages for which the bot has + # dedicated previews. + # + # @attr previews [Array] List of media previews. + # @attr language_codes [Array] List of language codes for which the bot has dedicated previews. + class BotMediaPreviewInfo < Base + attribute :previews, TD::Types::Array.of(TD::Types::BotMediaPreview) + attribute :language_codes, TD::Types::Array.of(TD::Types::String) + end +end diff --git a/lib/tdlib/types/bot_media_previews.rb b/lib/tdlib/types/bot_media_previews.rb new file mode 100644 index 00000000..2a4a41b7 --- /dev/null +++ b/lib/tdlib/types/bot_media_previews.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of media previews of a bot. + # + # @attr previews [Array] List of media previews. + class BotMediaPreviews < Base + attribute :previews, TD::Types::Array.of(TD::Types::BotMediaPreview) + end +end diff --git a/lib/tdlib/types/bot_menu_button.rb b/lib/tdlib/types/bot_menu_button.rb new file mode 100644 index 00000000..0fdee101 --- /dev/null +++ b/lib/tdlib/types/bot_menu_button.rb @@ -0,0 +1,12 @@ +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 of a Web App to open when the button is pressed. + # If the link is of the type internalLinkTypeWebApp, then it must be processed accordingly. + # Otherwise, the link must be passed to openWebApp. + class BotMenuButton < Base + attribute :text, TD::Types::String + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/bot_transaction_purpose.rb b/lib/tdlib/types/bot_transaction_purpose.rb new file mode 100644 index 00000000..5868ce6b --- /dev/null +++ b/lib/tdlib/types/bot_transaction_purpose.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes purpose of a transaction with a bot. + class BotTransactionPurpose < Base + %w[ + paid_media + invoice_payment + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/bot_transaction_purpose/#{type}" + end + end +end diff --git a/lib/tdlib/types/bot_transaction_purpose/invoice_payment.rb b/lib/tdlib/types/bot_transaction_purpose/invoice_payment.rb new file mode 100644 index 00000000..2532058c --- /dev/null +++ b/lib/tdlib/types/bot_transaction_purpose/invoice_payment.rb @@ -0,0 +1,11 @@ +module TD::Types + # User bought a product from the bot. + # + # @attr product_info [TD::Types::ProductInfo, nil] Information about the bought product; may be null if not + # applicable. + # @attr invoice_payload [String] Invoice payload; for bots only. + class BotTransactionPurpose::InvoicePayment < BotTransactionPurpose + attribute :product_info, TD::Types::ProductInfo.optional.default(nil) + attribute :invoice_payload, TD::Types::Coercible::String + end +end diff --git a/lib/tdlib/types/bot_transaction_purpose/paid_media.rb b/lib/tdlib/types/bot_transaction_purpose/paid_media.rb new file mode 100644 index 00000000..85626787 --- /dev/null +++ b/lib/tdlib/types/bot_transaction_purpose/paid_media.rb @@ -0,0 +1,8 @@ +module TD::Types + # Paid media were bought. + # + # @attr media [Array] The bought media if the trancastion wasn't refunded. + class BotTransactionPurpose::PaidMedia < BotTransactionPurpose + attribute :media, TD::Types::Array.of(TD::Types::PaidMedia) + end +end diff --git a/lib/tdlib/types/bot_write_access_allow_reason.rb b/lib/tdlib/types/bot_write_access_allow_reason.rb new file mode 100644 index 00000000..a2cb80c8 --- /dev/null +++ b/lib/tdlib/types/bot_write_access_allow_reason.rb @@ -0,0 +1,13 @@ +module TD::Types + # Describes a reason why a bot was allowed to write messages to the current user. + class BotWriteAccessAllowReason < Base + %w[ + connected_website + added_to_attachment_menu + launched_web_app + accepted_request + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/bot_write_access_allow_reason/#{type}" + end + end +end diff --git a/lib/tdlib/types/bot_write_access_allow_reason/accepted_request.rb b/lib/tdlib/types/bot_write_access_allow_reason/accepted_request.rb new file mode 100644 index 00000000..210ba0e9 --- /dev/null +++ b/lib/tdlib/types/bot_write_access_allow_reason/accepted_request.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user accepted bot's request to send messages with allowBotToSendMessages. + class BotWriteAccessAllowReason::AcceptedRequest < BotWriteAccessAllowReason + end +end diff --git a/lib/tdlib/types/bot_write_access_allow_reason/added_to_attachment_menu.rb b/lib/tdlib/types/bot_write_access_allow_reason/added_to_attachment_menu.rb new file mode 100644 index 00000000..28f55a04 --- /dev/null +++ b/lib/tdlib/types/bot_write_access_allow_reason/added_to_attachment_menu.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu. + class BotWriteAccessAllowReason::AddedToAttachmentMenu < BotWriteAccessAllowReason + end +end diff --git a/lib/tdlib/types/bot_write_access_allow_reason/connected_website.rb b/lib/tdlib/types/bot_write_access_allow_reason/connected_website.rb new file mode 100644 index 00000000..07e8d875 --- /dev/null +++ b/lib/tdlib/types/bot_write_access_allow_reason/connected_website.rb @@ -0,0 +1,8 @@ +module TD::Types + # The user connected a website by logging in using Telegram Login Widget on it. + # + # @attr domain_name [TD::Types::String] Domain name of the connected website. + class BotWriteAccessAllowReason::ConnectedWebsite < BotWriteAccessAllowReason + attribute :domain_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/bot_write_access_allow_reason/launched_web_app.rb b/lib/tdlib/types/bot_write_access_allow_reason/launched_web_app.rb new file mode 100644 index 00000000..ade62afe --- /dev/null +++ b/lib/tdlib/types/bot_write_access_allow_reason/launched_web_app.rb @@ -0,0 +1,8 @@ +module TD::Types + # The user launched a Web App using getWebAppLinkUrl. + # + # @attr web_app [TD::Types::WebApp] Information about the Web App. + class BotWriteAccessAllowReason::LaunchedWebApp < BotWriteAccessAllowReason + attribute :web_app, TD::Types::WebApp + end +end diff --git a/lib/tdlib/types/business_away_message_schedule.rb b/lib/tdlib/types/business_away_message_schedule.rb new file mode 100644 index 00000000..03a5e56f --- /dev/null +++ b/lib/tdlib/types/business_away_message_schedule.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes conditions for sending of away messages by a Telegram Business account. + class BusinessAwayMessageSchedule < Base + %w[ + always + outside_of_opening_hours + custom + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/business_away_message_schedule/#{type}" + end + end +end diff --git a/lib/tdlib/types/business_away_message_schedule/always.rb b/lib/tdlib/types/business_away_message_schedule/always.rb new file mode 100644 index 00000000..a259a1d0 --- /dev/null +++ b/lib/tdlib/types/business_away_message_schedule/always.rb @@ -0,0 +1,5 @@ +module TD::Types + # Send away messages always. + class BusinessAwayMessageSchedule::Always < BusinessAwayMessageSchedule + end +end diff --git a/lib/tdlib/types/business_away_message_schedule/custom.rb b/lib/tdlib/types/business_away_message_schedule/custom.rb new file mode 100644 index 00000000..ba0f0e67 --- /dev/null +++ b/lib/tdlib/types/business_away_message_schedule/custom.rb @@ -0,0 +1,10 @@ +module TD::Types + # Send away messages only in the specified time span. + # + # @attr start_date [Integer] Point in time (Unix timestamp) when the away messages will start to be sent. + # @attr end_date [Integer] Point in time (Unix timestamp) when the away messages will stop to be sent. + class BusinessAwayMessageSchedule::Custom < BusinessAwayMessageSchedule + attribute :start_date, TD::Types::Coercible::Integer + attribute :end_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/business_away_message_schedule/outside_of_opening_hours.rb b/lib/tdlib/types/business_away_message_schedule/outside_of_opening_hours.rb new file mode 100644 index 00000000..1d5adec9 --- /dev/null +++ b/lib/tdlib/types/business_away_message_schedule/outside_of_opening_hours.rb @@ -0,0 +1,5 @@ +module TD::Types + # Send away messages outside of the business opening hours. + class BusinessAwayMessageSchedule::OutsideOfOpeningHours < BusinessAwayMessageSchedule + end +end diff --git a/lib/tdlib/types/business_away_message_settings.rb b/lib/tdlib/types/business_away_message_settings.rb new file mode 100644 index 00000000..27d8a1f7 --- /dev/null +++ b/lib/tdlib/types/business_away_message_settings.rb @@ -0,0 +1,15 @@ +module TD::Types + # Describes settings for messages that are automatically sent by a Telegram Business account when it is away. + # + # @attr shortcut_id [Integer] Unique quick reply shortcut identifier for the away messages. + # @attr recipients [TD::Types::BusinessRecipients] Chosen recipients of the away messages. + # @attr schedule [TD::Types::BusinessAwayMessageSchedule] Settings used to check whether the current user is away. + # @attr offline_only [Boolean] True, if the messages must not be sent if the account was online in the last 10 + # minutes. + class BusinessAwayMessageSettings < Base + attribute :shortcut_id, TD::Types::Coercible::Integer + attribute :recipients, TD::Types::BusinessRecipients + attribute :schedule, TD::Types::BusinessAwayMessageSchedule + attribute :offline_only, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/business_bot_manage_bar.rb b/lib/tdlib/types/business_bot_manage_bar.rb new file mode 100644 index 00000000..75bdac39 --- /dev/null +++ b/lib/tdlib/types/business_bot_manage_bar.rb @@ -0,0 +1,15 @@ +module TD::Types + # Contains information about a business bot that manages the chat. + # + # @attr bot_user_id [Integer] User identifier of the bot. + # @attr manage_url [TD::Types::String] URL to be opened to manage the bot. + # @attr is_bot_paused [Boolean] True, if the bot is paused. + # Use toggleBusinessConnectedBotChatIsPaused to change the value of the field. + # @attr can_bot_reply [Boolean] True, if the bot can reply. + class BusinessBotManageBar < Base + attribute :bot_user_id, TD::Types::Coercible::Integer + attribute :manage_url, TD::Types::String + attribute :is_bot_paused, TD::Types::Bool + attribute :can_bot_reply, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/business_chat_link.rb b/lib/tdlib/types/business_chat_link.rb new file mode 100644 index 00000000..b189e56b --- /dev/null +++ b/lib/tdlib/types/business_chat_link.rb @@ -0,0 +1,14 @@ +module TD::Types + # Contains information about a business chat link. + # + # @attr link [TD::Types::String] The HTTPS link. + # @attr text [TD::Types::FormattedText] Message draft text that will be added to the input field. + # @attr title [TD::Types::String] Link title. + # @attr view_count [Integer] Number of times the link was used. + class BusinessChatLink < Base + attribute :link, TD::Types::String + attribute :text, TD::Types::FormattedText + attribute :title, TD::Types::String + attribute :view_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/business_chat_link_info.rb b/lib/tdlib/types/business_chat_link_info.rb new file mode 100644 index 00000000..6b0dbe35 --- /dev/null +++ b/lib/tdlib/types/business_chat_link_info.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about a business chat link. + # + # @attr chat_id [Integer] Identifier of the private chat that created the link. + # @attr text [TD::Types::FormattedText] Message draft text that must be added to the input field. + class BusinessChatLinkInfo < Base + attribute :chat_id, TD::Types::Coercible::Integer + attribute :text, TD::Types::FormattedText + end +end diff --git a/lib/tdlib/types/business_chat_links.rb b/lib/tdlib/types/business_chat_links.rb new file mode 100644 index 00000000..b29fa95f --- /dev/null +++ b/lib/tdlib/types/business_chat_links.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of business chat links created by the user. + # + # @attr links [Array] List of links. + class BusinessChatLinks < Base + attribute :links, TD::Types::Array.of(TD::Types::BusinessChatLink) + end +end diff --git a/lib/tdlib/types/business_connected_bot.rb b/lib/tdlib/types/business_connected_bot.rb new file mode 100644 index 00000000..0a32e45f --- /dev/null +++ b/lib/tdlib/types/business_connected_bot.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes a bot connected to a business account. + # + # @attr bot_user_id [Integer] User identifier of the bot. + # @attr recipients [TD::Types::BusinessRecipients] Private chats that will be accessible to the bot. + # @attr can_reply [Boolean] True, if the bot can send messages to the private chats; false otherwise. + class BusinessConnectedBot < Base + attribute :bot_user_id, TD::Types::Coercible::Integer + attribute :recipients, TD::Types::BusinessRecipients + attribute :can_reply, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/business_connection.rb b/lib/tdlib/types/business_connection.rb new file mode 100644 index 00000000..bf30ddce --- /dev/null +++ b/lib/tdlib/types/business_connection.rb @@ -0,0 +1,18 @@ +module TD::Types + # Describes a connection of the bot with a business account. + # + # @attr id [TD::Types::String] Unique identifier of the connection. + # @attr user_id [Integer] Identifier of the business user that created the connection. + # @attr user_chat_id [Integer] Chat identifier of the private chat with the user. + # @attr date [Integer] Point in time (Unix timestamp) when the connection was established. + # @attr can_reply [Boolean] True, if the bot can send messages to the connected user; false otherwise. + # @attr is_enabled [Boolean] True, if the connection is enabled; false otherwise. + class BusinessConnection < Base + attribute :id, TD::Types::String + attribute :user_id, TD::Types::Coercible::Integer + attribute :user_chat_id, TD::Types::Coercible::Integer + attribute :date, TD::Types::Coercible::Integer + attribute :can_reply, TD::Types::Bool + attribute :is_enabled, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/business_feature.rb b/lib/tdlib/types/business_feature.rb new file mode 100644 index 00000000..eb521e0d --- /dev/null +++ b/lib/tdlib/types/business_feature.rb @@ -0,0 +1,20 @@ +module TD::Types + # Describes a feature available to Business user accounts. + class BusinessFeature < Base + %w[ + location + opening_hours + quick_replies + greeting_message + away_message + account_links + start_page + bots + emoji_status + chat_folder_tags + upgraded_stories + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/business_feature/#{type}" + end + end +end diff --git a/lib/tdlib/types/business_feature/account_links.rb b/lib/tdlib/types/business_feature/account_links.rb new file mode 100644 index 00000000..8c1c9dc8 --- /dev/null +++ b/lib/tdlib/types/business_feature/account_links.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to create links to the business account with predefined message text. + class BusinessFeature::AccountLinks < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/away_message.rb b/lib/tdlib/types/business_feature/away_message.rb new file mode 100644 index 00000000..e8b5ea15 --- /dev/null +++ b/lib/tdlib/types/business_feature/away_message.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to set up an away message. + class BusinessFeature::AwayMessage < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/bots.rb b/lib/tdlib/types/business_feature/bots.rb new file mode 100644 index 00000000..cf7e77fa --- /dev/null +++ b/lib/tdlib/types/business_feature/bots.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to connect a bot to the account. + class BusinessFeature::Bots < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/chat_folder_tags.rb b/lib/tdlib/types/business_feature/chat_folder_tags.rb new file mode 100644 index 00000000..91be29b9 --- /dev/null +++ b/lib/tdlib/types/business_feature/chat_folder_tags.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to display folder names for each chat in the chat list. + class BusinessFeature::ChatFolderTags < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/emoji_status.rb b/lib/tdlib/types/business_feature/emoji_status.rb new file mode 100644 index 00000000..d44bab2e --- /dev/null +++ b/lib/tdlib/types/business_feature/emoji_status.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to show an emoji status along with the business name. + class BusinessFeature::EmojiStatus < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/greeting_message.rb b/lib/tdlib/types/business_feature/greeting_message.rb new file mode 100644 index 00000000..08e536f3 --- /dev/null +++ b/lib/tdlib/types/business_feature/greeting_message.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to set up a greeting message. + class BusinessFeature::GreetingMessage < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/location.rb b/lib/tdlib/types/business_feature/location.rb new file mode 100644 index 00000000..9c389b77 --- /dev/null +++ b/lib/tdlib/types/business_feature/location.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to set location. + class BusinessFeature::Location < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/opening_hours.rb b/lib/tdlib/types/business_feature/opening_hours.rb new file mode 100644 index 00000000..e905a639 --- /dev/null +++ b/lib/tdlib/types/business_feature/opening_hours.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to set opening hours. + class BusinessFeature::OpeningHours < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/quick_replies.rb b/lib/tdlib/types/business_feature/quick_replies.rb new file mode 100644 index 00000000..afc9e6ab --- /dev/null +++ b/lib/tdlib/types/business_feature/quick_replies.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to use quick replies. + class BusinessFeature::QuickReplies < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/start_page.rb b/lib/tdlib/types/business_feature/start_page.rb new file mode 100644 index 00000000..151fae64 --- /dev/null +++ b/lib/tdlib/types/business_feature/start_page.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to customize start page. + class BusinessFeature::StartPage < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature/upgraded_stories.rb b/lib/tdlib/types/business_feature/upgraded_stories.rb new file mode 100644 index 00000000..3d5f876c --- /dev/null +++ b/lib/tdlib/types/business_feature/upgraded_stories.rb @@ -0,0 +1,5 @@ +module TD::Types + # Allowed to use many additional features for stories. + class BusinessFeature::UpgradedStories < BusinessFeature + end +end diff --git a/lib/tdlib/types/business_feature_promotion_animation.rb b/lib/tdlib/types/business_feature_promotion_animation.rb new file mode 100644 index 00000000..1676854b --- /dev/null +++ b/lib/tdlib/types/business_feature_promotion_animation.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a promotion animation for a Business feature. + # + # @attr feature [TD::Types::BusinessFeature] Business feature. + # @attr animation [TD::Types::Animation] Promotion animation for the feature. + class BusinessFeaturePromotionAnimation < Base + attribute :feature, TD::Types::BusinessFeature + attribute :animation, TD::Types::Animation + end +end diff --git a/lib/tdlib/types/business_features.rb b/lib/tdlib/types/business_features.rb new file mode 100644 index 00000000..8fdbc045 --- /dev/null +++ b/lib/tdlib/types/business_features.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains information about features, available to Business user accounts. + # + # @attr features [Array] The list of available business features. + class BusinessFeatures < Base + attribute :features, TD::Types::Array.of(TD::Types::BusinessFeature) + end +end diff --git a/lib/tdlib/types/business_greeting_message_settings.rb b/lib/tdlib/types/business_greeting_message_settings.rb new file mode 100644 index 00000000..b3e4bad6 --- /dev/null +++ b/lib/tdlib/types/business_greeting_message_settings.rb @@ -0,0 +1,14 @@ +module TD::Types + # Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to + # incoming messages in an inactive private chat. + # + # @attr shortcut_id [Integer] Unique quick reply shortcut identifier for the greeting messages. + # @attr recipients [TD::Types::BusinessRecipients] Chosen recipients of the greeting messages. + # @attr inactivity_days [Integer] The number of days after which a chat will be considered as inactive; currently, + # must be on of 7, 14, 21, or 28. + class BusinessGreetingMessageSettings < Base + attribute :shortcut_id, TD::Types::Coercible::Integer + attribute :recipients, TD::Types::BusinessRecipients + attribute :inactivity_days, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/business_info.rb b/lib/tdlib/types/business_info.rb new file mode 100644 index 00000000..82f2c44d --- /dev/null +++ b/lib/tdlib/types/business_info.rb @@ -0,0 +1,32 @@ +module TD::Types + # Contains information about a Telegram Business account. + # + # @attr location [TD::Types::BusinessLocation, nil] Location of the business; may be null if none. + # @attr opening_hours [TD::Types::BusinessOpeningHours, nil] Opening hours of the business; may be null if none. + # The hours are guaranteed to be valid and has already been split by week days. + # @attr local_opening_hours [TD::Types::BusinessOpeningHours, nil] Opening hours of the business in the local time; + # may be null if none. + # The hours are guaranteed to be valid and has already been split by week days. + # Local time zone identifier will be empty. + # An {TD::Types::Update::UserFullInfo} update is not triggered when value of this field changes. + # @attr next_open_in [Integer] Time left before the business will open the next time, in seconds; 0 if unknown. + # An {TD::Types::Update::UserFullInfo} update is not triggered when value of this field changes. + # @attr next_close_in [Integer] Time left before the business will close the next time, in seconds; 0 if unknown. + # An {TD::Types::Update::UserFullInfo} update is not triggered when value of this field changes. + # @attr greeting_message_settings [TD::Types::BusinessGreetingMessageSettings, nil] The greeting message; may be null + # if none or the Business account is not of the current user. + # @attr away_message_settings [TD::Types::BusinessAwayMessageSettings, nil] The away message; may be null if none or + # the Business account is not of the current user. + # @attr start_page [TD::Types::BusinessStartPage, nil] Information about start page of the account; may be null if + # none. + class BusinessInfo < Base + attribute :location, TD::Types::BusinessLocation.optional.default(nil) + attribute :opening_hours, TD::Types::BusinessOpeningHours.optional.default(nil) + attribute :local_opening_hours, TD::Types::BusinessOpeningHours.optional.default(nil) + attribute :next_open_in, TD::Types::Coercible::Integer + attribute :next_close_in, TD::Types::Coercible::Integer + attribute :greeting_message_settings, TD::Types::BusinessGreetingMessageSettings.optional.default(nil) + attribute :away_message_settings, TD::Types::BusinessAwayMessageSettings.optional.default(nil) + attribute :start_page, TD::Types::BusinessStartPage.optional.default(nil) + end +end diff --git a/lib/tdlib/types/business_location.rb b/lib/tdlib/types/business_location.rb new file mode 100644 index 00000000..b5350961 --- /dev/null +++ b/lib/tdlib/types/business_location.rb @@ -0,0 +1,10 @@ +module TD::Types + # Represents a location of a business. + # + # @attr location [TD::Types::Location, nil] The location; may be null if not specified. + # @attr address [TD::Types::String] Location address; 1-96 characters. + class BusinessLocation < Base + attribute :location, TD::Types::Location.optional.default(nil) + attribute :address, TD::Types::String + end +end diff --git a/lib/tdlib/types/business_message.rb b/lib/tdlib/types/business_message.rb new file mode 100644 index 00000000..91f74fdd --- /dev/null +++ b/lib/tdlib/types/business_message.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes a message from a business account as received by a bot. + # + # @attr message [TD::Types::Message] The message. + # @attr reply_to_message [TD::Types::Message, nil] Message that is replied by the message in the same chat; may be + # null if none. + class BusinessMessage < Base + attribute :message, TD::Types::Message + attribute :reply_to_message, TD::Types::Message.optional.default(nil) + end +end diff --git a/lib/tdlib/types/business_messages.rb b/lib/tdlib/types/business_messages.rb new file mode 100644 index 00000000..fe2f4f99 --- /dev/null +++ b/lib/tdlib/types/business_messages.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of messages from a business account as received by a bot. + # + # @attr messages [Array] List of business messages. + class BusinessMessages < Base + attribute :messages, TD::Types::Array.of(TD::Types::BusinessMessage) + end +end diff --git a/lib/tdlib/types/business_opening_hours.rb b/lib/tdlib/types/business_opening_hours.rb new file mode 100644 index 00000000..dd9119b9 --- /dev/null +++ b/lib/tdlib/types/business_opening_hours.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes opening hours of a business. + # + # @attr time_zone_id [TD::Types::String] Unique time zone identifier. + # @attr opening_hours [Array] Intervals of the time when the business is + # open. + class BusinessOpeningHours < Base + attribute :time_zone_id, TD::Types::String + attribute :opening_hours, TD::Types::Array.of(TD::Types::BusinessOpeningHoursInterval) + end +end diff --git a/lib/tdlib/types/business_opening_hours_interval.rb b/lib/tdlib/types/business_opening_hours_interval.rb new file mode 100644 index 00000000..3f980f55 --- /dev/null +++ b/lib/tdlib/types/business_opening_hours_interval.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes an interval of time when the business is open. + # + # @attr start_minute [Integer] The minute's sequence number in a week, starting on Monday, marking the start of the + # time interval during which the business is open; 0-7*24*60. + # @attr end_minute [Integer] The minute's sequence number in a week, starting on Monday, marking the end of the time + # interval during which the business is open; 1-8*24*60. + class BusinessOpeningHoursInterval < Base + attribute :start_minute, TD::Types::Coercible::Integer + attribute :end_minute, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/business_recipients.rb b/lib/tdlib/types/business_recipients.rb new file mode 100644 index 00000000..08f04407 --- /dev/null +++ b/lib/tdlib/types/business_recipients.rb @@ -0,0 +1,22 @@ +module TD::Types + # Describes private chats chosen for automatic interaction with a business. + # + # @attr chat_ids [Array] Identifiers of selected private chats. + # @attr excluded_chat_ids [Array] Identifiers of private chats that are always excluded; for + # {TD::Types::BusinessConnectedBot} only. + # @attr select_existing_chats [Boolean] True, if all existing private chats are selected. + # @attr select_new_chats [Boolean] True, if all new private chats are selected. + # @attr select_contacts [Boolean] True, if all private chats with contacts are selected. + # @attr select_non_contacts [Boolean] True, if all private chats with non-contacts are selected. + # @attr exclude_selected [Boolean] If true, then all private chats except the selected are chosen. + # Otherwise, only the selected chats are chosen. + class BusinessRecipients < Base + attribute :chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :excluded_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :select_existing_chats, TD::Types::Bool + attribute :select_new_chats, TD::Types::Bool + attribute :select_contacts, TD::Types::Bool + attribute :select_non_contacts, TD::Types::Bool + attribute :exclude_selected, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/business_start_page.rb b/lib/tdlib/types/business_start_page.rb new file mode 100644 index 00000000..2386fa5f --- /dev/null +++ b/lib/tdlib/types/business_start_page.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes settings for a business account start page. + # + # @attr title [TD::Types::String] Title text of the start page. + # @attr message [TD::Types::String] Message text of the start page. + # @attr sticker [TD::Types::Sticker, nil] Greeting sticker of the start page; may be null if none. + class BusinessStartPage < Base + attribute :title, TD::Types::String + attribute :message, TD::Types::String + attribute :sticker, TD::Types::Sticker.optional.default(nil) + end +end diff --git a/lib/tdlib/types/call.rb b/lib/tdlib/types/call.rb index 9fe197dd..341c8004 100644 --- a/lib/tdlib/types/call.rb +++ b/lib/tdlib/types/call.rb @@ -2,7 +2,7 @@ module TD::Types # Describes a call. # # @attr id [Integer] Call identifier, not persistent. - # @attr user_id [Integer] Peer user identifier. + # @attr user_id [Integer] User identifier of the other call participant. # @attr is_outgoing [Boolean] True, if the call is outgoing. # @attr is_video [Boolean] True, if the call is a video call. # @attr state [TD::Types::CallState] Call state. diff --git a/lib/tdlib/types/call_discard_reason/missed.rb b/lib/tdlib/types/call_discard_reason/missed.rb index 11743cd4..75555ed1 100644 --- a/lib/tdlib/types/call_discard_reason/missed.rb +++ b/lib/tdlib/types/call_discard_reason/missed.rb @@ -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 diff --git a/lib/tdlib/types/call_problem.rb b/lib/tdlib/types/call_problem.rb index 634ec605..8c76d6d9 100644 --- a/lib/tdlib/types/call_problem.rb +++ b/lib/tdlib/types/call_problem.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the exact type of a problem with a call. + # Describes the exact type of problem with a call. class CallProblem < Base %w[ echo diff --git a/lib/tdlib/types/call_protocol.rb b/lib/tdlib/types/call_protocol.rb index 1fd2ce55..af9d1685 100644 --- a/lib/tdlib/types/call_protocol.rb +++ b/lib/tdlib/types/call_protocol.rb @@ -4,7 +4,7 @@ module TD::Types # @attr udp_p2p [Boolean] True, if UDP peer-to-peer connections are supported. # @attr udp_reflector [Boolean] True, if connection through UDP reflectors is supported. # @attr min_layer [Integer] The minimum supported API layer; use 65. - # @attr max_layer [Integer] The maximum supported API layer; use 65. + # @attr max_layer [Integer] The maximum supported API layer; use 92. # @attr library_versions [Array] List of supported tgcalls versions. class CallProtocol < Base attribute :udp_p2p, TD::Types::Bool diff --git a/lib/tdlib/types/call_server_type.rb b/lib/tdlib/types/call_server_type.rb index 7f2ad6c2..8670f1a1 100644 --- a/lib/tdlib/types/call_server_type.rb +++ b/lib/tdlib/types/call_server_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the type of a call server. + # Describes the type of call server. class CallServerType < Base %w[ telegram_reflector diff --git a/lib/tdlib/types/call_server_type/telegram_reflector.rb b/lib/tdlib/types/call_server_type/telegram_reflector.rb index c0bb38e5..44bdc899 100644 --- a/lib/tdlib/types/call_server_type/telegram_reflector.rb +++ b/lib/tdlib/types/call_server_type/telegram_reflector.rb @@ -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 diff --git a/lib/tdlib/types/call_state/discarded.rb b/lib/tdlib/types/call_state/discarded.rb index d28dac04..fc056210 100644 --- a/lib/tdlib/types/call_state/discarded.rb +++ b/lib/tdlib/types/call_state/discarded.rb @@ -1,12 +1,14 @@ 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 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 diff --git a/lib/tdlib/types/call_state/ready.rb b/lib/tdlib/types/call_state/ready.rb index 6e6eac7f..0a9fa027 100644 --- a/lib/tdlib/types/call_state/ready.rb +++ b/lib/tdlib/types/call_state/ready.rb @@ -1,12 +1,13 @@ module TD::Types # The call is ready to use. # - # @attr protocol [TD::Types::CallProtocol] Call protocols supported by the peer. + # @attr protocol [TD::Types::CallProtocol] Call protocols supported by the other call participant. # @attr servers [Array] List of available call servers. # @attr config [TD::Types::String] A JSON-encoded call config. # @attr encryption_key [String] Call encryption key. - # @attr emojis [Array] Encryption key emojis fingerprint. + # @attr emojis [Array] Encryption key fingerprint represented as 4 emoji. # @attr allow_p2p [Boolean] True, if peer-to-peer connection is allowed by users privacy settings. + # @attr custom_parameters [TD::Types::String] Custom JSON-encoded call parameters to be passed to tgcalls. class CallState::Ready < CallState attribute :protocol, TD::Types::CallProtocol attribute :servers, TD::Types::Array.of(TD::Types::CallServer) @@ -14,5 +15,6 @@ class CallState::Ready < CallState attribute :encryption_key, TD::Types::Coercible::String attribute :emojis, TD::Types::Array.of(TD::Types::String) attribute :allow_p2p, TD::Types::Bool + attribute :custom_parameters, TD::Types::String end end diff --git a/lib/tdlib/types/callback_query_answer.rb b/lib/tdlib/types/callback_query_answer.rb index b92b90e1..5c9a6c9e 100644 --- a/lib/tdlib/types/callback_query_answer.rb +++ b/lib/tdlib/types/callback_query_answer.rb @@ -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 diff --git a/lib/tdlib/types/callback_query_payload/data_with_password.rb b/lib/tdlib/types/callback_query_payload/data_with_password.rb index 45d8daea..2b1b44d9 100644 --- a/lib/tdlib/types/callback_query_payload/data_with_password.rb +++ b/lib/tdlib/types/callback_query_payload/data_with_password.rb @@ -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 diff --git a/lib/tdlib/types/can_send_message_to_user_result.rb b/lib/tdlib/types/can_send_message_to_user_result.rb new file mode 100644 index 00000000..aa12a4d8 --- /dev/null +++ b/lib/tdlib/types/can_send_message_to_user_result.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes result of canSendMessageToUser. + class CanSendMessageToUserResult < Base + %w[ + ok + user_is_deleted + user_restricts_new_chats + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/can_send_message_to_user_result/#{type}" + end + end +end diff --git a/lib/tdlib/types/can_send_message_to_user_result/ok.rb b/lib/tdlib/types/can_send_message_to_user_result/ok.rb new file mode 100644 index 00000000..c38ce732 --- /dev/null +++ b/lib/tdlib/types/can_send_message_to_user_result/ok.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user can be messaged. + class CanSendMessageToUserResult::Ok < CanSendMessageToUserResult + end +end diff --git a/lib/tdlib/types/can_send_message_to_user_result/user_is_deleted.rb b/lib/tdlib/types/can_send_message_to_user_result/user_is_deleted.rb new file mode 100644 index 00000000..f36b597f --- /dev/null +++ b/lib/tdlib/types/can_send_message_to_user_result/user_is_deleted.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user can't be messaged, because they are deleted or unknown. + class CanSendMessageToUserResult::UserIsDeleted < CanSendMessageToUserResult + end +end diff --git a/lib/tdlib/types/can_send_message_to_user_result/user_restricts_new_chats.rb b/lib/tdlib/types/can_send_message_to_user_result/user_restricts_new_chats.rb new file mode 100644 index 00000000..db29f353 --- /dev/null +++ b/lib/tdlib/types/can_send_message_to_user_result/user_restricts_new_chats.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user can't be messaged, because they restrict new chats with non-contacts. + class CanSendMessageToUserResult::UserRestrictsNewChats < CanSendMessageToUserResult + end +end diff --git a/lib/tdlib/types/can_send_story_result.rb b/lib/tdlib/types/can_send_story_result.rb new file mode 100644 index 00000000..275924f9 --- /dev/null +++ b/lib/tdlib/types/can_send_story_result.rb @@ -0,0 +1,15 @@ +module TD::Types + # Represents result of checking whether the current user can send a story in the specific chat. + class CanSendStoryResult < Base + %w[ + ok + premium_needed + boost_needed + active_story_limit_exceeded + weekly_limit_exceeded + monthly_limit_exceeded + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/can_send_story_result/#{type}" + end + end +end diff --git a/lib/tdlib/types/can_send_story_result/active_story_limit_exceeded.rb b/lib/tdlib/types/can_send_story_result/active_story_limit_exceeded.rb new file mode 100644 index 00000000..b62f8fb4 --- /dev/null +++ b/lib/tdlib/types/can_send_story_result/active_story_limit_exceeded.rb @@ -0,0 +1,6 @@ +module TD::Types + # The limit for the number of active stories exceeded. + # The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire. + class CanSendStoryResult::ActiveStoryLimitExceeded < CanSendStoryResult + end +end diff --git a/lib/tdlib/types/can_send_story_result/boost_needed.rb b/lib/tdlib/types/can_send_story_result/boost_needed.rb new file mode 100644 index 00000000..6741699c --- /dev/null +++ b/lib/tdlib/types/can_send_story_result/boost_needed.rb @@ -0,0 +1,6 @@ +module TD::Types + # The chat must be boosted first by Telegram Premium subscribers to post more stories. + # Call getChatBoostStatus to get current boost status of the chat. + class CanSendStoryResult::BoostNeeded < CanSendStoryResult + end +end diff --git a/lib/tdlib/types/can_send_story_result/monthly_limit_exceeded.rb b/lib/tdlib/types/can_send_story_result/monthly_limit_exceeded.rb new file mode 100644 index 00000000..3060597d --- /dev/null +++ b/lib/tdlib/types/can_send_story_result/monthly_limit_exceeded.rb @@ -0,0 +1,9 @@ +module TD::Types + # The monthly limit for the number of posted stories exceeded. + # The user needs to buy Telegram Premium or wait specified time. + # + # @attr retry_after [Integer] Time left before the user can send the next story. + class CanSendStoryResult::MonthlyLimitExceeded < CanSendStoryResult + attribute :retry_after, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/can_send_story_result/ok.rb b/lib/tdlib/types/can_send_story_result/ok.rb new file mode 100644 index 00000000..cf009b30 --- /dev/null +++ b/lib/tdlib/types/can_send_story_result/ok.rb @@ -0,0 +1,5 @@ +module TD::Types + # A story can be sent. + class CanSendStoryResult::Ok < CanSendStoryResult + end +end diff --git a/lib/tdlib/types/can_send_story_result/premium_needed.rb b/lib/tdlib/types/can_send_story_result/premium_needed.rb new file mode 100644 index 00000000..30266a9b --- /dev/null +++ b/lib/tdlib/types/can_send_story_result/premium_needed.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user must subscribe to Telegram Premium to be able to post stories. + class CanSendStoryResult::PremiumNeeded < CanSendStoryResult + end +end diff --git a/lib/tdlib/types/can_send_story_result/weekly_limit_exceeded.rb b/lib/tdlib/types/can_send_story_result/weekly_limit_exceeded.rb new file mode 100644 index 00000000..2faba8c0 --- /dev/null +++ b/lib/tdlib/types/can_send_story_result/weekly_limit_exceeded.rb @@ -0,0 +1,9 @@ +module TD::Types + # The weekly limit for the number of posted stories exceeded. + # The user needs to buy Telegram Premium or wait specified time. + # + # @attr retry_after [Integer] Time left before the user can send the next story. + class CanSendStoryResult::WeeklyLimitExceeded < CanSendStoryResult + attribute :retry_after, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/channel_transaction_purpose.rb b/lib/tdlib/types/channel_transaction_purpose.rb new file mode 100644 index 00000000..9bcf5afa --- /dev/null +++ b/lib/tdlib/types/channel_transaction_purpose.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes purpose of a transaction with a channel. + class ChannelTransactionPurpose < Base + %w[ + paid_media + join + reaction + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/channel_transaction_purpose/#{type}" + end + end +end diff --git a/lib/tdlib/types/channel_transaction_purpose/join.rb b/lib/tdlib/types/channel_transaction_purpose/join.rb new file mode 100644 index 00000000..df205773 --- /dev/null +++ b/lib/tdlib/types/channel_transaction_purpose/join.rb @@ -0,0 +1,8 @@ +module TD::Types + # User joined the channel and subscribed to regular payments in Telegram Stars. + # + # @attr period [Integer] The number of seconds between consecutive Telegram Star debiting. + class ChannelTransactionPurpose::Join < ChannelTransactionPurpose + attribute :period, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/channel_transaction_purpose/paid_media.rb b/lib/tdlib/types/channel_transaction_purpose/paid_media.rb new file mode 100644 index 00000000..d6868abc --- /dev/null +++ b/lib/tdlib/types/channel_transaction_purpose/paid_media.rb @@ -0,0 +1,11 @@ +module TD::Types + # Paid media were bought. + # + # @attr message_id [Integer] Identifier of the corresponding message with paid media; can be an identifier of a + # deleted message. + # @attr media [Array] The bought media if the trancastion wasn't refunded. + class ChannelTransactionPurpose::PaidMedia < ChannelTransactionPurpose + attribute :message_id, TD::Types::Coercible::Integer + attribute :media, TD::Types::Array.of(TD::Types::PaidMedia) + end +end diff --git a/lib/tdlib/types/channel_transaction_purpose/reaction.rb b/lib/tdlib/types/channel_transaction_purpose/reaction.rb new file mode 100644 index 00000000..3ae15655 --- /dev/null +++ b/lib/tdlib/types/channel_transaction_purpose/reaction.rb @@ -0,0 +1,8 @@ +module TD::Types + # User paid for a reaction. + # + # @attr message_id [Integer] Identifier of the reacted message; can be an identifier of a deleted message. + class ChannelTransactionPurpose::Reaction < ChannelTransactionPurpose + attribute :message_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat.rb b/lib/tdlib/types/chat.rb index 596e2fed..b4acd26b 100644 --- a/lib/tdlib/types/chat.rb +++ b/lib/tdlib/types/chat.rb @@ -6,13 +6,28 @@ module TD::Types # @attr type [TD::Types::ChatType] Type of the chat. # @attr title [TD::Types::String] Chat title. # @attr photo [TD::Types::ChatPhotoInfo, nil] Chat photo; may be null. + # @attr accent_color_id [Integer] Identifier of the accent color for message sender name, and backgrounds of chat + # photo, reply header, and link preview. + # @attr background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the reply header and link + # preview background for messages sent by the chat; 0 if none. + # @attr profile_accent_color_id [Integer] Identifier of the profile accent color for the chat's profile; -1 if none. + # @attr profile_background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the background of + # the chat's profile; 0 if none. # @attr permissions [TD::Types::ChatPermissions] Actions that non-administrator chat members are allowed to take in # the chat. - # @attr last_message [TD::Types::Message, nil] Last message in the chat; may be null. + # @attr last_message [TD::Types::Message, nil] Last message in the chat; may be null if none or unknown. # @attr positions [Array] Positions of the chat in chat lists. + # @attr chat_lists [Array] Chat lists to which the chat belongs. + # A chat can have a non-zero position in a chat list even it doesn't belong to the chat list and have no position + # in a chat list even it belongs to the chat list. + # @attr message_sender_id [TD::Types::MessageSender, nil] Identifier of a user or chat that is selected to send + # messages in the chat; may be null if the user can't change message sender. + # @attr block_list [TD::Types::BlockList, nil] Block list to which the chat is added; may be null if none. + # @attr has_protected_content [Boolean] True, if chat content can't be saved locally, forwarded, or copied. + # @attr is_translatable [Boolean] True, if translation of all messages in the chat must be suggested to the user. # @attr is_marked_as_unread [Boolean] True, if the chat is marked as unread. - # @attr is_blocked [Boolean] True, if the chat is blocked by the current user and private messages from the chat - # can't be received. + # @attr view_as_topics [Boolean] True, if the chat is a forum supergroup that must be shown in the "View as topics" + # mode, or Saved Messages chat that must be shown in the "View as chats". # @attr has_scheduled_messages [Boolean] True, if the chat has scheduled messages. # @attr can_be_deleted_only_for_self [Boolean] True, if the chat messages can be deleted only for the current user # while other users will continue to see the messages. @@ -25,18 +40,27 @@ module TD::Types # @attr last_read_inbox_message_id [Integer] Identifier of the last read incoming message. # @attr last_read_outbox_message_id [Integer] Identifier of the last read outgoing message. # @attr unread_mention_count [Integer] Number of unread messages with a mention/reply in the chat. - # @attr notification_settings [TD::Types::ChatNotificationSettings] Notification settings for this chat. - # @attr message_ttl_setting [Integer] Current message Time To Live setting (self-destruct timer) for the chat; 0 if - # 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 unread_reaction_count [Integer] Number of messages with unread reactions in the chat. + # @attr notification_settings [TD::Types::ChatNotificationSettings] Notification settings for the chat. + # @attr available_reactions [TD::Types::ChatAvailableReactions] Types of reaction, available in the chat. + # @attr message_auto_delete_time [Integer] Current message auto-delete or self-destruct timer setting for the chat, + # in seconds; 0 if disabled. + # Self-destruct timer in secret chats starts after the message or its content is viewed. + # Auto-delete timer in other chats starts from the send date. + # @attr emoji_status [TD::Types::EmojiStatus, nil] Emoji status to be shown along with chat title; may be null. + # @attr background [TD::Types::ChatBackground, nil] Background set for the chat; may be null if none. + # @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 if none. + # @attr business_bot_manage_bar [TD::Types::BusinessBotManageBar, nil] Information about bar for managing a business + # bot in the chat; may be null if none. + # @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 if none. # @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 draft_message [TD::Types::DraftMessage, nil] A draft of a message in the chat; may be null if none. + # @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 @@ -44,11 +68,20 @@ class Chat < Base attribute :type, TD::Types::ChatType attribute :title, TD::Types::String attribute :photo, TD::Types::ChatPhotoInfo.optional.default(nil) + attribute :accent_color_id, TD::Types::Coercible::Integer + attribute :background_custom_emoji_id, TD::Types::Coercible::Integer + attribute :profile_accent_color_id, TD::Types::Coercible::Integer + attribute :profile_background_custom_emoji_id, TD::Types::Coercible::Integer attribute :permissions, TD::Types::ChatPermissions attribute :last_message, TD::Types::Message.optional.default(nil) attribute :positions, TD::Types::Array.of(TD::Types::ChatPosition) + attribute :chat_lists, TD::Types::Array.of(TD::Types::ChatList) + attribute :message_sender_id, TD::Types::MessageSender.optional.default(nil) + attribute :block_list, TD::Types::BlockList.optional.default(nil) + attribute :has_protected_content, TD::Types::Bool + attribute :is_translatable, TD::Types::Bool attribute :is_marked_as_unread, TD::Types::Bool - attribute :is_blocked, TD::Types::Bool + attribute :view_as_topics, TD::Types::Bool attribute :has_scheduled_messages, TD::Types::Bool attribute :can_be_deleted_only_for_self, TD::Types::Bool attribute :can_be_deleted_for_all_users, TD::Types::Bool @@ -58,10 +91,17 @@ class Chat < Base attribute :last_read_inbox_message_id, TD::Types::Coercible::Integer attribute :last_read_outbox_message_id, TD::Types::Coercible::Integer attribute :unread_mention_count, TD::Types::Coercible::Integer + attribute :unread_reaction_count, TD::Types::Coercible::Integer attribute :notification_settings, TD::Types::ChatNotificationSettings - attribute :message_ttl_setting, TD::Types::Coercible::Integer + attribute :available_reactions, TD::Types::ChatAvailableReactions + attribute :message_auto_delete_time, TD::Types::Coercible::Integer + attribute :emoji_status, TD::Types::EmojiStatus.optional.default(nil) + attribute :background, TD::Types::ChatBackground.optional.default(nil) + attribute :theme_name, TD::Types::String attribute :action_bar, TD::Types::ChatActionBar.optional.default(nil) - attribute :voice_chat, TD::Types::VoiceChat + attribute :business_bot_manage_bar, TD::Types::BusinessBotManageBar.optional.default(nil) + 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 diff --git a/lib/tdlib/types/chat_action.rb b/lib/tdlib/types/chat_action.rb index ea0a61f9..16ff174e 100644 --- a/lib/tdlib/types/chat_action.rb +++ b/lib/tdlib/types/chat_action.rb @@ -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}" diff --git a/lib/tdlib/types/chat_action/cancel.rb b/lib/tdlib/types/chat_action/cancel.rb index 31e4f774..1dcf6c10 100644 --- a/lib/tdlib/types/chat_action/cancel.rb +++ b/lib/tdlib/types/chat_action/cancel.rb @@ -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 diff --git a/lib/tdlib/types/chat_action/choosing_sticker.rb b/lib/tdlib/types/chat_action/choosing_sticker.rb new file mode 100644 index 00000000..379366b5 --- /dev/null +++ b/lib/tdlib/types/chat_action/choosing_sticker.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user is picking a sticker to send. + class ChatAction::ChoosingSticker < ChatAction + end +end diff --git a/lib/tdlib/types/chat_action/watching_animations.rb b/lib/tdlib/types/chat_action/watching_animations.rb new file mode 100644 index 00000000..693aef64 --- /dev/null +++ b/lib/tdlib/types/chat_action/watching_animations.rb @@ -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 diff --git a/lib/tdlib/types/chat_action_bar.rb b/lib/tdlib/types/chat_action_bar.rb index 718fc739..1611758e 100644 --- a/lib/tdlib/types/chat_action_bar.rb +++ b/lib/tdlib/types/chat_action_bar.rb @@ -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 @@ -8,6 +8,7 @@ class ChatActionBar < Base report_add_block add_contact share_phone_number + join_request ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/chat_action_bar/#{type}" end diff --git a/lib/tdlib/types/chat_action_bar/invite_members.rb b/lib/tdlib/types/chat_action_bar/invite_members.rb index 0c91ebe8..e6853d3b 100644 --- a/lib/tdlib/types/chat_action_bar/invite_members.rb +++ b/lib/tdlib/types/chat_action_bar/invite_members.rb @@ -1,5 +1,5 @@ module TD::Types - # The chat is a recently created group chat, to which new members can be invited. + # The chat is a recently created group chat to which new members can be invited. class ChatActionBar::InviteMembers < ChatActionBar end end diff --git a/lib/tdlib/types/chat_action_bar/join_request.rb b/lib/tdlib/types/chat_action_bar/join_request.rb new file mode 100644 index 00000000..712d2c89 --- /dev/null +++ b/lib/tdlib/types/chat_action_bar/join_request.rb @@ -0,0 +1,12 @@ +module TD::Types + # The chat is a private chat with an administrator of a chat to which the user sent join request. + # + # @attr title [TD::Types::String] Title of the chat to which the join request was sent. + # @attr is_channel [Boolean] True, if the join request was sent to a channel chat. + # @attr request_date [Integer] Point in time (Unix timestamp) when the join request was sent. + class ChatActionBar::JoinRequest < ChatActionBar + attribute :title, TD::Types::String + attribute :is_channel, TD::Types::Bool + attribute :request_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_action_bar/report_add_block.rb b/lib/tdlib/types/chat_action_bar/report_add_block.rb index c2cb436c..2cd39d56 100644 --- a/lib/tdlib/types/chat_action_bar/report_add_block.rb +++ b/lib/tdlib/types/chat_action_bar/report_add_block.rb @@ -1,12 +1,15 @@ 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 setMessageSenderBlockList, or the other user can be added to the contact list using the method + # addContact. + # If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be + # shown. # # @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 # setChatNotificationSettings. - # @attr distance [Integer] If non-negative, the current user was found by the peer through searchChatsNearby and this - # is the distance between the users. + # @attr distance [Integer] If non-negative, the current user was found by the other user through searchChatsNearby + # and this is the distance between the users. class ChatActionBar::ReportAddBlock < ChatActionBar attribute :can_unarchive, TD::Types::Bool attribute :distance, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/chat_action_bar/report_spam.rb b/lib/tdlib/types/chat_action_bar/report_spam.rb index f5cbed57..e6addb3d 100644 --- a/lib/tdlib/types/chat_action_bar/report_spam.rb +++ b/lib/tdlib/types/chat_action_bar/report_spam.rb @@ -1,5 +1,7 @@ module TD::Types - # The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam. + # The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. + # If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be + # shown. # # @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 diff --git a/lib/tdlib/types/chat_action_bar/report_unrelated_location.rb b/lib/tdlib/types/chat_action_bar/report_unrelated_location.rb index dc6f57a0..5c083b3a 100644 --- a/lib/tdlib/types/chat_action_bar/report_unrelated_location.rb +++ b/lib/tdlib/types/chat_action_bar/report_unrelated_location.rb @@ -1,6 +1,6 @@ module TD::Types # The chat is a location-based supergroup, which can be reported as having unrelated location using the method - # reportChat with the reason chatReportReasonUnrelatedLocation. + # reportChat with the reason reportReasonUnrelatedLocation. class ChatActionBar::ReportUnrelatedLocation < ChatActionBar end end diff --git a/lib/tdlib/types/chat_active_stories.rb b/lib/tdlib/types/chat_active_stories.rb new file mode 100644 index 00000000..73bd87c6 --- /dev/null +++ b/lib/tdlib/types/chat_active_stories.rb @@ -0,0 +1,21 @@ +module TD::Types + # Describes active stories posted by a chat. + # + # @attr chat_id [Integer] Identifier of the chat that posted the stories. + # @attr list [TD::Types::StoryList, nil] Identifier of the story list in which the stories are shown; may be null if + # the stories aren't shown in a story list. + # @attr order [Integer] A parameter used to determine order of the stories in the story list; 0 if the stories + # doesn't need to be shown in the story list. + # Stories must be sorted by the pair (order, story_sender_chat_id) in descending order. + # @attr max_read_story_id [Integer] Identifier of the last read active story. + # @attr stories [Array] Basic information about the stories; use getStory to get full + # information about the stories. + # The stories are in chronological order (i.e., in order of increasing story identifiers). + class ChatActiveStories < Base + attribute :chat_id, TD::Types::Coercible::Integer + attribute :list, TD::Types::StoryList.optional.default(nil) + attribute :order, TD::Types::Coercible::Integer + attribute :max_read_story_id, TD::Types::Coercible::Integer + attribute :stories, TD::Types::Array.of(TD::Types::StoryInfo) + end +end diff --git a/lib/tdlib/types/chat_administrator_rights.rb b/lib/tdlib/types/chat_administrator_rights.rb new file mode 100644 index 00000000..f24dfaef --- /dev/null +++ b/lib/tdlib/types/chat_administrator_rights.rb @@ -0,0 +1,48 @@ +module TD::Types + # Describes rights of the administrator. + # + # @attr can_manage_chat [Boolean] True, if the administrator can access the chat event log, get boost list, see + # hidden supergroup and channel members, report supergroup spam messages and ignore slow mode. + # Implied by any other privilege; applicable to supergroups and channels only. + # @attr can_change_info [Boolean] True, if the administrator can change the chat title, photo, and other settings. + # @attr can_post_messages [Boolean] True, if the administrator can create channel posts or view channel statistics; + # applicable to channels only. + # @attr can_edit_messages [Boolean] True, if the administrator can edit messages of other users and pin messages; + # applicable to channels only. + # @attr can_delete_messages [Boolean] True, if the administrator can delete messages of other users. + # @attr can_invite_users [Boolean] True, if the administrator can invite new users to the chat. + # @attr can_restrict_members [Boolean] True, if the administrator can restrict, ban, or unban chat members or view + # supergroup statistics; always true for channels. + # @attr can_pin_messages [Boolean] True, if the administrator can pin messages; applicable to basic groups and + # supergroups only. + # @attr can_manage_topics [Boolean] True, if the administrator can create, rename, close, reopen, hide, and unhide + # forum topics; applicable to forum supergroups only. + # @attr can_promote_members [Boolean] True, if the administrator can add new administrators with a subset of their + # own privileges or demote administrators that were directly or indirectly promoted by them. + # @attr can_manage_video_chats [Boolean] True, if the administrator can manage video chats. + # @attr can_post_stories [Boolean] True, if the administrator can create new chat stories, or edit and delete posted + # stories; applicable to supergroups and channels only. + # @attr can_edit_stories [Boolean] True, if the administrator can edit stories posted by other users, post stories to + # the chat page, pin chat stories, and access story archive; applicable to supergroups and channels only. + # @attr can_delete_stories [Boolean] True, if the administrator can delete stories posted by other users; applicable + # to supergroups and channels only. + # @attr is_anonymous [Boolean] True, if the administrator isn't shown in the chat member list and sends messages + # anonymously; applicable to supergroups only. + class ChatAdministratorRights < Base + attribute :can_manage_chat, TD::Types::Bool + attribute :can_change_info, TD::Types::Bool + attribute :can_post_messages, TD::Types::Bool + attribute :can_edit_messages, TD::Types::Bool + attribute :can_delete_messages, TD::Types::Bool + attribute :can_invite_users, TD::Types::Bool + attribute :can_restrict_members, TD::Types::Bool + attribute :can_pin_messages, TD::Types::Bool + attribute :can_manage_topics, TD::Types::Bool + attribute :can_promote_members, TD::Types::Bool + attribute :can_manage_video_chats, TD::Types::Bool + attribute :can_post_stories, TD::Types::Bool + attribute :can_edit_stories, TD::Types::Bool + attribute :can_delete_stories, TD::Types::Bool + attribute :is_anonymous, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_available_reactions.rb b/lib/tdlib/types/chat_available_reactions.rb new file mode 100644 index 00000000..aa8db8fc --- /dev/null +++ b/lib/tdlib/types/chat_available_reactions.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes reactions available in the chat. + class ChatAvailableReactions < Base + %w[ + all + some + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/chat_available_reactions/#{type}" + end + end +end diff --git a/lib/tdlib/types/chat_available_reactions/all.rb b/lib/tdlib/types/chat_available_reactions/all.rb new file mode 100644 index 00000000..5256fba5 --- /dev/null +++ b/lib/tdlib/types/chat_available_reactions/all.rb @@ -0,0 +1,8 @@ +module TD::Types + # All reactions are available in the chat, excluding the paid reaction and custom reactions in channel chats. + # + # @attr max_reaction_count [Integer] The maximum allowed number of reactions per message; 1-11. + class ChatAvailableReactions::All < ChatAvailableReactions + attribute :max_reaction_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_available_reactions/some.rb b/lib/tdlib/types/chat_available_reactions/some.rb new file mode 100644 index 00000000..4d222737 --- /dev/null +++ b/lib/tdlib/types/chat_available_reactions/some.rb @@ -0,0 +1,10 @@ +module TD::Types + # Only specific reactions are available in the chat. + # + # @attr reactions [Array] The list of reactions. + # @attr max_reaction_count [Integer] The maximum allowed number of reactions per message; 1-11. + class ChatAvailableReactions::Some < ChatAvailableReactions + attribute :reactions, TD::Types::Array.of(TD::Types::ReactionType) + attribute :max_reaction_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_background.rb b/lib/tdlib/types/chat_background.rb new file mode 100644 index 00000000..1b1c8ced --- /dev/null +++ b/lib/tdlib/types/chat_background.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes a background set for a specific chat. + # + # @attr background [TD::Types::Background] The background. + # @attr dark_theme_dimming [Integer] Dimming of the background in dark themes, as a percentage; 0-100. + # Applied only to Wallpaper and Fill types of background. + class ChatBackground < Base + attribute :background, TD::Types::Background + attribute :dark_theme_dimming, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_boost.rb b/lib/tdlib/types/chat_boost.rb new file mode 100644 index 00000000..3a695bc3 --- /dev/null +++ b/lib/tdlib/types/chat_boost.rb @@ -0,0 +1,16 @@ +module TD::Types + # Describes a boost applied to a chat. + # + # @attr id [TD::Types::String] Unique identifier of the boost. + # @attr count [Integer] The number of identical boosts applied. + # @attr source [TD::Types::ChatBoostSource] Source of the boost. + # @attr start_date [Integer] Point in time (Unix timestamp) when the chat was boosted. + # @attr expiration_date [Integer] Point in time (Unix timestamp) when the boost will expire. + class ChatBoost < Base + attribute :id, TD::Types::String + attribute :count, TD::Types::Coercible::Integer + attribute :source, TD::Types::ChatBoostSource + attribute :start_date, TD::Types::Coercible::Integer + attribute :expiration_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_boost_features.rb b/lib/tdlib/types/chat_boost_features.rb new file mode 100644 index 00000000..c20de33f --- /dev/null +++ b/lib/tdlib/types/chat_boost_features.rb @@ -0,0 +1,30 @@ +module TD::Types + # Contains a list of features available on the first chat boost levels. + # + # @attr features [Array] The list of features. + # @attr min_profile_background_custom_emoji_boost_level [Integer] The minimum boost level required to set custom + # emoji for profile background. + # @attr min_background_custom_emoji_boost_level [Integer] The minimum boost level required to set custom emoji for + # reply header and link preview background; for channel chats only. + # @attr min_emoji_status_boost_level [Integer] The minimum boost level required to set emoji status. + # @attr min_chat_theme_background_boost_level [Integer] The minimum boost level required to set a chat theme + # background as chat background. + # @attr min_custom_background_boost_level [Integer] The minimum boost level required to set custom chat background. + # @attr min_custom_emoji_sticker_set_boost_level [Integer] The minimum boost level required to set custom emoji + # sticker set for the chat; for supergroup chats only. + # @attr min_speech_recognition_boost_level [Integer] The minimum boost level allowing to recognize speech in video + # note and voice note messages for non-Premium users; for supergroup chats only. + # @attr min_sponsored_message_disable_boost_level [Integer] The minimum boost level allowing to disable sponsored + # messages in the chat; for channel chats only. + class ChatBoostFeatures < Base + attribute :features, TD::Types::Array.of(TD::Types::ChatBoostLevelFeatures) + attribute :min_profile_background_custom_emoji_boost_level, TD::Types::Coercible::Integer + attribute :min_background_custom_emoji_boost_level, TD::Types::Coercible::Integer + attribute :min_emoji_status_boost_level, TD::Types::Coercible::Integer + attribute :min_chat_theme_background_boost_level, TD::Types::Coercible::Integer + attribute :min_custom_background_boost_level, TD::Types::Coercible::Integer + attribute :min_custom_emoji_sticker_set_boost_level, TD::Types::Coercible::Integer + attribute :min_speech_recognition_boost_level, TD::Types::Coercible::Integer + attribute :min_sponsored_message_disable_boost_level, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_boost_level_features.rb b/lib/tdlib/types/chat_boost_level_features.rb new file mode 100644 index 00000000..3468ba5d --- /dev/null +++ b/lib/tdlib/types/chat_boost_level_features.rb @@ -0,0 +1,38 @@ +module TD::Types + # Contains a list of features available on a specific chat boost level. + # + # @attr level [Integer] Target chat boost level. + # @attr story_per_day_count [Integer] Number of stories that the chat can publish daily. + # @attr custom_emoji_reaction_count [Integer] Number of custom emoji reactions that can be added to the list of + # available reactions. + # @attr title_color_count [Integer] Number of custom colors for chat title. + # @attr profile_accent_color_count [Integer] Number of custom colors for profile photo background. + # @attr can_set_profile_background_custom_emoji [Boolean] True, if custom emoji for profile background can be set. + # @attr accent_color_count [Integer] Number of custom colors for background of empty chat photo, replies to messages + # and link previews. + # @attr can_set_background_custom_emoji [Boolean] True, if custom emoji for reply header and link preview background + # can be set. + # @attr can_set_emoji_status [Boolean] True, if emoji status can be set. + # @attr chat_theme_background_count [Integer] Number of chat theme backgrounds that can be set as chat background. + # @attr can_set_custom_background [Boolean] True, if custom background can be set in the chat for all users. + # @attr can_set_custom_emoji_sticker_set [Boolean] True, if custom emoji sticker set can be set for the chat. + # @attr can_recognize_speech [Boolean] True, if speech recognition can be used for video note and voice note messages + # by all users. + # @attr can_disable_sponsored_messages [Boolean] True, if sponsored messages can be disabled in the chat. + class ChatBoostLevelFeatures < Base + attribute :level, TD::Types::Coercible::Integer + attribute :story_per_day_count, TD::Types::Coercible::Integer + attribute :custom_emoji_reaction_count, TD::Types::Coercible::Integer + attribute :title_color_count, TD::Types::Coercible::Integer + attribute :profile_accent_color_count, TD::Types::Coercible::Integer + attribute :can_set_profile_background_custom_emoji, TD::Types::Bool + attribute :accent_color_count, TD::Types::Coercible::Integer + attribute :can_set_background_custom_emoji, TD::Types::Bool + attribute :can_set_emoji_status, TD::Types::Bool + attribute :chat_theme_background_count, TD::Types::Coercible::Integer + attribute :can_set_custom_background, TD::Types::Bool + attribute :can_set_custom_emoji_sticker_set, TD::Types::Bool + attribute :can_recognize_speech, TD::Types::Bool + attribute :can_disable_sponsored_messages, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_boost_link.rb b/lib/tdlib/types/chat_boost_link.rb new file mode 100644 index 00000000..7ee14413 --- /dev/null +++ b/lib/tdlib/types/chat_boost_link.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains an HTTPS link to boost a chat. + # + # @attr link [TD::Types::String] The link. + # @attr is_public [Boolean] True, if the link will work for non-members of the chat. + class ChatBoostLink < Base + attribute :link, TD::Types::String + attribute :is_public, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_boost_link_info.rb b/lib/tdlib/types/chat_boost_link_info.rb new file mode 100644 index 00000000..40015ae2 --- /dev/null +++ b/lib/tdlib/types/chat_boost_link_info.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about a link to boost a chat. + # + # @attr is_public [Boolean] True, if the link will work for non-members of the chat. + # @attr chat_id [Integer] Identifier of the chat to which the link points; 0 if the chat isn't found. + class ChatBoostLinkInfo < Base + attribute :is_public, TD::Types::Bool + attribute :chat_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_boost_slot.rb b/lib/tdlib/types/chat_boost_slot.rb new file mode 100644 index 00000000..2ab9b29b --- /dev/null +++ b/lib/tdlib/types/chat_boost_slot.rb @@ -0,0 +1,17 @@ +module TD::Types + # Describes a slot for chat boost. + # + # @attr slot_id [Integer] Unique identifier of the slot. + # @attr currently_boosted_chat_id [Integer] Identifier of the currently boosted chat; 0 if none. + # @attr start_date [Integer] Point in time (Unix timestamp) when the chat was boosted; 0 if none. + # @attr expiration_date [Integer] Point in time (Unix timestamp) when the boost will expire. + # @attr cooldown_until_date [Integer] Point in time (Unix timestamp) after which the boost can be used for another + # chat. + class ChatBoostSlot < Base + attribute :slot_id, TD::Types::Coercible::Integer + attribute :currently_boosted_chat_id, TD::Types::Coercible::Integer + attribute :start_date, TD::Types::Coercible::Integer + attribute :expiration_date, TD::Types::Coercible::Integer + attribute :cooldown_until_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_boost_slots.rb b/lib/tdlib/types/chat_boost_slots.rb new file mode 100644 index 00000000..d94a5f2e --- /dev/null +++ b/lib/tdlib/types/chat_boost_slots.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of chat boost slots. + # + # @attr slots [Array] List of boost slots. + class ChatBoostSlots < Base + attribute :slots, TD::Types::Array.of(TD::Types::ChatBoostSlot) + end +end diff --git a/lib/tdlib/types/chat_boost_source.rb b/lib/tdlib/types/chat_boost_source.rb new file mode 100644 index 00000000..59a58030 --- /dev/null +++ b/lib/tdlib/types/chat_boost_source.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes source of a chat boost. + class ChatBoostSource < Base + %w[ + gift_code + giveaway + premium + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/chat_boost_source/#{type}" + end + end +end diff --git a/lib/tdlib/types/chat_boost_source/gift_code.rb b/lib/tdlib/types/chat_boost_source/gift_code.rb new file mode 100644 index 00000000..5c8af68f --- /dev/null +++ b/lib/tdlib/types/chat_boost_source/gift_code.rb @@ -0,0 +1,11 @@ +module TD::Types + # The chat created a Telegram Premium gift code for a user. + # + # @attr user_id [Integer] Identifier of a user, for which the gift code was created. + # @attr gift_code [TD::Types::String] The created Telegram Premium gift code, which is known only if this is a gift + # code for the current user, or it has already been claimed. + class ChatBoostSource::GiftCode < ChatBoostSource + attribute :user_id, TD::Types::Coercible::Integer + attribute :gift_code, TD::Types::String + end +end diff --git a/lib/tdlib/types/chat_boost_source/giveaway.rb b/lib/tdlib/types/chat_boost_source/giveaway.rb new file mode 100644 index 00000000..31438968 --- /dev/null +++ b/lib/tdlib/types/chat_boost_source/giveaway.rb @@ -0,0 +1,17 @@ +module TD::Types + # The chat created a Telegram Premium giveaway. + # + # @attr user_id [Integer] Identifier of a user that won in the giveaway; 0 if none. + # @attr gift_code [TD::Types::String] The created Telegram Premium gift code if it was used by the user or can be + # claimed by the current user; an empty string otherwise. + # @attr giveaway_message_id [Integer] Identifier of the corresponding giveaway message; can be an identifier of a + # deleted message. + # @attr is_unclaimed [Boolean] True, if the winner for the corresponding Telegram Premium subscription wasn't chosen, + # because there were not enough participants. + class ChatBoostSource::Giveaway < ChatBoostSource + attribute :user_id, TD::Types::Coercible::Integer + attribute :gift_code, TD::Types::String + attribute :giveaway_message_id, TD::Types::Coercible::Integer + attribute :is_unclaimed, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_boost_source/premium.rb b/lib/tdlib/types/chat_boost_source/premium.rb new file mode 100644 index 00000000..21d484fe --- /dev/null +++ b/lib/tdlib/types/chat_boost_source/premium.rb @@ -0,0 +1,8 @@ +module TD::Types + # A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat. + # + # @attr user_id [Integer] Identifier of the user. + class ChatBoostSource::Premium < ChatBoostSource + attribute :user_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_boost_status.rb b/lib/tdlib/types/chat_boost_status.rb new file mode 100644 index 00000000..be1b593c --- /dev/null +++ b/lib/tdlib/types/chat_boost_status.rb @@ -0,0 +1,31 @@ +module TD::Types + # Describes current boost status of a chat. + # + # @attr boost_url [TD::Types::String] An HTTP URL, which can be used to boost the chat. + # @attr applied_slot_ids [Array] Identifiers of boost slots of the current user applied to the chat. + # @attr level [Integer] Current boost level of the chat. + # @attr gift_code_boost_count [Integer] The number of boosts received by the chat from created Telegram Premium gift + # codes and giveaways; always 0 if the current user isn't an administrator in the chat. + # @attr boost_count [Integer] The number of boosts received by the chat. + # @attr current_level_boost_count [Integer] The number of boosts added to reach the current level. + # @attr next_level_boost_count [Integer] The number of boosts needed to reach the next level; 0 if the next level + # isn't available. + # @attr premium_member_count [Integer] Approximate number of Telegram Premium subscribers joined the chat; always 0 + # if the current user isn't an administrator in the chat. + # @attr premium_member_percentage [Float] A percentage of Telegram Premium subscribers joined the chat; always 0 if + # the current user isn't an administrator in the chat. + # @attr prepaid_giveaways [Array] The list of prepaid giveaways available for the + # chat; only for chat administrators. + class ChatBoostStatus < Base + attribute :boost_url, TD::Types::String + attribute :applied_slot_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :level, TD::Types::Coercible::Integer + attribute :gift_code_boost_count, TD::Types::Coercible::Integer + attribute :boost_count, TD::Types::Coercible::Integer + attribute :current_level_boost_count, TD::Types::Coercible::Integer + attribute :next_level_boost_count, TD::Types::Coercible::Integer + attribute :premium_member_count, TD::Types::Coercible::Integer + attribute :premium_member_percentage, TD::Types::Coercible::Float + attribute :prepaid_giveaways, TD::Types::Array.of(TD::Types::PrepaidPremiumGiveaway) + end +end diff --git a/lib/tdlib/types/chat_event.rb b/lib/tdlib/types/chat_event.rb index b02f0d7f..28662d37 100644 --- a/lib/tdlib/types/chat_event.rb +++ b/lib/tdlib/types/chat_event.rb @@ -3,12 +3,12 @@ module TD::Types # # @attr id [Integer] Chat event identifier. # @attr date [Integer] Point in time (Unix timestamp) when the event happened. - # @attr user_id [Integer] Identifier of the user who performed the action that triggered the event. - # @attr action [TD::Types::ChatEventAction] Action performed by the user. + # @attr member_id [TD::Types::MessageSender] Identifier of the user or chat who performed the action. + # @attr action [TD::Types::ChatEventAction] The action. class ChatEvent < Base attribute :id, TD::Types::Coercible::Integer attribute :date, TD::Types::Coercible::Integer - attribute :user_id, TD::Types::Coercible::Integer + attribute :member_id, TD::Types::MessageSender attribute :action, TD::Types::ChatEventAction end end diff --git a/lib/tdlib/types/chat_event_action.rb b/lib/tdlib/types/chat_event_action.rb index b37e629d..16f74f9e 100644 --- a/lib/tdlib/types/chat_event_action.rb +++ b/lib/tdlib/types/chat_event_action.rb @@ -4,36 +4,54 @@ class ChatEventAction < Base %w[ message_edited message_deleted - poll_stopped message_pinned message_unpinned + poll_stopped member_joined member_joined_by_invite_link - member_left + member_joined_by_request member_invited + member_left member_promoted member_restricted - title_changed - permissions_changed + available_reactions_changed + background_changed description_changed - username_changed - photo_changed - invites_toggled + emoji_status_changed linked_chat_changed + location_changed + message_auto_delete_time_changed + permissions_changed + photo_changed slow_mode_delay_changed - message_ttl_setting_changed - sign_messages_toggled sticker_set_changed - location_changed + custom_emoji_sticker_set_changed + title_changed + username_changed + active_usernames_changed + accent_color_changed + profile_accent_color_changed + has_protected_content_toggled + invites_toggled is_all_history_available_toggled + has_aggressive_anti_spam_enabled_toggled + sign_messages_toggled + show_message_sender_toggled 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_ended + video_chat_mute_new_participants_toggled + video_chat_participant_is_muted_toggled + video_chat_participant_volume_level_changed + is_forum_toggled + forum_topic_created + forum_topic_edited + forum_topic_toggle_is_closed + forum_topic_toggle_is_hidden + forum_topic_deleted + forum_topic_pinned ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/chat_event_action/#{type}" end diff --git a/lib/tdlib/types/chat_event_action/accent_color_changed.rb b/lib/tdlib/types/chat_event_action/accent_color_changed.rb new file mode 100644 index 00000000..2bd40126 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/accent_color_changed.rb @@ -0,0 +1,14 @@ +module TD::Types + # The chat accent color or background custom emoji were changed. + # + # @attr old_accent_color_id [Integer] Previous identifier of chat accent color. + # @attr old_background_custom_emoji_id [Integer] Previous identifier of the custom emoji; 0 if none. + # @attr new_accent_color_id [Integer] New identifier of chat accent color. + # @attr new_background_custom_emoji_id [Integer] New identifier of the custom emoji; 0 if none. + class ChatEventAction::AccentColorChanged < ChatEventAction + attribute :old_accent_color_id, TD::Types::Coercible::Integer + attribute :old_background_custom_emoji_id, TD::Types::Coercible::Integer + attribute :new_accent_color_id, TD::Types::Coercible::Integer + attribute :new_background_custom_emoji_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_event_action/active_usernames_changed.rb b/lib/tdlib/types/chat_event_action/active_usernames_changed.rb new file mode 100644 index 00000000..28c43929 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/active_usernames_changed.rb @@ -0,0 +1,10 @@ +module TD::Types + # The chat active usernames were changed. + # + # @attr old_usernames [Array] Previous list of active usernames. + # @attr new_usernames [Array] New list of active usernames. + class ChatEventAction::ActiveUsernamesChanged < ChatEventAction + attribute :old_usernames, TD::Types::Array.of(TD::Types::String) + attribute :new_usernames, TD::Types::Array.of(TD::Types::String) + end +end diff --git a/lib/tdlib/types/chat_event_action/available_reactions_changed.rb b/lib/tdlib/types/chat_event_action/available_reactions_changed.rb new file mode 100644 index 00000000..15354d13 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/available_reactions_changed.rb @@ -0,0 +1,10 @@ +module TD::Types + # The chat available reactions were changed. + # + # @attr old_available_reactions [TD::Types::ChatAvailableReactions] Previous chat available reactions. + # @attr new_available_reactions [TD::Types::ChatAvailableReactions] New chat available reactions. + class ChatEventAction::AvailableReactionsChanged < ChatEventAction + attribute :old_available_reactions, TD::Types::ChatAvailableReactions + attribute :new_available_reactions, TD::Types::ChatAvailableReactions + end +end diff --git a/lib/tdlib/types/chat_event_action/background_changed.rb b/lib/tdlib/types/chat_event_action/background_changed.rb new file mode 100644 index 00000000..8aa1c872 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/background_changed.rb @@ -0,0 +1,10 @@ +module TD::Types + # The chat background was changed. + # + # @attr old_background [TD::Types::ChatBackground, nil] Previous background; may be null if none. + # @attr new_background [TD::Types::ChatBackground, nil] New background; may be null if none. + class ChatEventAction::BackgroundChanged < ChatEventAction + attribute :old_background, TD::Types::ChatBackground.optional.default(nil) + attribute :new_background, TD::Types::ChatBackground.optional.default(nil) + end +end diff --git a/lib/tdlib/types/chat_event_action/custom_emoji_sticker_set_changed.rb b/lib/tdlib/types/chat_event_action/custom_emoji_sticker_set_changed.rb new file mode 100644 index 00000000..69cb1ce3 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/custom_emoji_sticker_set_changed.rb @@ -0,0 +1,10 @@ +module TD::Types + # The supergroup sticker set with allowed custom emoji was changed. + # + # @attr old_sticker_set_id [Integer] Previous identifier of the chat sticker set; 0 if none. + # @attr new_sticker_set_id [Integer] New identifier of the chat sticker set; 0 if none. + class ChatEventAction::CustomEmojiStickerSetChanged < ChatEventAction + attribute :old_sticker_set_id, TD::Types::Coercible::Integer + attribute :new_sticker_set_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_event_action/emoji_status_changed.rb b/lib/tdlib/types/chat_event_action/emoji_status_changed.rb new file mode 100644 index 00000000..20828b99 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/emoji_status_changed.rb @@ -0,0 +1,10 @@ +module TD::Types + # The chat emoji status was changed. + # + # @attr old_emoji_status [TD::Types::EmojiStatus, nil] Previous emoji status; may be null if none. + # @attr new_emoji_status [TD::Types::EmojiStatus, nil] New emoji status; may be null if none. + class ChatEventAction::EmojiStatusChanged < ChatEventAction + attribute :old_emoji_status, TD::Types::EmojiStatus.optional.default(nil) + attribute :new_emoji_status, TD::Types::EmojiStatus.optional.default(nil) + end +end diff --git a/lib/tdlib/types/chat_event_action/forum_topic_created.rb b/lib/tdlib/types/chat_event_action/forum_topic_created.rb new file mode 100644 index 00000000..583e23e1 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/forum_topic_created.rb @@ -0,0 +1,8 @@ +module TD::Types + # A new forum topic was created. + # + # @attr topic_info [TD::Types::ForumTopicInfo] Information about the topic. + class ChatEventAction::ForumTopicCreated < ChatEventAction + attribute :topic_info, TD::Types::ForumTopicInfo + end +end diff --git a/lib/tdlib/types/chat_event_action/forum_topic_deleted.rb b/lib/tdlib/types/chat_event_action/forum_topic_deleted.rb new file mode 100644 index 00000000..036db56d --- /dev/null +++ b/lib/tdlib/types/chat_event_action/forum_topic_deleted.rb @@ -0,0 +1,8 @@ +module TD::Types + # A forum topic was deleted. + # + # @attr topic_info [TD::Types::ForumTopicInfo] Information about the topic. + class ChatEventAction::ForumTopicDeleted < ChatEventAction + attribute :topic_info, TD::Types::ForumTopicInfo + end +end diff --git a/lib/tdlib/types/chat_event_action/forum_topic_edited.rb b/lib/tdlib/types/chat_event_action/forum_topic_edited.rb new file mode 100644 index 00000000..2ecbb469 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/forum_topic_edited.rb @@ -0,0 +1,10 @@ +module TD::Types + # A forum topic was edited. + # + # @attr old_topic_info [TD::Types::ForumTopicInfo] Old information about the topic. + # @attr new_topic_info [TD::Types::ForumTopicInfo] New information about the topic. + class ChatEventAction::ForumTopicEdited < ChatEventAction + attribute :old_topic_info, TD::Types::ForumTopicInfo + attribute :new_topic_info, TD::Types::ForumTopicInfo + end +end diff --git a/lib/tdlib/types/chat_event_action/forum_topic_pinned.rb b/lib/tdlib/types/chat_event_action/forum_topic_pinned.rb new file mode 100644 index 00000000..cb3f318f --- /dev/null +++ b/lib/tdlib/types/chat_event_action/forum_topic_pinned.rb @@ -0,0 +1,10 @@ +module TD::Types + # A pinned forum topic was changed. + # + # @attr old_topic_info [TD::Types::ForumTopicInfo, nil] Information about the old pinned topic; may be null. + # @attr new_topic_info [TD::Types::ForumTopicInfo, nil] Information about the new pinned topic; may be null. + class ChatEventAction::ForumTopicPinned < ChatEventAction + attribute :old_topic_info, TD::Types::ForumTopicInfo.optional.default(nil) + attribute :new_topic_info, TD::Types::ForumTopicInfo.optional.default(nil) + end +end diff --git a/lib/tdlib/types/chat_event_action/forum_topic_toggle_is_closed.rb b/lib/tdlib/types/chat_event_action/forum_topic_toggle_is_closed.rb new file mode 100644 index 00000000..4569b585 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/forum_topic_toggle_is_closed.rb @@ -0,0 +1,8 @@ +module TD::Types + # A forum topic was closed or reopened. + # + # @attr topic_info [TD::Types::ForumTopicInfo] New information about the topic. + class ChatEventAction::ForumTopicToggleIsClosed < ChatEventAction + attribute :topic_info, TD::Types::ForumTopicInfo + end +end diff --git a/lib/tdlib/types/chat_event_action/forum_topic_toggle_is_hidden.rb b/lib/tdlib/types/chat_event_action/forum_topic_toggle_is_hidden.rb new file mode 100644 index 00000000..bb013706 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/forum_topic_toggle_is_hidden.rb @@ -0,0 +1,8 @@ +module TD::Types + # The General forum topic was hidden or unhidden. + # + # @attr topic_info [TD::Types::ForumTopicInfo] New information about the topic. + class ChatEventAction::ForumTopicToggleIsHidden < ChatEventAction + attribute :topic_info, TD::Types::ForumTopicInfo + end +end diff --git a/lib/tdlib/types/chat_event_action/has_aggressive_anti_spam_enabled_toggled.rb b/lib/tdlib/types/chat_event_action/has_aggressive_anti_spam_enabled_toggled.rb new file mode 100644 index 00000000..65308762 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/has_aggressive_anti_spam_enabled_toggled.rb @@ -0,0 +1,8 @@ +module TD::Types + # The has_aggressive_anti_spam_enabled setting of a supergroup was toggled. + # + # @attr has_aggressive_anti_spam_enabled [Boolean] New value of has_aggressive_anti_spam_enabled. + class ChatEventAction::HasAggressiveAntiSpamEnabledToggled < ChatEventAction + attribute :has_aggressive_anti_spam_enabled, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_event_action/has_protected_content_toggled.rb b/lib/tdlib/types/chat_event_action/has_protected_content_toggled.rb new file mode 100644 index 00000000..4528e9a7 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/has_protected_content_toggled.rb @@ -0,0 +1,8 @@ +module TD::Types + # The has_protected_content setting of a channel was toggled. + # + # @attr has_protected_content [Boolean] New value of has_protected_content. + class ChatEventAction::HasProtectedContentToggled < ChatEventAction + attribute :has_protected_content, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_event_action/is_forum_toggled.rb b/lib/tdlib/types/chat_event_action/is_forum_toggled.rb new file mode 100644 index 00000000..5bee6440 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/is_forum_toggled.rb @@ -0,0 +1,8 @@ +module TD::Types + # The is_forum setting of a channel was toggled. + # + # @attr is_forum [Boolean] New value of is_forum. + class ChatEventAction::IsForumToggled < ChatEventAction + attribute :is_forum, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_event_action/member_joined_by_invite_link.rb b/lib/tdlib/types/chat_event_action/member_joined_by_invite_link.rb index fb8c54d8..9b8ec68f 100644 --- a/lib/tdlib/types/chat_event_action/member_joined_by_invite_link.rb +++ b/lib/tdlib/types/chat_event_action/member_joined_by_invite_link.rb @@ -1,8 +1,11 @@ module TD::Types - # A new member joined the chat by an invite link. + # A new member joined the chat via an invite link. # # @attr invite_link [TD::Types::ChatInviteLink] Invite link used to join the chat. + # @attr via_chat_folder_invite_link [Boolean] True, if the user has joined the chat using an invite link for a chat + # folder. class ChatEventAction::MemberJoinedByInviteLink < ChatEventAction attribute :invite_link, TD::Types::ChatInviteLink + attribute :via_chat_folder_invite_link, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_event_action/member_joined_by_request.rb b/lib/tdlib/types/chat_event_action/member_joined_by_request.rb new file mode 100644 index 00000000..6040b764 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/member_joined_by_request.rb @@ -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 diff --git a/lib/tdlib/types/chat_event_action/message_auto_delete_time_changed.rb b/lib/tdlib/types/chat_event_action/message_auto_delete_time_changed.rb new file mode 100644 index 00000000..681f9afd --- /dev/null +++ b/lib/tdlib/types/chat_event_action/message_auto_delete_time_changed.rb @@ -0,0 +1,10 @@ +module TD::Types + # The message auto-delete timer was changed. + # + # @attr old_message_auto_delete_time [Integer] Previous value of message_auto_delete_time. + # @attr new_message_auto_delete_time [Integer] New value of message_auto_delete_time. + class ChatEventAction::MessageAutoDeleteTimeChanged < ChatEventAction + attribute :old_message_auto_delete_time, TD::Types::Coercible::Integer + attribute :new_message_auto_delete_time, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_event_action/message_deleted.rb b/lib/tdlib/types/chat_event_action/message_deleted.rb index 3e8710b3..095b8ceb 100644 --- a/lib/tdlib/types/chat_event_action/message_deleted.rb +++ b/lib/tdlib/types/chat_event_action/message_deleted.rb @@ -2,7 +2,10 @@ module TD::Types # A message was deleted. # # @attr message [TD::Types::Message] Deleted message. + # @attr can_report_anti_spam_false_positive [Boolean] True, if the message deletion can be reported via + # reportSupergroupAntiSpamFalsePositive. class ChatEventAction::MessageDeleted < ChatEventAction attribute :message, TD::Types::Message + attribute :can_report_anti_spam_false_positive, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_event_action/message_ttl_setting_changed.rb b/lib/tdlib/types/chat_event_action/message_ttl_setting_changed.rb deleted file mode 100644 index fc9e3687..00000000 --- a/lib/tdlib/types/chat_event_action/message_ttl_setting_changed.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # The message TTL setting was changed. - # - # @attr old_message_ttl_setting [Integer] Previous value of message_ttl_setting. - # @attr new_message_ttl_setting [Integer] New value of message_ttl_setting. - class ChatEventAction::MessageTtlSettingChanged < ChatEventAction - attribute :old_message_ttl_setting, TD::Types::Coercible::Integer - attribute :new_message_ttl_setting, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/chat_event_action/permissions_changed.rb b/lib/tdlib/types/chat_event_action/permissions_changed.rb index 2d991812..36dc2c91 100644 --- a/lib/tdlib/types/chat_event_action/permissions_changed.rb +++ b/lib/tdlib/types/chat_event_action/permissions_changed.rb @@ -1,5 +1,5 @@ module TD::Types - # The chat permissions was changed. + # The chat permissions were changed. # # @attr old_permissions [TD::Types::ChatPermissions] Previous chat permissions. # @attr new_permissions [TD::Types::ChatPermissions] New chat permissions. diff --git a/lib/tdlib/types/chat_event_action/profile_accent_color_changed.rb b/lib/tdlib/types/chat_event_action/profile_accent_color_changed.rb new file mode 100644 index 00000000..5b76505c --- /dev/null +++ b/lib/tdlib/types/chat_event_action/profile_accent_color_changed.rb @@ -0,0 +1,14 @@ +module TD::Types + # The chat's profile accent color or profile background custom emoji were changed. + # + # @attr old_profile_accent_color_id [Integer] Previous identifier of chat's profile accent color; -1 if none. + # @attr old_profile_background_custom_emoji_id [Integer] Previous identifier of the custom emoji; 0 if none. + # @attr new_profile_accent_color_id [Integer] New identifier of chat's profile accent color; -1 if none. + # @attr new_profile_background_custom_emoji_id [Integer] New identifier of the custom emoji; 0 if none. + class ChatEventAction::ProfileAccentColorChanged < ChatEventAction + attribute :old_profile_accent_color_id, TD::Types::Coercible::Integer + attribute :old_profile_background_custom_emoji_id, TD::Types::Coercible::Integer + attribute :new_profile_accent_color_id, TD::Types::Coercible::Integer + attribute :new_profile_background_custom_emoji_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_event_action/show_message_sender_toggled.rb b/lib/tdlib/types/chat_event_action/show_message_sender_toggled.rb new file mode 100644 index 00000000..7a0392e6 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/show_message_sender_toggled.rb @@ -0,0 +1,8 @@ +module TD::Types + # The show_message_sender setting of a channel was toggled. + # + # @attr show_message_sender [Boolean] New value of show_message_sender. + class ChatEventAction::ShowMessageSenderToggled < ChatEventAction + attribute :show_message_sender, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb b/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb index 929d4f53..374a09f5 100644 --- a/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb +++ b/lib/tdlib/types/chat_event_action/slow_mode_delay_changed.rb @@ -1,8 +1,8 @@ module TD::Types # The slow_mode_delay setting of a supergroup was changed. # - # @attr old_slow_mode_delay [Integer] Previous value of slow_mode_delay. - # @attr new_slow_mode_delay [Integer] New value of slow_mode_delay. + # @attr old_slow_mode_delay [Integer] Previous value of slow_mode_delay, in seconds. + # @attr new_slow_mode_delay [Integer] New value of slow_mode_delay, in seconds. class ChatEventAction::SlowModeDelayChanged < ChatEventAction attribute :old_slow_mode_delay, TD::Types::Coercible::Integer attribute :new_slow_mode_delay, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/chat_event_action/username_changed.rb b/lib/tdlib/types/chat_event_action/username_changed.rb index 78a6e1cd..43cdbf92 100644 --- a/lib/tdlib/types/chat_event_action/username_changed.rb +++ b/lib/tdlib/types/chat_event_action/username_changed.rb @@ -1,5 +1,5 @@ module TD::Types - # The chat username was changed. + # The chat editable username was changed. # # @attr old_username [TD::Types::String] Previous chat username. # @attr new_username [TD::Types::String] New chat username. diff --git a/lib/tdlib/types/chat_event_action/video_chat_created.rb b/lib/tdlib/types/chat_event_action/video_chat_created.rb new file mode 100644 index 00000000..dbdd8866 --- /dev/null +++ b/lib/tdlib/types/chat_event_action/video_chat_created.rb @@ -0,0 +1,9 @@ +module TD::Types + # A video chat was created. + # + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. + class ChatEventAction::VideoChatCreated < ChatEventAction + attribute :group_call_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_event_action/video_chat_ended.rb b/lib/tdlib/types/chat_event_action/video_chat_ended.rb new file mode 100644 index 00000000..a649b17a --- /dev/null +++ b/lib/tdlib/types/chat_event_action/video_chat_ended.rb @@ -0,0 +1,9 @@ +module TD::Types + # A video chat was ended. + # + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. + class ChatEventAction::VideoChatEnded < ChatEventAction + attribute :group_call_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_mute_new_participants_toggled.rb b/lib/tdlib/types/chat_event_action/video_chat_mute_new_participants_toggled.rb similarity index 60% rename from lib/tdlib/types/chat_event_action/voice_chat_mute_new_participants_toggled.rb rename to lib/tdlib/types/chat_event_action/video_chat_mute_new_participants_toggled.rb index f13d09b8..2eccea64 100644 --- a/lib/tdlib/types/chat_event_action/voice_chat_mute_new_participants_toggled.rb +++ b/lib/tdlib/types/chat_event_action/video_chat_mute_new_participants_toggled.rb @@ -1,8 +1,8 @@ module TD::Types - # The mute_new_participants setting of a voice chat was toggled. + # The mute_new_participants setting of a video chat was toggled. # # @attr mute_new_participants [Boolean] New value of the mute_new_participants setting. - class ChatEventAction::VoiceChatMuteNewParticipantsToggled < ChatEventAction + class ChatEventAction::VideoChatMuteNewParticipantsToggled < ChatEventAction attribute :mute_new_participants, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_participant_is_muted_toggled.rb b/lib/tdlib/types/chat_event_action/video_chat_participant_is_muted_toggled.rb similarity index 72% rename from lib/tdlib/types/chat_event_action/voice_chat_participant_is_muted_toggled.rb rename to lib/tdlib/types/chat_event_action/video_chat_participant_is_muted_toggled.rb index bb34c01f..55badb17 100644 --- a/lib/tdlib/types/chat_event_action/voice_chat_participant_is_muted_toggled.rb +++ b/lib/tdlib/types/chat_event_action/video_chat_participant_is_muted_toggled.rb @@ -1,9 +1,9 @@ module TD::Types - # A voice chat participant was muted or unmuted. + # A video chat participant was muted or unmuted. # # @attr participant_id [TD::Types::MessageSender] Identifier of the affected group call participant. # @attr is_muted [Boolean] New value of is_muted. - class ChatEventAction::VoiceChatParticipantIsMutedToggled < ChatEventAction + class ChatEventAction::VideoChatParticipantIsMutedToggled < ChatEventAction attribute :participant_id, TD::Types::MessageSender attribute :is_muted, TD::Types::Bool end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_participant_volume_level_changed.rb b/lib/tdlib/types/chat_event_action/video_chat_participant_volume_level_changed.rb similarity index 75% rename from lib/tdlib/types/chat_event_action/voice_chat_participant_volume_level_changed.rb rename to lib/tdlib/types/chat_event_action/video_chat_participant_volume_level_changed.rb index 2f27f977..21b17509 100644 --- a/lib/tdlib/types/chat_event_action/voice_chat_participant_volume_level_changed.rb +++ b/lib/tdlib/types/chat_event_action/video_chat_participant_volume_level_changed.rb @@ -1,9 +1,9 @@ module TD::Types - # A voice chat participant volume level was changed. + # A video chat participant volume level was changed. # # @attr participant_id [TD::Types::MessageSender] Identifier of the affected group call participant. # @attr volume_level [Integer] New value of volume_level; 1-20000 in hundreds of percents. - class ChatEventAction::VoiceChatParticipantVolumeLevelChanged < ChatEventAction + class ChatEventAction::VideoChatParticipantVolumeLevelChanged < ChatEventAction attribute :participant_id, TD::Types::MessageSender attribute :volume_level, TD::Types::Coercible::Integer end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_created.rb b/lib/tdlib/types/chat_event_action/voice_chat_created.rb deleted file mode 100644 index 08562301..00000000 --- a/lib/tdlib/types/chat_event_action/voice_chat_created.rb +++ /dev/null @@ -1,9 +0,0 @@ -module TD::Types - # A voice chat was created. - # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. - class ChatEventAction::VoiceChatCreated < ChatEventAction - attribute :group_call_id, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/chat_event_action/voice_chat_discarded.rb b/lib/tdlib/types/chat_event_action/voice_chat_discarded.rb deleted file mode 100644 index 09f35aa7..00000000 --- a/lib/tdlib/types/chat_event_action/voice_chat_discarded.rb +++ /dev/null @@ -1,9 +0,0 @@ -module TD::Types - # A voice chat was discarded. - # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. - class ChatEventAction::VoiceChatDiscarded < ChatEventAction - attribute :group_call_id, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/chat_event_log_filters.rb b/lib/tdlib/types/chat_event_log_filters.rb index fdae18af..2d8a3d08 100644 --- a/lib/tdlib/types/chat_event_log_filters.rb +++ b/lib/tdlib/types/chat_event_log_filters.rb @@ -1,19 +1,20 @@ module TD::Types # Represents a set of filters used to obtain a chat event log. # - # @attr message_edits [Boolean] True, if message edits should be returned. - # @attr message_deletions [Boolean] True, if message deletions should be returned. - # @attr message_pins [Boolean] True, if pin/unpin events should be returned. - # @attr member_joins [Boolean] True, if members joining events should be returned. - # @attr member_leaves [Boolean] True, if members leaving events should be returned. - # @attr member_invites [Boolean] True, if invited member events should be returned. - # @attr member_promotions [Boolean] True, if member promotion/demotion events should be returned. - # @attr member_restrictions [Boolean] True, if member restricted/unrestricted/banned/unbanned events should be + # @attr message_edits [Boolean] True, if message edits need to be returned. + # @attr message_deletions [Boolean] True, if message deletions need to be returned. + # @attr message_pins [Boolean] True, if pin/unpin events need to be returned. + # @attr member_joins [Boolean] True, if members joining events need to be returned. + # @attr member_leaves [Boolean] True, if members leaving events need to be returned. + # @attr member_invites [Boolean] True, if invited member events need to be returned. + # @attr member_promotions [Boolean] True, if member promotion/demotion events need to be returned. + # @attr member_restrictions [Boolean] True, if member restricted/unrestricted/banned/unbanned events need to be # returned. - # @attr info_changes [Boolean] True, if changes in chat information should be returned. - # @attr setting_changes [Boolean] True, if changes in chat settings should be returned. - # @attr invite_link_changes [Boolean] True, if changes to invite links should be returned. - # @attr voice_chat_changes [Boolean] True, if voice chat actions should be returned. + # @attr info_changes [Boolean] True, if changes in chat information need to be returned. + # @attr setting_changes [Boolean] True, if changes in chat settings need to be returned. + # @attr invite_link_changes [Boolean] True, if changes to invite links need to be returned. + # @attr video_chat_changes [Boolean] True, if video chat actions need to be returned. + # @attr forum_changes [Boolean] True, if forum-related actions need to be returned. class ChatEventLogFilters < Base attribute :message_edits, TD::Types::Bool attribute :message_deletions, TD::Types::Bool @@ -26,6 +27,7 @@ class ChatEventLogFilters < Base attribute :info_changes, TD::Types::Bool attribute :setting_changes, TD::Types::Bool attribute :invite_link_changes, TD::Types::Bool - attribute :voice_chat_changes, TD::Types::Bool + attribute :video_chat_changes, TD::Types::Bool + attribute :forum_changes, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_filter.rb b/lib/tdlib/types/chat_filter.rb deleted file mode 100644 index 1822a7ee..00000000 --- a/lib/tdlib/types/chat_filter.rb +++ /dev/null @@ -1,36 +0,0 @@ -module TD::Types - # Represents a filter of user chats. - # - # @attr title [TD::Types::String] The title of the filter; 1-12 characters without line feeds. - # @attr icon_name [TD::Types::String, nil] The icon name for short filter representation. - # If non-empty, must be one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", - # "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", - # "Travel", "Work". - # If empty, use getChatFilterDefaultIconName to get default icon name for the filter. - # @attr pinned_chat_ids [Array] The chat identifiers of pinned chats in the filtered chat list. - # @attr included_chat_ids [Array] The chat identifiers of always included chats in the filtered chat list. - # @attr excluded_chat_ids [Array] The chat identifiers of always excluded chats in the filtered chat list. - # @attr exclude_muted [Boolean] True, if muted chats need to be excluded. - # @attr exclude_read [Boolean] True, if read chats need to be excluded. - # @attr exclude_archived [Boolean] True, if archived chats need to be excluded. - # @attr include_contacts [Boolean] True, if contacts need to be included. - # @attr include_non_contacts [Boolean] True, if non-contact users need to be included. - # @attr include_bots [Boolean] True, if bots need to be included. - # @attr include_groups [Boolean] True, if basic groups and supergroups need to be included. - # @attr include_channels [Boolean] True, if channels need to be included. - class ChatFilter < Base - attribute :title, TD::Types::String - attribute :icon_name, TD::Types::String.optional.default(nil) - attribute :pinned_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) - attribute :included_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) - attribute :excluded_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) - attribute :exclude_muted, TD::Types::Bool - attribute :exclude_read, TD::Types::Bool - attribute :exclude_archived, TD::Types::Bool - attribute :include_contacts, TD::Types::Bool - attribute :include_non_contacts, TD::Types::Bool - attribute :include_bots, TD::Types::Bool - attribute :include_groups, TD::Types::Bool - attribute :include_channels, TD::Types::Bool - end -end diff --git a/lib/tdlib/types/chat_filter_info.rb b/lib/tdlib/types/chat_filter_info.rb deleted file mode 100644 index 79d163ec..00000000 --- a/lib/tdlib/types/chat_filter_info.rb +++ /dev/null @@ -1,14 +0,0 @@ -module TD::Types - # Contains basic information about a chat filter. - # - # @attr id [Integer] Unique chat filter identifier. - # @attr title [TD::Types::String] The title of the filter; 1-12 characters without line feeds. - # @attr icon_name [TD::Types::String] The icon name for short filter representation. - # One of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", - # "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work". - class ChatFilterInfo < Base - attribute :id, TD::Types::Coercible::Integer - attribute :title, TD::Types::String - attribute :icon_name, TD::Types::String - end -end diff --git a/lib/tdlib/types/chat_folder.rb b/lib/tdlib/types/chat_folder.rb new file mode 100644 index 00000000..149e55d4 --- /dev/null +++ b/lib/tdlib/types/chat_folder.rb @@ -0,0 +1,45 @@ +module TD::Types + # Represents a folder for user chats. + # + # @attr title [TD::Types::String] The title of the folder; 1-12 characters without line feeds. + # @attr icon [TD::Types::ChatFolderIcon, nil] The chosen icon for the chat folder; may be null. + # If null, use getChatFolderDefaultIconName to get default icon name for the folder. + # @attr color_id [Integer] The identifier of the chosen color for the chat folder icon; from -1 to 6. + # If -1, then color is disabled. + # Can't be changed if folder tags are disabled or the current user doesn't have Telegram Premium subscription. + # @attr is_shareable [Boolean] True, if at least one link has been created for the folder. + # @attr pinned_chat_ids [Array] The chat identifiers of pinned chats in the folder. + # There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and + # the same number of secret chats, but the limit can be increased with Telegram Premium. + # @attr included_chat_ids [Array] The chat identifiers of always included chats in the folder. + # There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and + # the same number of secret chats, but the limit can be increased with Telegram Premium. + # @attr excluded_chat_ids [Array] The chat identifiers of always excluded chats in the folder. + # There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same + # number of secret chats, but the limit can be increased with Telegram Premium. + # @attr exclude_muted [Boolean] True, if muted chats need to be excluded. + # @attr exclude_read [Boolean] True, if read chats need to be excluded. + # @attr exclude_archived [Boolean] True, if archived chats need to be excluded. + # @attr include_contacts [Boolean] True, if contacts need to be included. + # @attr include_non_contacts [Boolean] True, if non-contact users need to be included. + # @attr include_bots [Boolean] True, if bots need to be included. + # @attr include_groups [Boolean] True, if basic groups and supergroups need to be included. + # @attr include_channels [Boolean] True, if channels need to be included. + class ChatFolder < Base + attribute :title, TD::Types::String + attribute :icon, TD::Types::ChatFolderIcon.optional.default(nil) + attribute :color_id, TD::Types::Coercible::Integer + attribute :is_shareable, TD::Types::Bool + attribute :pinned_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :included_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :excluded_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :exclude_muted, TD::Types::Bool + attribute :exclude_read, TD::Types::Bool + attribute :exclude_archived, TD::Types::Bool + attribute :include_contacts, TD::Types::Bool + attribute :include_non_contacts, TD::Types::Bool + attribute :include_bots, TD::Types::Bool + attribute :include_groups, TD::Types::Bool + attribute :include_channels, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_folder_icon.rb b/lib/tdlib/types/chat_folder_icon.rb new file mode 100644 index 00000000..12758de8 --- /dev/null +++ b/lib/tdlib/types/chat_folder_icon.rb @@ -0,0 +1,11 @@ +module TD::Types + # Represents an icon for a chat folder. + # + # @attr name [TD::Types::String] The chosen icon name for short folder representation; one of "All", "Unread", + # "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", + # "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", + # "Money", "Note", "Palette". + class ChatFolderIcon < Base + attribute :name, TD::Types::String + end +end diff --git a/lib/tdlib/types/chat_folder_info.rb b/lib/tdlib/types/chat_folder_info.rb new file mode 100644 index 00000000..65f8ec84 --- /dev/null +++ b/lib/tdlib/types/chat_folder_info.rb @@ -0,0 +1,19 @@ +module TD::Types + # Contains basic information about a chat folder. + # + # @attr id [Integer] Unique chat folder identifier. + # @attr title [TD::Types::String] The title of the folder; 1-12 characters without line feeds. + # @attr icon [TD::Types::ChatFolderIcon] The chosen or default icon for the chat folder. + # @attr color_id [Integer] The identifier of the chosen color for the chat folder icon; from -1 to 6. + # If -1, then color is disabled. + # @attr is_shareable [Boolean] True, if at least one link has been created for the folder. + # @attr has_my_invite_links [Boolean] True, if the chat folder has invite links created by the current user. + class ChatFolderInfo < Base + attribute :id, TD::Types::Coercible::Integer + attribute :title, TD::Types::String + attribute :icon, TD::Types::ChatFolderIcon + attribute :color_id, TD::Types::Coercible::Integer + attribute :is_shareable, TD::Types::Bool + attribute :has_my_invite_links, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_folder_invite_link.rb b/lib/tdlib/types/chat_folder_invite_link.rb new file mode 100644 index 00000000..a063b8fd --- /dev/null +++ b/lib/tdlib/types/chat_folder_invite_link.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains a chat folder invite link. + # + # @attr invite_link [TD::Types::String] The chat folder invite link. + # @attr name [TD::Types::String] Name of the link. + # @attr chat_ids [Array] Identifiers of chats, included in the link. + class ChatFolderInviteLink < Base + attribute :invite_link, TD::Types::String + attribute :name, TD::Types::String + attribute :chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/chat_folder_invite_link_info.rb b/lib/tdlib/types/chat_folder_invite_link_info.rb new file mode 100644 index 00000000..628a3d29 --- /dev/null +++ b/lib/tdlib/types/chat_folder_invite_link_info.rb @@ -0,0 +1,15 @@ +module TD::Types + # Contains information about an invite link to a chat folder. + # + # @attr chat_folder_info [TD::Types::ChatFolderInfo] Basic information about the chat folder; chat folder identifier + # will be 0 if the user didn't have the chat folder yet. + # @attr missing_chat_ids [Array] Identifiers of the chats from the link, which aren't added to the folder + # yet. + # @attr added_chat_ids [Array] Identifiers of the chats from the link, which are added to the folder + # already. + class ChatFolderInviteLinkInfo < Base + attribute :chat_folder_info, TD::Types::ChatFolderInfo + attribute :missing_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :added_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/chat_folder_invite_links.rb b/lib/tdlib/types/chat_folder_invite_links.rb new file mode 100644 index 00000000..af141f1f --- /dev/null +++ b/lib/tdlib/types/chat_folder_invite_links.rb @@ -0,0 +1,8 @@ +module TD::Types + # Represents a list of chat folder invite links. + # + # @attr invite_links [Array] List of the invite links. + class ChatFolderInviteLinks < Base + attribute :invite_links, TD::Types::Array.of(TD::Types::ChatFolderInviteLink) + end +end diff --git a/lib/tdlib/types/chat_invite_link.rb b/lib/tdlib/types/chat_invite_link.rb index 85261b06..02cea94e 100644 --- a/lib/tdlib/types/chat_invite_link.rb +++ b/lib/tdlib/types/chat_invite_link.rb @@ -2,25 +2,39 @@ module TD::Types # Contains a chat invite link. # # @attr invite_link [TD::Types::String] Chat invite link. + # @attr name [TD::Types::String] Name of the link. # @attr creator_user_id [Integer] User identifier of an administrator created the link. # @attr date [Integer] Point in time (Unix timestamp) when the link was created. # @attr edit_date [Integer] Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown. - # @attr expire_date [Integer] Point in time (Unix timestamp) when the link will expire; 0 if never. + # @attr expiration_date [Integer] Point in time (Unix timestamp) when the link will expire; 0 if never. + # @attr subscription_pricing [TD::Types::StarSubscriptionPricing, nil] Information about subscription plan that is + # applied to the users joining the chat by the link; may be null if the link doesn't require subscription. # @attr member_limit [Integer] The maximum number of members, which can join the chat using the link simultaneously; # 0 if not limited. + # Always 0 if the link requires approval. # @attr member_count [Integer] Number of chat members, which joined the chat using the link. + # @attr expired_member_count [Integer] Number of chat members, which joined the chat using the link, but have already + # left because of expired subscription; for subscription links only. + # @attr pending_join_request_count [Integer] Number of pending join requests created using this link. + # @attr creates_join_request [Boolean] True, if the link only creates join request. + # If true, total number of joining members will be unlimited. # @attr is_primary [Boolean] True, if the link is primary. - # Primary invite link can't have expire date or usage limit. + # Primary invite link can't have name, expiration date, or usage limit. # There is exactly one primary invite link for each administrator with can_invite_users right at a given time. # @attr is_revoked [Boolean] True, if the link was revoked. class ChatInviteLink < Base attribute :invite_link, TD::Types::String + attribute :name, TD::Types::String attribute :creator_user_id, TD::Types::Coercible::Integer attribute :date, TD::Types::Coercible::Integer attribute :edit_date, TD::Types::Coercible::Integer - attribute :expire_date, TD::Types::Coercible::Integer + attribute :expiration_date, TD::Types::Coercible::Integer + attribute :subscription_pricing, TD::Types::StarSubscriptionPricing.optional.default(nil) attribute :member_limit, TD::Types::Coercible::Integer attribute :member_count, TD::Types::Coercible::Integer + attribute :expired_member_count, TD::Types::Coercible::Integer + attribute :pending_join_request_count, TD::Types::Coercible::Integer + attribute :creates_join_request, TD::Types::Bool attribute :is_primary, TD::Types::Bool attribute :is_revoked, TD::Types::Bool end diff --git a/lib/tdlib/types/chat_invite_link_counts.rb b/lib/tdlib/types/chat_invite_link_counts.rb index 1746e27c..f2df8c2e 100644 --- a/lib/tdlib/types/chat_invite_link_counts.rb +++ b/lib/tdlib/types/chat_invite_link_counts.rb @@ -1,7 +1,7 @@ module TD::Types # Contains a list of chat invite link counts. # - # @attr invite_link_counts [Array] List of invite linkcounts. + # @attr invite_link_counts [Array] List of invite link counts. class ChatInviteLinkCounts < Base attribute :invite_link_counts, TD::Types::Array.of(TD::Types::ChatInviteLinkCount) end diff --git a/lib/tdlib/types/chat_invite_link_info.rb b/lib/tdlib/types/chat_invite_link_info.rb index ce535a84..5106ee53 100644 --- a/lib/tdlib/types/chat_invite_link_info.rb +++ b/lib/tdlib/types/chat_invite_link_info.rb @@ -4,21 +4,36 @@ module TD::Types # @attr chat_id [Integer] Chat identifier of the invite link; 0 if the user has no access to the chat before joining. # @attr accessible_for [Integer] If non-zero, the amount of time for which read access to the chat will remain # available, in seconds. - # @attr type [TD::Types::ChatType] Contains information about the type of the chat. + # @attr type [TD::Types::InviteLinkChatType] Type of the chat. # @attr title [TD::Types::String] Title of the chat. # @attr photo [TD::Types::ChatPhotoInfo, nil] Chat photo; may be null. + # @attr accent_color_id [Integer] Identifier of the accent color for chat title and background of chat photo. + # @attr description [TD::Types::String] Chat description. # @attr member_count [Integer] Number of members in the chat. # @attr member_user_ids [Array] User identifiers of some chat members that may be known to the current user. + # @attr subscription_info [TD::Types::ChatInviteLinkSubscriptionInfo, nil] Information about subscription plan that + # must be paid by the user to use the link; may be null if the link doesn't require subscription. + # @attr creates_join_request [Boolean] True, if the link only creates join request. # @attr is_public [Boolean] True, if the chat is a public supergroup or channel, i.e. # it has a username or it is a location-based supergroup. + # @attr is_verified [Boolean] True, if the chat is verified. + # @attr is_scam [Boolean] True, if many users reported this chat as a scam. + # @attr is_fake [Boolean] True, if many users reported this chat as a fake account. class ChatInviteLinkInfo < Base attribute :chat_id, TD::Types::Coercible::Integer attribute :accessible_for, TD::Types::Coercible::Integer - attribute :type, TD::Types::ChatType + attribute :type, TD::Types::InviteLinkChatType attribute :title, TD::Types::String attribute :photo, TD::Types::ChatPhotoInfo.optional.default(nil) + attribute :accent_color_id, TD::Types::Coercible::Integer + attribute :description, TD::Types::String attribute :member_count, TD::Types::Coercible::Integer attribute :member_user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :subscription_info, TD::Types::ChatInviteLinkSubscriptionInfo.optional.default(nil) + attribute :creates_join_request, TD::Types::Bool attribute :is_public, TD::Types::Bool + attribute :is_verified, TD::Types::Bool + attribute :is_scam, TD::Types::Bool + attribute :is_fake, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_invite_link_member.rb b/lib/tdlib/types/chat_invite_link_member.rb index d79dd0aa..375a05c3 100644 --- a/lib/tdlib/types/chat_invite_link_member.rb +++ b/lib/tdlib/types/chat_invite_link_member.rb @@ -1,10 +1,15 @@ module TD::Types - # Describes a chat member joined a chat by an invite link. + # Describes a chat member joined a chat via an invite link. # # @attr user_id [Integer] User identifier. # @attr joined_chat_date [Integer] Point in time (Unix timestamp) when the user joined the chat. + # @attr via_chat_folder_invite_link [Boolean] True, if the user has joined the chat using an invite link for a chat + # folder. + # @attr approver_user_id [Integer] User identifier of the chat administrator, approved user join request. class ChatInviteLinkMember < Base attribute :user_id, TD::Types::Coercible::Integer attribute :joined_chat_date, TD::Types::Coercible::Integer + attribute :via_chat_folder_invite_link, TD::Types::Bool + attribute :approver_user_id, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/chat_invite_link_members.rb b/lib/tdlib/types/chat_invite_link_members.rb index a3b875f2..f112ff51 100644 --- a/lib/tdlib/types/chat_invite_link_members.rb +++ b/lib/tdlib/types/chat_invite_link_members.rb @@ -1,8 +1,8 @@ module TD::Types - # Contains a list of chat members joined a chat by an invite link. + # Contains a list of chat members joined a chat via an invite link. # - # @attr total_count [Integer] Approximate total count of chat members found. - # @attr members [Array] List of chat members, joined a chat by an invite link. + # @attr total_count [Integer] Approximate total number of chat members found. + # @attr members [Array] List of chat members, joined a chat via an invite link. class ChatInviteLinkMembers < Base attribute :total_count, TD::Types::Coercible::Integer attribute :members, TD::Types::Array.of(TD::Types::ChatInviteLinkMember) diff --git a/lib/tdlib/types/chat_invite_link_subscription_info.rb b/lib/tdlib/types/chat_invite_link_subscription_info.rb new file mode 100644 index 00000000..5c9c6ddd --- /dev/null +++ b/lib/tdlib/types/chat_invite_link_subscription_info.rb @@ -0,0 +1,15 @@ +module TD::Types + # Contains information about subscription plan that must be paid by the user to use a chat invite link. + # + # @attr pricing [TD::Types::StarSubscriptionPricing] Information about subscription plan that must be paid by the + # user to use the link. + # @attr can_reuse [Boolean] True, if the user has already paid for the subscription and can use joinChatByInviteLink + # to join the subscribed chat again. + # @attr form_id [Integer] Identifier of the payment form to use for subscription payment; 0 if the subscription can't + # be paid. + class ChatInviteLinkSubscriptionInfo < Base + attribute :pricing, TD::Types::StarSubscriptionPricing + attribute :can_reuse, TD::Types::Bool + attribute :form_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_invite_links.rb b/lib/tdlib/types/chat_invite_links.rb index 406f5c79..8ef91ac5 100644 --- a/lib/tdlib/types/chat_invite_links.rb +++ b/lib/tdlib/types/chat_invite_links.rb @@ -1,7 +1,7 @@ module TD::Types # Contains a list of chat invite links. # - # @attr total_count [Integer] Approximate total count of chat invite links found. + # @attr total_count [Integer] Approximate total number of chat invite links found. # @attr invite_links [Array] List of invite links. class ChatInviteLinks < Base attribute :total_count, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/chat_join_request.rb b/lib/tdlib/types/chat_join_request.rb new file mode 100644 index 00000000..8a84693d --- /dev/null +++ b/lib/tdlib/types/chat_join_request.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes a user that sent a join request and waits for administrator approval. + # + # @attr user_id [Integer] User identifier. + # @attr date [Integer] Point in time (Unix timestamp) when the user sent the join request. + # @attr bio [TD::Types::String] A short bio of the user. + class ChatJoinRequest < Base + attribute :user_id, TD::Types::Coercible::Integer + attribute :date, TD::Types::Coercible::Integer + attribute :bio, TD::Types::String + end +end diff --git a/lib/tdlib/types/chat_join_requests.rb b/lib/tdlib/types/chat_join_requests.rb new file mode 100644 index 00000000..da648808 --- /dev/null +++ b/lib/tdlib/types/chat_join_requests.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains a list of requests to join a chat. + # + # @attr total_count [Integer] Approximate total number of requests found. + # @attr requests [Array] List of the requests. + class ChatJoinRequests < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :requests, TD::Types::Array.of(TD::Types::ChatJoinRequest) + end +end diff --git a/lib/tdlib/types/chat_join_requests_info.rb b/lib/tdlib/types/chat_join_requests_info.rb new file mode 100644 index 00000000..eeb1ea89 --- /dev/null +++ b/lib/tdlib/types/chat_join_requests_info.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about pending join requests for a chat. + # + # @attr total_count [Integer] Total number of pending join requests. + # @attr user_ids [Array] Identifiers of at most 3 users sent the newest pending join requests. + class ChatJoinRequestsInfo < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/chat_list.rb b/lib/tdlib/types/chat_list.rb index a5992b42..995df40a 100644 --- a/lib/tdlib/types/chat_list.rb +++ b/lib/tdlib/types/chat_list.rb @@ -4,7 +4,7 @@ class ChatList < Base %w[ main archive - filter + folder ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/chat_list/#{type}" end diff --git a/lib/tdlib/types/chat_list/filter.rb b/lib/tdlib/types/chat_list/filter.rb deleted file mode 100644 index 42e6434d..00000000 --- a/lib/tdlib/types/chat_list/filter.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # A list of chats belonging to a chat filter. - # - # @attr chat_filter_id [Integer] Chat filter identifier. - class ChatList::Filter < ChatList - attribute :chat_filter_id, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/chat_list/folder.rb b/lib/tdlib/types/chat_list/folder.rb new file mode 100644 index 00000000..821c0713 --- /dev/null +++ b/lib/tdlib/types/chat_list/folder.rb @@ -0,0 +1,8 @@ +module TD::Types + # A list of chats added to a chat folder. + # + # @attr chat_folder_id [Integer] Chat folder identifier. + class ChatList::Folder < ChatList + attribute :chat_folder_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_member.rb b/lib/tdlib/types/chat_member.rb index cd39b315..516e42b7 100644 --- a/lib/tdlib/types/chat_member.rb +++ b/lib/tdlib/types/chat_member.rb @@ -1,5 +1,5 @@ module TD::Types - # Information about a user or a chat as a member of another chat. + # Describes a user or a chat as a member of another chat. # # @attr member_id [TD::Types::MessageSender] Identifier of the chat member. # Currently, other chats can be only Left or Banned. @@ -7,15 +7,13 @@ module TD::Types # or channels. # @attr inviter_user_id [Integer] Identifier of a user that invited/promoted/banned this member in the chat; 0 if # unknown. - # @attr joined_chat_date [Integer] Point in time (Unix timestamp) when the user joined the chat. + # @attr joined_chat_date [Integer] Point in time (Unix timestamp) when the user joined/was promoted/was banned in the + # chat. # @attr status [TD::Types::ChatMemberStatus] Status of the member in the chat. - # @attr bot_info [TD::Types::BotInfo, nil] If the user is a bot, information about the bot; may be null. - # Can be null even for a bot if the bot is not the chat member. class ChatMember < Base attribute :member_id, TD::Types::MessageSender attribute :inviter_user_id, TD::Types::Coercible::Integer attribute :joined_chat_date, TD::Types::Coercible::Integer attribute :status, TD::Types::ChatMemberStatus - attribute :bot_info, TD::Types::BotInfo.optional.default(nil) end end diff --git a/lib/tdlib/types/chat_member_status/administrator.rb b/lib/tdlib/types/chat_member_status/administrator.rb index f3ec8b7e..73a92db1 100644 --- a/lib/tdlib/types/chat_member_status/administrator.rb +++ b/lib/tdlib/types/chat_member_status/administrator.rb @@ -1,42 +1,16 @@ module TD::Types - # The user is a member of a chat and has some additional privileges. + # The user is a member of the chat and has some additional privileges. # In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged - # members, and manage voice chats. + # members, and manage video chats. # In supergroups and channels, there are more detailed options for administrator privileges. # - # @attr custom_title [TD::Types::String] A custom title of the administrator; 0-16 characters without emojis; + # @attr custom_title [TD::Types::String] A custom title of the administrator; 0-16 characters without emoji; # applicable to supergroups only. # @attr can_be_edited [Boolean] True, if the current user can edit the administrator privileges for the called user. - # @attr can_manage_chat [Boolean] True, if the administrator can get chat event log, get chat statistics, get message - # statistics in channels, get channel members, see anonymous administrators in supergroups and ignore slow mode. - # Implied by any other privilege; applicable to supergroups and channels only. - # @attr can_change_info [Boolean] True, if the administrator can change the chat title, photo, and other settings. - # @attr can_post_messages [Boolean] True, if the administrator can create channel posts; applicable to channels only. - # @attr can_edit_messages [Boolean] True, if the administrator can edit messages of other users and pin messages; - # applicable to channels only. - # @attr can_delete_messages [Boolean] True, if the administrator can delete messages of other users. - # @attr can_invite_users [Boolean] True, if the administrator can invite new users to the chat. - # @attr can_restrict_members [Boolean] True, if the administrator can restrict, ban, or unban chat members. - # @attr can_pin_messages [Boolean] True, if the administrator can pin messages; applicable to basic groups and - # supergroups only. - # @attr can_promote_members [Boolean] True, if the administrator can add new administrators with a subset of their - # own privileges or demote administrators that were directly or indirectly promoted by them. - # @attr can_manage_voice_chats [Boolean] True, if the administrator can manage voice chats. - # @attr is_anonymous [Boolean] True, if the administrator isn't shown in the chat member list and sends messages - # anonymously; applicable to supergroups only. + # @attr rights [TD::Types::ChatAdministratorRights] Rights of the administrator. class ChatMemberStatus::Administrator < ChatMemberStatus attribute :custom_title, TD::Types::String attribute :can_be_edited, TD::Types::Bool - attribute :can_manage_chat, TD::Types::Bool - attribute :can_change_info, TD::Types::Bool - attribute :can_post_messages, TD::Types::Bool - attribute :can_edit_messages, TD::Types::Bool - attribute :can_delete_messages, TD::Types::Bool - attribute :can_invite_users, TD::Types::Bool - attribute :can_restrict_members, TD::Types::Bool - attribute :can_pin_messages, TD::Types::Bool - attribute :can_promote_members, TD::Types::Bool - attribute :can_manage_voice_chats, TD::Types::Bool - attribute :is_anonymous, TD::Types::Bool + attribute :rights, TD::Types::ChatAdministratorRights end end diff --git a/lib/tdlib/types/chat_member_status/banned.rb b/lib/tdlib/types/chat_member_status/banned.rb index ce0f6990..af45afc2 100644 --- a/lib/tdlib/types/chat_member_status/banned.rb +++ b/lib/tdlib/types/chat_member_status/banned.rb @@ -1,6 +1,6 @@ module TD::Types # The user or the chat was banned (and hence is not a member of the chat). - # Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a voice + # Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video # chat of the chat. # # @attr banned_until_date [Integer] Point in time (Unix timestamp) when the user will be unbanned; 0 if never. diff --git a/lib/tdlib/types/chat_member_status/creator.rb b/lib/tdlib/types/chat_member_status/creator.rb index c6e55247..d7bab964 100644 --- a/lib/tdlib/types/chat_member_status/creator.rb +++ b/lib/tdlib/types/chat_member_status/creator.rb @@ -1,7 +1,7 @@ module TD::Types - # The user is the owner of a chat and has all the administrator privileges. + # The user is the owner of the chat and has all the administrator privileges. # - # @attr custom_title [TD::Types::String] A custom title of the owner; 0-16 characters without emojis; applicable to + # @attr custom_title [TD::Types::String] A custom title of the owner; 0-16 characters without emoji; applicable to # supergroups only. # @attr is_anonymous [Boolean] True, if the creator isn't shown in the chat member list and sends messages # anonymously; applicable to supergroups only. diff --git a/lib/tdlib/types/chat_member_status/member.rb b/lib/tdlib/types/chat_member_status/member.rb index 98859d82..56a20a91 100644 --- a/lib/tdlib/types/chat_member_status/member.rb +++ b/lib/tdlib/types/chat_member_status/member.rb @@ -1,5 +1,10 @@ module TD::Types - # The user is a member of a chat, without any additional privileges or restrictions. + # The user is a member of the chat, without any additional privileges or restrictions. + # + # @attr member_until_date [Integer] Point in time (Unix timestamp) when the user will be removed from the chat + # because of the expired subscription; 0 if never. + # Ignored in setChatMemberStatus. class ChatMemberStatus::Member < ChatMemberStatus + attribute :member_until_date, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/chat_members.rb b/lib/tdlib/types/chat_members.rb index 3726ec6f..e55e8444 100644 --- a/lib/tdlib/types/chat_members.rb +++ b/lib/tdlib/types/chat_members.rb @@ -1,7 +1,7 @@ module TD::Types # Contains a list of chat members. # - # @attr total_count [Integer] Approximate total count of chat members found. + # @attr total_count [Integer] Approximate total number of chat members found. # @attr members [Array] A list of chat members. class ChatMembers < Base attribute :total_count, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/chat_message_sender.rb b/lib/tdlib/types/chat_message_sender.rb new file mode 100644 index 00000000..86c6f17c --- /dev/null +++ b/lib/tdlib/types/chat_message_sender.rb @@ -0,0 +1,10 @@ +module TD::Types + # Represents a message sender, which can be used to send messages in a chat. + # + # @attr sender [TD::Types::MessageSender] The message sender. + # @attr needs_premium [Boolean] True, if Telegram Premium is needed to use the message sender. + class ChatMessageSender < Base + attribute :sender, TD::Types::MessageSender + attribute :needs_premium, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/chat_message_senders.rb b/lib/tdlib/types/chat_message_senders.rb new file mode 100644 index 00000000..1987bcff --- /dev/null +++ b/lib/tdlib/types/chat_message_senders.rb @@ -0,0 +1,8 @@ +module TD::Types + # Represents a list of message senders, which can be used to send messages in a chat. + # + # @attr senders [Array] List of available message senders. + class ChatMessageSenders < Base + attribute :senders, TD::Types::Array.of(TD::Types::ChatMessageSender) + end +end diff --git a/lib/tdlib/types/chat_notification_settings.rb b/lib/tdlib/types/chat_notification_settings.rb index 13162562..6e4dd779 100644 --- a/lib/tdlib/types/chat_notification_settings.rb +++ b/lib/tdlib/types/chat_notification_settings.rb @@ -1,31 +1,46 @@ module TD::Types - # Contains information about notification settings for a chat. + # Contains information about notification settings for a chat or a forum topic. # - # @attr use_default_mute_for [Boolean] If true, mute_for is ignored and the value for the relevant type of chat is - # used instead. + # @attr use_default_mute_for [Boolean] If true, the value for the relevant type of chat or the forum chat is used + # instead of mute_for. # @attr mute_for [Integer] Time left before notifications will be unmuted, in seconds. - # @attr use_default_sound [Boolean] If true, sound is ignored and the value for the relevant type of chat is used - # instead. - # @attr sound [TD::Types::String] The name of an audio file to be used for notification sounds; only applies to iOS - # applications. - # @attr use_default_show_preview [Boolean] If true, show_preview is ignored and the value for the relevant type of - # chat is used instead. - # @attr show_preview [Boolean] True, if message content should be displayed in notifications. - # @attr use_default_disable_pinned_message_notifications [Boolean] If true, disable_pinned_message_notifications is - # ignored and the value for the relevant type of chat is used instead. + # @attr use_default_sound [Boolean] If true, the value for the relevant type of chat or the forum chat is used + # instead of sound_id. + # @attr sound_id [Integer] Identifier of the notification sound to be played for messages; 0 if sound is disabled. + # @attr use_default_show_preview [Boolean] If true, the value for the relevant type of chat or the forum chat is used + # instead of show_preview. + # @attr show_preview [Boolean] True, if message content must be displayed in notifications. + # @attr use_default_mute_stories [Boolean] If true, the value for the relevant type of chat is used instead of + # mute_stories. + # @attr mute_stories [Boolean] True, if story notifications are disabled for the chat. + # @attr use_default_story_sound [Boolean] If true, the value for the relevant type of chat is used instead of + # story_sound_id. + # @attr story_sound_id [Integer] Identifier of the notification sound to be played for stories; 0 if sound is + # disabled. + # @attr use_default_show_story_sender [Boolean] If true, the value for the relevant type of chat is used instead of + # show_story_sender. + # @attr show_story_sender [Boolean] True, if the sender of stories must be displayed in notifications. + # @attr use_default_disable_pinned_message_notifications [Boolean] If true, the value for the relevant type of chat + # or the forum chat is used instead of disable_pinned_message_notifications. # @attr disable_pinned_message_notifications [Boolean] If true, notifications for incoming pinned messages will be # created as for an ordinary unread message. - # @attr use_default_disable_mention_notifications [Boolean] If true, disable_mention_notifications is ignored and the - # value for the relevant type of chat is used instead. + # @attr use_default_disable_mention_notifications [Boolean] If true, the value for the relevant type of chat or the + # forum chat is used instead of disable_mention_notifications. # @attr disable_mention_notifications [Boolean] If true, notifications for messages with mentions will be created as # for an ordinary unread message. class ChatNotificationSettings < Base attribute :use_default_mute_for, TD::Types::Bool attribute :mute_for, TD::Types::Coercible::Integer attribute :use_default_sound, TD::Types::Bool - attribute :sound, TD::Types::String + attribute :sound_id, TD::Types::Coercible::Integer attribute :use_default_show_preview, TD::Types::Bool attribute :show_preview, TD::Types::Bool + attribute :use_default_mute_stories, TD::Types::Bool + attribute :mute_stories, TD::Types::Bool + attribute :use_default_story_sound, TD::Types::Bool + attribute :story_sound_id, TD::Types::Coercible::Integer + attribute :use_default_show_story_sender, TD::Types::Bool + attribute :show_story_sender, TD::Types::Bool attribute :use_default_disable_pinned_message_notifications, TD::Types::Bool attribute :disable_pinned_message_notifications, TD::Types::Bool attribute :use_default_disable_mention_notifications, TD::Types::Bool diff --git a/lib/tdlib/types/chat_permissions.rb b/lib/tdlib/types/chat_permissions.rb index 7b8a96eb..d8dcfcb4 100644 --- a/lib/tdlib/types/chat_permissions.rb +++ b/lib/tdlib/types/chat_permissions.rb @@ -1,28 +1,36 @@ module TD::Types # Describes actions that a user is allowed to take in a chat. # - # @attr can_send_messages [Boolean] True, if the user can send text messages, contacts, locations, and venues. - # @attr can_send_media_messages [Boolean] True, if the user can send audio files, documents, photos, videos, video - # notes, and voice notes. - # Implies can_send_messages permissions. + # @attr can_send_basic_messages [Boolean] True, if the user can send text messages, contacts, giveaways, giveaway + # winners, invoices, locations, and venues. + # @attr can_send_audios [Boolean] True, if the user can send music files. + # @attr can_send_documents [Boolean] True, if the user can send documents. + # @attr can_send_photos [Boolean] True, if the user can send photos. + # @attr can_send_videos [Boolean] True, if the user can send videos. + # @attr can_send_video_notes [Boolean] True, if the user can send video notes. + # @attr can_send_voice_notes [Boolean] True, if the user can send voice notes. # @attr can_send_polls [Boolean] True, if the user can send polls. - # Implies can_send_messages permissions. # @attr can_send_other_messages [Boolean] True, if the user can send animations, games, stickers, and dice and use # inline bots. - # Implies can_send_messages permissions. - # @attr can_add_web_page_previews [Boolean] True, if the user may add a web page preview to their messages. - # Implies can_send_messages permissions. + # @attr can_add_link_previews [Boolean] True, if the user may add a link preview to their messages. # @attr can_change_info [Boolean] True, if the user can change the chat title, photo, and other settings. # @attr can_invite_users [Boolean] True, if the user can invite new users to the chat. # @attr can_pin_messages [Boolean] True, if the user can pin messages. + # @attr can_create_topics [Boolean] True, if the user can create topics. class ChatPermissions < Base - attribute :can_send_messages, TD::Types::Bool - attribute :can_send_media_messages, TD::Types::Bool + attribute :can_send_basic_messages, TD::Types::Bool + attribute :can_send_audios, TD::Types::Bool + attribute :can_send_documents, TD::Types::Bool + attribute :can_send_photos, TD::Types::Bool + attribute :can_send_videos, TD::Types::Bool + attribute :can_send_video_notes, TD::Types::Bool + attribute :can_send_voice_notes, TD::Types::Bool attribute :can_send_polls, TD::Types::Bool attribute :can_send_other_messages, TD::Types::Bool - attribute :can_add_web_page_previews, TD::Types::Bool + attribute :can_add_link_previews, TD::Types::Bool attribute :can_change_info, TD::Types::Bool attribute :can_invite_users, TD::Types::Bool attribute :can_pin_messages, TD::Types::Bool + attribute :can_create_topics, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_photo.rb b/lib/tdlib/types/chat_photo.rb index 80fa09ea..13330aaf 100644 --- a/lib/tdlib/types/chat_photo.rb +++ b/lib/tdlib/types/chat_photo.rb @@ -5,12 +5,18 @@ module TD::Types # @attr added_date [Integer] Point in time (Unix timestamp) when the photo has been added. # @attr minithumbnail [TD::Types::Minithumbnail, nil] Photo minithumbnail; may be null. # @attr sizes [Array] Available variants of the photo in JPEG format, in different size. - # @attr animation [TD::Types::AnimatedChatPhoto, nil] Animated variant of the photo in MPEG4 format; may be null. + # @attr animation [TD::Types::AnimatedChatPhoto, nil] A big (up to 1280x1280) animated variant of the photo in MPEG4 + # format; may be null. + # @attr small_animation [TD::Types::AnimatedChatPhoto, nil] A small (160x160) animated variant of the photo in MPEG4 + # format; may be null even the big animation is available. + # @attr sticker [TD::Types::ChatPhotoSticker, nil] Sticker-based version of the chat photo; may be null. class ChatPhoto < Base attribute :id, TD::Types::Coercible::Integer attribute :added_date, TD::Types::Coercible::Integer attribute :minithumbnail, TD::Types::Minithumbnail.optional.default(nil) attribute :sizes, TD::Types::Array.of(TD::Types::PhotoSize) attribute :animation, TD::Types::AnimatedChatPhoto.optional.default(nil) + attribute :small_animation, TD::Types::AnimatedChatPhoto.optional.default(nil) + attribute :sticker, TD::Types::ChatPhotoSticker.optional.default(nil) end end diff --git a/lib/tdlib/types/chat_photo_info.rb b/lib/tdlib/types/chat_photo_info.rb index 2525c9ab..34a98c22 100644 --- a/lib/tdlib/types/chat_photo_info.rb +++ b/lib/tdlib/types/chat_photo_info.rb @@ -7,10 +7,12 @@ module TD::Types # The file can be downloaded only before the photo is changed. # @attr minithumbnail [TD::Types::Minithumbnail, nil] Chat photo minithumbnail; may be null. # @attr has_animation [Boolean] True, if the photo has animated variant. + # @attr is_personal [Boolean] True, if the photo is visible only for the current user. class ChatPhotoInfo < Base attribute :small, TD::Types::File attribute :big, TD::Types::File attribute :minithumbnail, TD::Types::Minithumbnail.optional.default(nil) attribute :has_animation, TD::Types::Bool + attribute :is_personal, TD::Types::Bool end end diff --git a/lib/tdlib/types/chat_photo_sticker.rb b/lib/tdlib/types/chat_photo_sticker.rb new file mode 100644 index 00000000..d83fae8d --- /dev/null +++ b/lib/tdlib/types/chat_photo_sticker.rb @@ -0,0 +1,12 @@ +module TD::Types + # Information about the sticker, which was used to create the chat photo. + # The sticker is shown at the center of the photo and occupies at most 67% of it. + # + # @attr type [TD::Types::ChatPhotoStickerType] Type of the sticker. + # @attr background_fill [TD::Types::BackgroundFill] The fill to be used as background for the sticker; rotation angle + # in {TD::Types::BackgroundFill::Gradient} isn't supported. + class ChatPhotoSticker < Base + attribute :type, TD::Types::ChatPhotoStickerType + attribute :background_fill, TD::Types::BackgroundFill + end +end diff --git a/lib/tdlib/types/chat_photo_sticker_type.rb b/lib/tdlib/types/chat_photo_sticker_type.rb new file mode 100644 index 00000000..2c69c6ef --- /dev/null +++ b/lib/tdlib/types/chat_photo_sticker_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes type of sticker, which was used to create a chat photo. + class ChatPhotoStickerType < Base + %w[ + regular_or_mask + custom_emoji + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/chat_photo_sticker_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/chat_photo_sticker_type/custom_emoji.rb b/lib/tdlib/types/chat_photo_sticker_type/custom_emoji.rb new file mode 100644 index 00000000..59907eb5 --- /dev/null +++ b/lib/tdlib/types/chat_photo_sticker_type/custom_emoji.rb @@ -0,0 +1,8 @@ +module TD::Types + # Information about the custom emoji, which was used to create the chat photo. + # + # @attr custom_emoji_id [Integer] Identifier of the custom emoji. + class ChatPhotoStickerType::CustomEmoji < ChatPhotoStickerType + attribute :custom_emoji_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_photo_sticker_type/regular_or_mask.rb b/lib/tdlib/types/chat_photo_sticker_type/regular_or_mask.rb new file mode 100644 index 00000000..e613f692 --- /dev/null +++ b/lib/tdlib/types/chat_photo_sticker_type/regular_or_mask.rb @@ -0,0 +1,10 @@ +module TD::Types + # Information about the sticker, which was used to create the chat photo. + # + # @attr sticker_set_id [Integer] Sticker set identifier. + # @attr sticker_id [Integer] Identifier of the sticker in the set. + class ChatPhotoStickerType::RegularOrMask < ChatPhotoStickerType + attribute :sticker_set_id, TD::Types::Coercible::Integer + attribute :sticker_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_revenue_amount.rb b/lib/tdlib/types/chat_revenue_amount.rb new file mode 100644 index 00000000..c34cc10e --- /dev/null +++ b/lib/tdlib/types/chat_revenue_amount.rb @@ -0,0 +1,17 @@ +module TD::Types + # Contains information about revenue earned from sponsored messages in a chat. + # + # @attr cryptocurrency [TD::Types::String] Cryptocurrency in which revenue is calculated. + # @attr total_amount [Integer] Total amount of the cryptocurrency earned, in the smallest units of the + # cryptocurrency. + # @attr balance_amount [Integer] Amount of the cryptocurrency that isn't withdrawn yet, in the smallest units of the + # cryptocurrency. + # @attr available_amount [Integer] Amount of the cryptocurrency available for withdrawal, in the smallest units of + # the cryptocurrency. + class ChatRevenueAmount < Base + attribute :cryptocurrency, TD::Types::String + attribute :total_amount, TD::Types::Coercible::Integer + attribute :balance_amount, TD::Types::Coercible::Integer + attribute :available_amount, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_revenue_statistics.rb b/lib/tdlib/types/chat_revenue_statistics.rb new file mode 100644 index 00000000..cb189335 --- /dev/null +++ b/lib/tdlib/types/chat_revenue_statistics.rb @@ -0,0 +1,14 @@ +module TD::Types + # A detailed statistics about revenue earned from sponsored messages in a chat. + # + # @attr revenue_by_hour_graph [TD::Types::StatisticalGraph] A graph containing amount of revenue in a given hour. + # @attr revenue_graph [TD::Types::StatisticalGraph] A graph containing amount of revenue. + # @attr revenue_amount [TD::Types::ChatRevenueAmount] Amount of earned revenue. + # @attr usd_rate [Float] Current conversion rate of the cryptocurrency in which revenue is calculated to USD. + class ChatRevenueStatistics < Base + attribute :revenue_by_hour_graph, TD::Types::StatisticalGraph + attribute :revenue_graph, TD::Types::StatisticalGraph + attribute :revenue_amount, TD::Types::ChatRevenueAmount + attribute :usd_rate, TD::Types::Coercible::Float + end +end diff --git a/lib/tdlib/types/chat_revenue_transaction.rb b/lib/tdlib/types/chat_revenue_transaction.rb new file mode 100644 index 00000000..fb72df48 --- /dev/null +++ b/lib/tdlib/types/chat_revenue_transaction.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains a chat revenue transactions. + # + # @attr cryptocurrency [TD::Types::String] Cryptocurrency in which revenue is calculated. + # @attr cryptocurrency_amount [Integer] The withdrawn amount, in the smallest units of the cryptocurrency. + # @attr type [TD::Types::ChatRevenueTransactionType] Type of the transaction. + class ChatRevenueTransaction < Base + attribute :cryptocurrency, TD::Types::String + attribute :cryptocurrency_amount, TD::Types::Coercible::Integer + attribute :type, TD::Types::ChatRevenueTransactionType + end +end diff --git a/lib/tdlib/types/chat_revenue_transaction_type.rb b/lib/tdlib/types/chat_revenue_transaction_type.rb new file mode 100644 index 00000000..ed10499c --- /dev/null +++ b/lib/tdlib/types/chat_revenue_transaction_type.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes type of transaction for revenue earned from sponsored messages in a chat. + class ChatRevenueTransactionType < Base + %w[ + earnings + withdrawal + refund + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/chat_revenue_transaction_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/chat_revenue_transaction_type/earnings.rb b/lib/tdlib/types/chat_revenue_transaction_type/earnings.rb new file mode 100644 index 00000000..1eee9934 --- /dev/null +++ b/lib/tdlib/types/chat_revenue_transaction_type/earnings.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes earnings from sponsored messages in a chat in some time frame. + # + # @attr start_date [Integer] Point in time (Unix timestamp) when the earnings started. + # @attr end_date [Integer] Point in time (Unix timestamp) when the earnings ended. + class ChatRevenueTransactionType::Earnings < ChatRevenueTransactionType + attribute :start_date, TD::Types::Coercible::Integer + attribute :end_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_revenue_transaction_type/refund.rb b/lib/tdlib/types/chat_revenue_transaction_type/refund.rb new file mode 100644 index 00000000..51296a51 --- /dev/null +++ b/lib/tdlib/types/chat_revenue_transaction_type/refund.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a refund for failed withdrawal of earnings. + # + # @attr refund_date [Integer] Point in time (Unix timestamp) when the transaction was refunded. + # @attr provider [TD::Types::String] Name of the payment provider. + class ChatRevenueTransactionType::Refund < ChatRevenueTransactionType + attribute :refund_date, TD::Types::Coercible::Integer + attribute :provider, TD::Types::String + end +end diff --git a/lib/tdlib/types/chat_revenue_transaction_type/withdrawal.rb b/lib/tdlib/types/chat_revenue_transaction_type/withdrawal.rb new file mode 100644 index 00000000..1f036241 --- /dev/null +++ b/lib/tdlib/types/chat_revenue_transaction_type/withdrawal.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes a withdrawal of earnings. + # + # @attr withdrawal_date [Integer] Point in time (Unix timestamp) when the earnings withdrawal started. + # @attr provider [TD::Types::String] Name of the payment provider. + # @attr state [TD::Types::RevenueWithdrawalState] State of the withdrawal. + class ChatRevenueTransactionType::Withdrawal < ChatRevenueTransactionType + attribute :withdrawal_date, TD::Types::Coercible::Integer + attribute :provider, TD::Types::String + attribute :state, TD::Types::RevenueWithdrawalState + end +end diff --git a/lib/tdlib/types/chat_revenue_transactions.rb b/lib/tdlib/types/chat_revenue_transactions.rb new file mode 100644 index 00000000..c67e412b --- /dev/null +++ b/lib/tdlib/types/chat_revenue_transactions.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains a list of chat revenue transactions. + # + # @attr total_count [Integer] Total number of transactions. + # @attr transactions [Array] List of transactions. + class ChatRevenueTransactions < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :transactions, TD::Types::Array.of(TD::Types::ChatRevenueTransaction) + end +end diff --git a/lib/tdlib/types/chat_statistics/channel.rb b/lib/tdlib/types/chat_statistics/channel.rb index 71089020..b46f93b9 100644 --- a/lib/tdlib/types/chat_statistics/channel.rb +++ b/lib/tdlib/types/chat_statistics/channel.rb @@ -3,9 +3,20 @@ module TD::Types # # @attr period [TD::Types::DateRange] A period to which the statistics applies. # @attr member_count [TD::Types::StatisticalValue] Number of members in the chat. - # @attr mean_view_count [TD::Types::StatisticalValue] Mean number of times the recently sent messages was viewed. - # @attr mean_share_count [TD::Types::StatisticalValue] Mean number of times the recently sent messages was shared. - # @attr enabled_notifications_percentage [Float] A percentage of users with enabled notifications for the chat. + # @attr mean_message_view_count [TD::Types::StatisticalValue] Mean number of times the recently sent messages were + # viewed. + # @attr mean_message_share_count [TD::Types::StatisticalValue] Mean number of times the recently sent messages were + # shared. + # @attr mean_message_reaction_count [TD::Types::StatisticalValue] Mean number of times reactions were added to the + # recently sent messages. + # @attr mean_story_view_count [TD::Types::StatisticalValue] Mean number of times the recently sent stories were + # viewed. + # @attr mean_story_share_count [TD::Types::StatisticalValue] Mean number of times the recently sent stories were + # shared. + # @attr mean_story_reaction_count [TD::Types::StatisticalValue] Mean number of times reactions were added to the + # recently sent stories. + # @attr enabled_notifications_percentage [Float] A percentage of users with enabled notifications for the chat; + # 0-100. # @attr member_count_graph [TD::Types::StatisticalGraph] A graph containing number of members in the chat. # @attr join_graph [TD::Types::StatisticalGraph] A graph containing number of members joined and left the chat. # @attr mute_graph [TD::Types::StatisticalGraph] A graph containing number of members muted and unmuted the chat. @@ -18,15 +29,22 @@ module TD::Types # language. # @attr message_interaction_graph [TD::Types::StatisticalGraph] A graph containing number of chat message views and # shares. + # @attr message_reaction_graph [TD::Types::StatisticalGraph] A graph containing number of reactions on messages. + # @attr story_interaction_graph [TD::Types::StatisticalGraph] A graph containing number of story views and shares. + # @attr story_reaction_graph [TD::Types::StatisticalGraph] A graph containing number of reactions on stories. # @attr instant_view_interaction_graph [TD::Types::StatisticalGraph] A graph containing number of views of associated # with the chat instant views. - # @attr recent_message_interactions [Array] Detailed statistics - # about number of views and shares of recently sent messages. + # @attr recent_interactions [Array] Detailed statistics about number of + # views and shares of recently sent messages and stories. class ChatStatistics::Channel < ChatStatistics attribute :period, TD::Types::DateRange attribute :member_count, TD::Types::StatisticalValue - attribute :mean_view_count, TD::Types::StatisticalValue - attribute :mean_share_count, TD::Types::StatisticalValue + attribute :mean_message_view_count, TD::Types::StatisticalValue + attribute :mean_message_share_count, TD::Types::StatisticalValue + attribute :mean_message_reaction_count, TD::Types::StatisticalValue + attribute :mean_story_view_count, TD::Types::StatisticalValue + attribute :mean_story_share_count, TD::Types::StatisticalValue + attribute :mean_story_reaction_count, TD::Types::StatisticalValue attribute :enabled_notifications_percentage, TD::Types::Coercible::Float attribute :member_count_graph, TD::Types::StatisticalGraph attribute :join_graph, TD::Types::StatisticalGraph @@ -36,7 +54,10 @@ class ChatStatistics::Channel < ChatStatistics attribute :join_by_source_graph, TD::Types::StatisticalGraph attribute :language_graph, TD::Types::StatisticalGraph attribute :message_interaction_graph, TD::Types::StatisticalGraph + attribute :message_reaction_graph, TD::Types::StatisticalGraph + attribute :story_interaction_graph, TD::Types::StatisticalGraph + attribute :story_reaction_graph, TD::Types::StatisticalGraph attribute :instant_view_interaction_graph, TD::Types::StatisticalGraph - attribute :recent_message_interactions, TD::Types::Array.of(TD::Types::ChatStatisticsMessageInteractionInfo) + attribute :recent_interactions, TD::Types::Array.of(TD::Types::ChatStatisticsInteractionInfo) end end diff --git a/lib/tdlib/types/chat_statistics_interaction_info.rb b/lib/tdlib/types/chat_statistics_interaction_info.rb new file mode 100644 index 00000000..8d1375ba --- /dev/null +++ b/lib/tdlib/types/chat_statistics_interaction_info.rb @@ -0,0 +1,14 @@ +module TD::Types + # Contains statistics about interactions with a message sent in the chat or a story sent by the chat. + # + # @attr object_type [TD::Types::ChatStatisticsObjectType] Type of the object. + # @attr view_count [Integer] Number of times the object was viewed. + # @attr forward_count [Integer] Number of times the object was forwarded. + # @attr reaction_count [Integer] Number of times reactions were added to the object. + class ChatStatisticsInteractionInfo < Base + attribute :object_type, TD::Types::ChatStatisticsObjectType + attribute :view_count, TD::Types::Coercible::Integer + attribute :forward_count, TD::Types::Coercible::Integer + attribute :reaction_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_statistics_message_interaction_info.rb b/lib/tdlib/types/chat_statistics_message_interaction_info.rb deleted file mode 100644 index 323be7e7..00000000 --- a/lib/tdlib/types/chat_statistics_message_interaction_info.rb +++ /dev/null @@ -1,12 +0,0 @@ -module TD::Types - # Contains statistics about interactions with a message. - # - # @attr message_id [Integer] Message identifier. - # @attr view_count [Integer] Number of times the message was viewed. - # @attr forward_count [Integer] Number of times the message was forwarded. - class ChatStatisticsMessageInteractionInfo < Base - attribute :message_id, TD::Types::Coercible::Integer - attribute :view_count, TD::Types::Coercible::Integer - attribute :forward_count, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/chat_statistics_message_sender_info.rb b/lib/tdlib/types/chat_statistics_message_sender_info.rb index 41d6c450..640f1f82 100644 --- a/lib/tdlib/types/chat_statistics_message_sender_info.rb +++ b/lib/tdlib/types/chat_statistics_message_sender_info.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr user_id [Integer] User identifier. # @attr sent_message_count [Integer] Number of sent messages. - # @attr average_character_count [Integer] Average number of characters in sent messages. + # @attr average_character_count [Integer] Average number of characters in sent messages; 0 if unknown. class ChatStatisticsMessageSenderInfo < Base attribute :user_id, TD::Types::Coercible::Integer attribute :sent_message_count, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/chat_statistics_object_type.rb b/lib/tdlib/types/chat_statistics_object_type.rb new file mode 100644 index 00000000..31ea57ee --- /dev/null +++ b/lib/tdlib/types/chat_statistics_object_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes type of object, for which statistics are provided. + class ChatStatisticsObjectType < Base + %w[ + message + story + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/chat_statistics_object_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/chat_statistics_object_type/message.rb b/lib/tdlib/types/chat_statistics_object_type/message.rb new file mode 100644 index 00000000..73447656 --- /dev/null +++ b/lib/tdlib/types/chat_statistics_object_type/message.rb @@ -0,0 +1,8 @@ +module TD::Types + # Describes a message sent in the chat. + # + # @attr message_id [Integer] Message identifier. + class ChatStatisticsObjectType::Message < ChatStatisticsObjectType + attribute :message_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_statistics_object_type/story.rb b/lib/tdlib/types/chat_statistics_object_type/story.rb new file mode 100644 index 00000000..0edaffac --- /dev/null +++ b/lib/tdlib/types/chat_statistics_object_type/story.rb @@ -0,0 +1,8 @@ +module TD::Types + # Describes a story sent by the chat. + # + # @attr story_id [Integer] Story identifier. + class ChatStatisticsObjectType::Story < ChatStatisticsObjectType + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/chat_theme.rb b/lib/tdlib/types/chat_theme.rb new file mode 100644 index 00000000..d4158091 --- /dev/null +++ b/lib/tdlib/types/chat_theme.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes a chat theme. + # + # @attr name [TD::Types::String] Theme name. + # @attr light_settings [TD::Types::ThemeSettings] Theme settings for a light chat theme. + # @attr dark_settings [TD::Types::ThemeSettings] Theme settings for a dark chat theme. + class ChatTheme < Base + attribute :name, TD::Types::String + attribute :light_settings, TD::Types::ThemeSettings + attribute :dark_settings, TD::Types::ThemeSettings + end +end diff --git a/lib/tdlib/types/chat_type.rb b/lib/tdlib/types/chat_type.rb index 9455b825..ac7379c6 100644 --- a/lib/tdlib/types/chat_type.rb +++ b/lib/tdlib/types/chat_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the type of a chat. + # Describes the type of chat. class ChatType < Base %w[ private diff --git a/lib/tdlib/types/chat_type/basic_group.rb b/lib/tdlib/types/chat_type/basic_group.rb index dccf043e..98ddc0fb 100644 --- a/lib/tdlib/types/chat_type/basic_group.rb +++ b/lib/tdlib/types/chat_type/basic_group.rb @@ -1,5 +1,5 @@ module TD::Types - # A basic group (i.e., a chat with 0-200 other users). + # A basic group (a chat with 0-200 other users). # # @attr basic_group_id [Integer] Basic group identifier. class ChatType::BasicGroup < ChatType diff --git a/lib/tdlib/types/chat_type/secret.rb b/lib/tdlib/types/chat_type/secret.rb index 735bf4f0..5212c795 100644 --- a/lib/tdlib/types/chat_type/secret.rb +++ b/lib/tdlib/types/chat_type/secret.rb @@ -2,7 +2,7 @@ module TD::Types # A secret chat with a user. # # @attr secret_chat_id [Integer] Secret chat identifier. - # @attr user_id [Integer] User identifier of the secret chat peer. + # @attr user_id [Integer] User identifier of the other user in the secret chat. class ChatType::Secret < ChatType attribute :secret_chat_id, TD::Types::Coercible::Integer attribute :user_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/chat_type/supergroup.rb b/lib/tdlib/types/chat_type/supergroup.rb index 825ad4a7..7c6ebfd3 100644 --- a/lib/tdlib/types/chat_type/supergroup.rb +++ b/lib/tdlib/types/chat_type/supergroup.rb @@ -1,6 +1,5 @@ module TD::Types - # A supergroup (i.e. - # a chat with up to GetOption("supergroup_max_size") other users), or channel (with unlimited members). + # A supergroup or channel (with unlimited members). # # @attr supergroup_id [Integer] Supergroup or channel identifier. # @attr is_channel [Boolean] True, if the supergroup is a channel. diff --git a/lib/tdlib/types/chats.rb b/lib/tdlib/types/chats.rb index df30c447..6c9580b0 100644 --- a/lib/tdlib/types/chats.rb +++ b/lib/tdlib/types/chats.rb @@ -1,7 +1,7 @@ module TD::Types # Represents a list of chats. # - # @attr total_count [Integer] Approximate total count of chats found. + # @attr total_count [Integer] Approximate total number of chats found. # @attr chat_ids [Array] List of chat identifiers. class Chats < Base attribute :total_count, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/check_chat_username_result.rb b/lib/tdlib/types/check_chat_username_result.rb index 03ef5d86..96623cab 100644 --- a/lib/tdlib/types/check_chat_username_result.rb +++ b/lib/tdlib/types/check_chat_username_result.rb @@ -5,7 +5,8 @@ class CheckChatUsernameResult < Base ok username_invalid username_occupied - public_chats_too_much + username_purchasable + public_chats_too_many public_groups_unavailable ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/check_chat_username_result/#{type}" diff --git a/lib/tdlib/types/check_chat_username_result/public_chats_too_many.rb b/lib/tdlib/types/check_chat_username_result/public_chats_too_many.rb new file mode 100644 index 00000000..9053e13a --- /dev/null +++ b/lib/tdlib/types/check_chat_username_result/public_chats_too_many.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user has too many chats with username, one of them must be made private first. + class CheckChatUsernameResult::PublicChatsTooMany < CheckChatUsernameResult + end +end diff --git a/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb b/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb deleted file mode 100644 index 0c4825fc..00000000 --- a/lib/tdlib/types/check_chat_username_result/public_chats_too_much.rb +++ /dev/null @@ -1,5 +0,0 @@ -module TD::Types - # The user has too much chats with username, one of them should be made private first. - class CheckChatUsernameResult::PublicChatsTooMuch < CheckChatUsernameResult - end -end diff --git a/lib/tdlib/types/check_chat_username_result/username_purchasable.rb b/lib/tdlib/types/check_chat_username_result/username_purchasable.rb new file mode 100644 index 00000000..9570a336 --- /dev/null +++ b/lib/tdlib/types/check_chat_username_result/username_purchasable.rb @@ -0,0 +1,6 @@ +module TD::Types + # The username can be purchased at https://fragment.com. + # Information about the username can be received using getCollectibleItemInfo. + class CheckChatUsernameResult::UsernamePurchasable < CheckChatUsernameResult + end +end diff --git a/lib/tdlib/types/check_sticker_set_name_result.rb b/lib/tdlib/types/check_sticker_set_name_result.rb new file mode 100644 index 00000000..e65d322c --- /dev/null +++ b/lib/tdlib/types/check_sticker_set_name_result.rb @@ -0,0 +1,12 @@ +module TD::Types + # Represents result of checking whether a name can be used for a new sticker set. + class CheckStickerSetNameResult < Base + %w[ + ok + name_invalid + name_occupied + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/check_sticker_set_name_result/#{type}" + end + end +end diff --git a/lib/tdlib/types/check_sticker_set_name_result/name_invalid.rb b/lib/tdlib/types/check_sticker_set_name_result/name_invalid.rb new file mode 100644 index 00000000..b6d1026b --- /dev/null +++ b/lib/tdlib/types/check_sticker_set_name_result/name_invalid.rb @@ -0,0 +1,5 @@ +module TD::Types + # The name is invalid. + class CheckStickerSetNameResult::NameInvalid < CheckStickerSetNameResult + end +end diff --git a/lib/tdlib/types/check_sticker_set_name_result/name_occupied.rb b/lib/tdlib/types/check_sticker_set_name_result/name_occupied.rb new file mode 100644 index 00000000..4236b9e6 --- /dev/null +++ b/lib/tdlib/types/check_sticker_set_name_result/name_occupied.rb @@ -0,0 +1,5 @@ +module TD::Types + # The name is occupied. + class CheckStickerSetNameResult::NameOccupied < CheckStickerSetNameResult + end +end diff --git a/lib/tdlib/types/check_sticker_set_name_result/ok.rb b/lib/tdlib/types/check_sticker_set_name_result/ok.rb new file mode 100644 index 00000000..49ab1b62 --- /dev/null +++ b/lib/tdlib/types/check_sticker_set_name_result/ok.rb @@ -0,0 +1,5 @@ +module TD::Types + # The name can be set. + class CheckStickerSetNameResult::Ok < CheckStickerSetNameResult + end +end diff --git a/lib/tdlib/types/close_birthday_user.rb b/lib/tdlib/types/close_birthday_user.rb new file mode 100644 index 00000000..3e2af323 --- /dev/null +++ b/lib/tdlib/types/close_birthday_user.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a user that had or will have a birthday soon. + # + # @attr user_id [Integer] User identifier. + # @attr birthdate [TD::Types::Birthdate] Birthdate of the user. + class CloseBirthdayUser < Base + attribute :user_id, TD::Types::Coercible::Integer + attribute :birthdate, TD::Types::Birthdate + end +end diff --git a/lib/tdlib/types/collectible_item_info.rb b/lib/tdlib/types/collectible_item_info.rb new file mode 100644 index 00000000..bef68bc7 --- /dev/null +++ b/lib/tdlib/types/collectible_item_info.rb @@ -0,0 +1,18 @@ +module TD::Types + # Contains information about a collectible item and its last purchase. + # + # @attr purchase_date [Integer] Point in time (Unix timestamp) when the item was purchased. + # @attr currency [TD::Types::String] Currency for the paid amount. + # @attr amount [Integer] The paid amount, in the smallest units of the currency. + # @attr cryptocurrency [TD::Types::String] Cryptocurrency used to pay for the item. + # @attr cryptocurrency_amount [Integer] The paid amount, in the smallest units of the cryptocurrency. + # @attr url [TD::Types::String] Individual URL for the item on https://fragment.com. + class CollectibleItemInfo < Base + attribute :purchase_date, TD::Types::Coercible::Integer + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :cryptocurrency, TD::Types::String + attribute :cryptocurrency_amount, TD::Types::Coercible::Integer + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/collectible_item_type.rb b/lib/tdlib/types/collectible_item_type.rb new file mode 100644 index 00000000..c5b3a411 --- /dev/null +++ b/lib/tdlib/types/collectible_item_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes a collectible item that can be purchased at https://fragment.com. + class CollectibleItemType < Base + %w[ + username + phone_number + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/collectible_item_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/collectible_item_type/phone_number.rb b/lib/tdlib/types/collectible_item_type/phone_number.rb new file mode 100644 index 00000000..bb50f1e1 --- /dev/null +++ b/lib/tdlib/types/collectible_item_type/phone_number.rb @@ -0,0 +1,8 @@ +module TD::Types + # A phone number. + # + # @attr phone_number [TD::Types::String] The phone number. + class CollectibleItemType::PhoneNumber < CollectibleItemType + attribute :phone_number, TD::Types::String + end +end diff --git a/lib/tdlib/types/collectible_item_type/username.rb b/lib/tdlib/types/collectible_item_type/username.rb new file mode 100644 index 00000000..fadb93ec --- /dev/null +++ b/lib/tdlib/types/collectible_item_type/username.rb @@ -0,0 +1,8 @@ +module TD::Types + # A username. + # + # @attr username [TD::Types::String] The username. + class CollectibleItemType::Username < CollectibleItemType + attribute :username, TD::Types::String + end +end diff --git a/lib/tdlib/types/connected_website.rb b/lib/tdlib/types/connected_website.rb index 6a1fd88b..3cbf0cf4 100644 --- a/lib/tdlib/types/connected_website.rb +++ b/lib/tdlib/types/connected_website.rb @@ -8,8 +8,8 @@ module TD::Types # @attr platform [TD::Types::String] Operating system the browser is running on. # @attr log_in_date [Integer] Point in time (Unix timestamp) when the user was logged in. # @attr last_active_date [Integer] Point in time (Unix timestamp) when obtained authorization was last used. - # @attr ip [TD::Types::String] IP address from which the user was logged in, in human-readable format. - # @attr location [TD::Types::String] Human-readable description of a country and a region, from which the user was + # @attr ip_address [TD::Types::String] IP address from which the user was logged in, in human-readable format. + # @attr location [TD::Types::String] Human-readable description of a country and a region from which the user was # logged in, based on the IP address. class ConnectedWebsite < Base attribute :id, TD::Types::Coercible::Integer @@ -19,7 +19,7 @@ class ConnectedWebsite < Base attribute :platform, TD::Types::String attribute :log_in_date, TD::Types::Coercible::Integer attribute :last_active_date, TD::Types::Coercible::Integer - attribute :ip, TD::Types::String + attribute :ip_address, TD::Types::String attribute :location, TD::Types::String end end diff --git a/lib/tdlib/types/connection_state/connecting.rb b/lib/tdlib/types/connection_state/connecting.rb index 5aedc90a..0459dc6b 100644 --- a/lib/tdlib/types/connection_state/connecting.rb +++ b/lib/tdlib/types/connection_state/connecting.rb @@ -1,5 +1,5 @@ module TD::Types - # Currently establishing a connection to the Telegram servers. + # Establishing a connection to the Telegram servers. class ConnectionState::Connecting < ConnectionState end end diff --git a/lib/tdlib/types/connection_state/connecting_to_proxy.rb b/lib/tdlib/types/connection_state/connecting_to_proxy.rb index 220e0df2..f754f47d 100644 --- a/lib/tdlib/types/connection_state/connecting_to_proxy.rb +++ b/lib/tdlib/types/connection_state/connecting_to_proxy.rb @@ -1,5 +1,5 @@ module TD::Types - # Currently establishing a connection with a proxy server. + # Establishing a connection with a proxy server. class ConnectionState::ConnectingToProxy < ConnectionState end end diff --git a/lib/tdlib/types/connection_state/updating.rb b/lib/tdlib/types/connection_state/updating.rb index 43f57d7a..b5f0091f 100644 --- a/lib/tdlib/types/connection_state/updating.rb +++ b/lib/tdlib/types/connection_state/updating.rb @@ -1,5 +1,5 @@ module TD::Types - # Downloading data received while the application was offline. + # Downloading data supposed to be received while the application was offline. class ConnectionState::Updating < ConnectionState end end diff --git a/lib/tdlib/types/connection_state/waiting_for_network.rb b/lib/tdlib/types/connection_state/waiting_for_network.rb index ef4a1f40..df44a2f1 100644 --- a/lib/tdlib/types/connection_state/waiting_for_network.rb +++ b/lib/tdlib/types/connection_state/waiting_for_network.rb @@ -1,5 +1,5 @@ module TD::Types - # Currently waiting for the network to become available. + # Waiting for the network to become available. # Use setNetworkType to change the available network type. class ConnectionState::WaitingForNetwork < ConnectionState end diff --git a/lib/tdlib/types/contact.rb b/lib/tdlib/types/contact.rb index 01f25662..14e7740b 100644 --- a/lib/tdlib/types/contact.rb +++ b/lib/tdlib/types/contact.rb @@ -5,7 +5,7 @@ module TD::Types # @attr first_name [TD::Types::String] First name of the user; 1-255 characters in length. # @attr last_name [TD::Types::String] Last name of the user. # @attr vcard [TD::Types::String] Additional data about the user in a form of vCard; 0-2048 bytes in length. - # @attr user_id [Integer] Identifier of the user, if known; otherwise 0. + # @attr user_id [Integer] Identifier of the user, if known; 0 otherwise. class Contact < Base attribute :phone_number, TD::Types::String attribute :first_name, TD::Types::String diff --git a/lib/tdlib/types/country_info.rb b/lib/tdlib/types/country_info.rb index f3155619..904d7b6e 100644 --- a/lib/tdlib/types/country_info.rb +++ b/lib/tdlib/types/country_info.rb @@ -4,7 +4,7 @@ module TD::Types # @attr country_code [TD::Types::String] A two-letter ISO 3166-1 alpha-2 country code. # @attr name [TD::Types::String] Native name of the country. # @attr english_name [TD::Types::String] English name of the country. - # @attr is_hidden [Boolean] True, if the country should be hidden from the list of all countries. + # @attr is_hidden [Boolean] True, if the country must be hidden from the list of all countries. # @attr calling_codes [Array] List of country calling codes. class CountryInfo < Base attribute :country_code, TD::Types::String diff --git a/lib/tdlib/types/created_basic_group_chat.rb b/lib/tdlib/types/created_basic_group_chat.rb new file mode 100644 index 00000000..d3a192a5 --- /dev/null +++ b/lib/tdlib/types/created_basic_group_chat.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about a newly created basic group chat. + # + # @attr chat_id [Integer] Chat identifier. + # @attr failed_to_add_members [TD::Types::FailedToAddMembers] Information about failed to add members. + class CreatedBasicGroupChat < Base + attribute :chat_id, TD::Types::Coercible::Integer + attribute :failed_to_add_members, TD::Types::FailedToAddMembers + end +end diff --git a/lib/tdlib/types/current_weather.rb b/lib/tdlib/types/current_weather.rb new file mode 100644 index 00000000..d00fe48a --- /dev/null +++ b/lib/tdlib/types/current_weather.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes the current weather. + # + # @attr temperature [Float] Temperature, in degree Celsius. + # @attr emoji [TD::Types::String] Emoji representing the weather. + class CurrentWeather < Base + attribute :temperature, TD::Types::Coercible::Float + attribute :emoji, TD::Types::String + end +end diff --git a/lib/tdlib/types/deep_link_info.rb b/lib/tdlib/types/deep_link_info.rb index c4cb9afc..e7f14a65 100644 --- a/lib/tdlib/types/deep_link_info.rb +++ b/lib/tdlib/types/deep_link_info.rb @@ -1,8 +1,8 @@ module TD::Types - # Contains information about a tg:// deep link. + # Contains information about a tg: deep link. # # @attr text [TD::Types::FormattedText] Text to be shown to the user. - # @attr need_update_application [Boolean] True, if user should be asked to update the application. + # @attr need_update_application [Boolean] True, if the user must be asked to update the application. class DeepLinkInfo < Base attribute :text, TD::Types::FormattedText attribute :need_update_application, TD::Types::Bool diff --git a/lib/tdlib/types/device_token.rb b/lib/tdlib/types/device_token.rb index 47c8c725..76f78e98 100644 --- a/lib/tdlib/types/device_token.rb +++ b/lib/tdlib/types/device_token.rb @@ -15,6 +15,7 @@ class DeviceToken < Base ubuntu_push black_berry_push tizen_push + huawei_push ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/device_token/#{type}" end diff --git a/lib/tdlib/types/device_token/apple_push.rb b/lib/tdlib/types/device_token/apple_push.rb index c95c17c7..da068e9d 100644 --- a/lib/tdlib/types/device_token/apple_push.rb +++ b/lib/tdlib/types/device_token/apple_push.rb @@ -1,7 +1,7 @@ module TD::Types # A token for Apple Push Notification service. # - # @attr device_token [TD::Types::String, nil] Device token; may be empty to de-register a device. + # @attr device_token [TD::Types::String, nil] Device token; may be empty to deregister a device. # @attr is_app_sandbox [Boolean] True, if App Sandbox is enabled. class DeviceToken::ApplePush < DeviceToken attribute :device_token, TD::Types::String.optional.default(nil) diff --git a/lib/tdlib/types/device_token/apple_push_vo_ip.rb b/lib/tdlib/types/device_token/apple_push_vo_ip.rb index 87160ad6..80324203 100644 --- a/lib/tdlib/types/device_token/apple_push_vo_ip.rb +++ b/lib/tdlib/types/device_token/apple_push_vo_ip.rb @@ -1,9 +1,9 @@ module TD::Types # A token for Apple Push Notification service VoIP notifications. # - # @attr device_token [TD::Types::String, nil] Device token; may be empty to de-register a device. + # @attr device_token [TD::Types::String, nil] Device token; may be empty to deregister a device. # @attr is_app_sandbox [Boolean] True, if App Sandbox is enabled. - # @attr encrypt [Boolean] True, if push notifications should be additionally encrypted. + # @attr encrypt [Boolean] True, if push notifications must be additionally encrypted. class DeviceToken::ApplePushVoIP < DeviceToken attribute :device_token, TD::Types::String.optional.default(nil) attribute :is_app_sandbox, TD::Types::Bool diff --git a/lib/tdlib/types/device_token/black_berry_push.rb b/lib/tdlib/types/device_token/black_berry_push.rb index 6b405513..864e698d 100644 --- a/lib/tdlib/types/device_token/black_berry_push.rb +++ b/lib/tdlib/types/device_token/black_berry_push.rb @@ -1,7 +1,7 @@ module TD::Types # A token for BlackBerry Push Service. # - # @attr token [TD::Types::String, nil] Token; may be empty to de-register a device. + # @attr token [TD::Types::String, nil] Token; may be empty to deregister a device. class DeviceToken::BlackBerryPush < DeviceToken attribute :token, TD::Types::String.optional.default(nil) end diff --git a/lib/tdlib/types/device_token/firebase_cloud_messaging.rb b/lib/tdlib/types/device_token/firebase_cloud_messaging.rb index 0749e987..5cc991bf 100644 --- a/lib/tdlib/types/device_token/firebase_cloud_messaging.rb +++ b/lib/tdlib/types/device_token/firebase_cloud_messaging.rb @@ -1,8 +1,8 @@ module TD::Types # A token for Firebase Cloud Messaging. # - # @attr token [TD::Types::String, nil] Device registration token; may be empty to de-register a device. - # @attr encrypt [Boolean] True, if push notifications should be additionally encrypted. + # @attr token [TD::Types::String, nil] Device registration token; may be empty to deregister a device. + # @attr encrypt [Boolean] True, if push notifications must be additionally encrypted. class DeviceToken::FirebaseCloudMessaging < DeviceToken attribute :token, TD::Types::String.optional.default(nil) attribute :encrypt, TD::Types::Bool diff --git a/lib/tdlib/types/device_token/huawei_push.rb b/lib/tdlib/types/device_token/huawei_push.rb new file mode 100644 index 00000000..c17a9531 --- /dev/null +++ b/lib/tdlib/types/device_token/huawei_push.rb @@ -0,0 +1,10 @@ +module TD::Types + # A token for HUAWEI Push Service. + # + # @attr token [TD::Types::String, nil] Device registration token; may be empty to deregister a device. + # @attr encrypt [Boolean] True, if push notifications must be additionally encrypted. + class DeviceToken::HuaweiPush < DeviceToken + attribute :token, TD::Types::String.optional.default(nil) + attribute :encrypt, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/device_token/microsoft_push.rb b/lib/tdlib/types/device_token/microsoft_push.rb index a5395d81..d59979b9 100644 --- a/lib/tdlib/types/device_token/microsoft_push.rb +++ b/lib/tdlib/types/device_token/microsoft_push.rb @@ -1,7 +1,7 @@ module TD::Types # A token for Microsoft Push Notification Service. # - # @attr channel_uri [TD::Types::String, nil] Push notification channel URI; may be empty to de-register a device. + # @attr channel_uri [TD::Types::String, nil] Push notification channel URI; may be empty to deregister a device. class DeviceToken::MicrosoftPush < DeviceToken attribute :channel_uri, TD::Types::String.optional.default(nil) end diff --git a/lib/tdlib/types/device_token/microsoft_push_vo_ip.rb b/lib/tdlib/types/device_token/microsoft_push_vo_ip.rb index 99798dbb..1cf231a0 100644 --- a/lib/tdlib/types/device_token/microsoft_push_vo_ip.rb +++ b/lib/tdlib/types/device_token/microsoft_push_vo_ip.rb @@ -1,7 +1,7 @@ module TD::Types # A token for Microsoft Push Notification Service VoIP channel. # - # @attr channel_uri [TD::Types::String, nil] Push notification channel URI; may be empty to de-register a device. + # @attr channel_uri [TD::Types::String, nil] Push notification channel URI; may be empty to deregister a device. class DeviceToken::MicrosoftPushVoIP < DeviceToken attribute :channel_uri, TD::Types::String.optional.default(nil) end diff --git a/lib/tdlib/types/device_token/simple_push.rb b/lib/tdlib/types/device_token/simple_push.rb index f5d52242..aec1ffb6 100644 --- a/lib/tdlib/types/device_token/simple_push.rb +++ b/lib/tdlib/types/device_token/simple_push.rb @@ -2,7 +2,7 @@ module TD::Types # A token for Simple Push API for Firefox OS. # # @attr endpoint [TD::Types::String, nil] Absolute URL exposed by the push service where the application server can - # send push messages; may be empty to de-register a device. + # send push messages; may be empty to deregister a device. class DeviceToken::SimplePush < DeviceToken attribute :endpoint, TD::Types::String.optional.default(nil) end diff --git a/lib/tdlib/types/device_token/tizen_push.rb b/lib/tdlib/types/device_token/tizen_push.rb index 55556a58..6dedb378 100644 --- a/lib/tdlib/types/device_token/tizen_push.rb +++ b/lib/tdlib/types/device_token/tizen_push.rb @@ -1,7 +1,7 @@ module TD::Types # A token for Tizen Push Service. # - # @attr reg_id [TD::Types::String, nil] Push service registration identifier; may be empty to de-register a device. + # @attr reg_id [TD::Types::String, nil] Push service registration identifier; may be empty to deregister a device. class DeviceToken::TizenPush < DeviceToken attribute :reg_id, TD::Types::String.optional.default(nil) end diff --git a/lib/tdlib/types/device_token/ubuntu_push.rb b/lib/tdlib/types/device_token/ubuntu_push.rb index 77080746..a873a247 100644 --- a/lib/tdlib/types/device_token/ubuntu_push.rb +++ b/lib/tdlib/types/device_token/ubuntu_push.rb @@ -1,7 +1,7 @@ module TD::Types # A token for Ubuntu Push Client service. # - # @attr token [TD::Types::String, nil] Token; may be empty to de-register a device. + # @attr token [TD::Types::String, nil] Token; may be empty to deregister a device. class DeviceToken::UbuntuPush < DeviceToken attribute :token, TD::Types::String.optional.default(nil) end diff --git a/lib/tdlib/types/device_token/web_push.rb b/lib/tdlib/types/device_token/web_push.rb index c0d5c1af..c82ff9cc 100644 --- a/lib/tdlib/types/device_token/web_push.rb +++ b/lib/tdlib/types/device_token/web_push.rb @@ -2,7 +2,7 @@ module TD::Types # A token for web Push API. # # @attr endpoint [TD::Types::String, nil] Absolute URL exposed by the push service where the application server can - # send push messages; may be empty to de-register a device. + # send push messages; may be empty to deregister a device. # @attr p256dh_base64url [TD::Types::String] Base64url-encoded P-256 elliptic curve Diffie-Hellman public key. # @attr auth_base64url [TD::Types::String] Base64url-encoded authentication secret. class DeviceToken::WebPush < DeviceToken diff --git a/lib/tdlib/types/device_token/windows_push.rb b/lib/tdlib/types/device_token/windows_push.rb index 132a2e55..0054c2e8 100644 --- a/lib/tdlib/types/device_token/windows_push.rb +++ b/lib/tdlib/types/device_token/windows_push.rb @@ -2,7 +2,7 @@ module TD::Types # A token for Windows Push Notification Services. # # @attr access_token [TD::Types::String, nil] The access token that will be used to send notifications; may be empty - # to de-register a device. + # to deregister a device. class DeviceToken::WindowsPush < DeviceToken attribute :access_token, TD::Types::String.optional.default(nil) end diff --git a/lib/tdlib/types/dice_stickers.rb b/lib/tdlib/types/dice_stickers.rb index 6f941b62..a863839c 100644 --- a/lib/tdlib/types/dice_stickers.rb +++ b/lib/tdlib/types/dice_stickers.rb @@ -1,5 +1,5 @@ module TD::Types - # Contains animated stickers which should be used for dice animation rendering. + # Contains animated stickers which must be used for dice animation rendering. class DiceStickers < Base %w[ regular diff --git a/lib/tdlib/types/downloaded_file_counts.rb b/lib/tdlib/types/downloaded_file_counts.rb new file mode 100644 index 00000000..cf78b499 --- /dev/null +++ b/lib/tdlib/types/downloaded_file_counts.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains number of being downloaded and recently downloaded files found. + # + # @attr active_count [Integer] Number of active file downloads found, including paused. + # @attr paused_count [Integer] Number of paused file downloads found. + # @attr completed_count [Integer] Number of completed file downloads found. + class DownloadedFileCounts < Base + attribute :active_count, TD::Types::Coercible::Integer + attribute :paused_count, TD::Types::Coercible::Integer + attribute :completed_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/draft_message.rb b/lib/tdlib/types/draft_message.rb index cb441eea..88708da1 100644 --- a/lib/tdlib/types/draft_message.rb +++ b/lib/tdlib/types/draft_message.rb @@ -1,13 +1,16 @@ module TD::Types # Contains information about a message draft. # - # @attr reply_to_message_id [Integer] Identifier of the message to reply to; 0 if none. + # @attr reply_to [TD::Types::InputMessageReplyTo, nil] Information about the message to be replied; must be of the + # type inputMessageReplyToMessage; may be null if none. # @attr date [Integer] Point in time (Unix timestamp) when the draft was created. - # @attr input_message_text [TD::Types::InputMessageContent] Content of the message draft; this should always be of - # type inputMessageText. + # @attr input_message_text [TD::Types::InputMessageContent] Content of the message draft; must be of the type + # inputMessageText, inputMessageVideoNote, or inputMessageVoiceNote. + # @attr effect_id [Integer] Identifier of the effect to apply to the message when it is sent; 0 if none. class DraftMessage < Base - attribute :reply_to_message_id, TD::Types::Coercible::Integer + attribute :reply_to, TD::Types::InputMessageReplyTo.optional.default(nil) attribute :date, TD::Types::Coercible::Integer attribute :input_message_text, TD::Types::InputMessageContent + attribute :effect_id, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/email_address_authentication.rb b/lib/tdlib/types/email_address_authentication.rb new file mode 100644 index 00000000..4a8096a4 --- /dev/null +++ b/lib/tdlib/types/email_address_authentication.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains authentication data for an email address. + class EmailAddressAuthentication < Base + %w[ + code + apple_id + google_id + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/email_address_authentication/#{type}" + end + end +end diff --git a/lib/tdlib/types/email_address_authentication/apple_id.rb b/lib/tdlib/types/email_address_authentication/apple_id.rb new file mode 100644 index 00000000..78c5ef7a --- /dev/null +++ b/lib/tdlib/types/email_address_authentication/apple_id.rb @@ -0,0 +1,8 @@ +module TD::Types + # An authentication token received through Apple ID. + # + # @attr token [TD::Types::String] The token. + class EmailAddressAuthentication::AppleId < EmailAddressAuthentication + attribute :token, TD::Types::String + end +end diff --git a/lib/tdlib/types/email_address_authentication/code.rb b/lib/tdlib/types/email_address_authentication/code.rb new file mode 100644 index 00000000..b45c6497 --- /dev/null +++ b/lib/tdlib/types/email_address_authentication/code.rb @@ -0,0 +1,8 @@ +module TD::Types + # An authentication code delivered to a user's email address. + # + # @attr code [TD::Types::String] The code. + class EmailAddressAuthentication::Code < EmailAddressAuthentication + attribute :code, TD::Types::String + end +end diff --git a/lib/tdlib/types/email_address_authentication/google_id.rb b/lib/tdlib/types/email_address_authentication/google_id.rb new file mode 100644 index 00000000..e7df94c9 --- /dev/null +++ b/lib/tdlib/types/email_address_authentication/google_id.rb @@ -0,0 +1,8 @@ +module TD::Types + # An authentication token received through Google ID. + # + # @attr token [TD::Types::String] The token. + class EmailAddressAuthentication::GoogleId < EmailAddressAuthentication + attribute :token, TD::Types::String + end +end diff --git a/lib/tdlib/types/email_address_reset_state.rb b/lib/tdlib/types/email_address_reset_state.rb new file mode 100644 index 00000000..8b7ead01 --- /dev/null +++ b/lib/tdlib/types/email_address_reset_state.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes reset state of an email address. + class EmailAddressResetState < Base + %w[ + available + pending + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/email_address_reset_state/#{type}" + end + end +end diff --git a/lib/tdlib/types/email_address_reset_state/available.rb b/lib/tdlib/types/email_address_reset_state/available.rb new file mode 100644 index 00000000..162e3864 --- /dev/null +++ b/lib/tdlib/types/email_address_reset_state/available.rb @@ -0,0 +1,11 @@ +module TD::Types + # Email address can be reset after the given period. + # Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user's + # phone number. + # + # @attr wait_period [Integer] Time required to wait before the email address can be reset; 0 if the user is + # subscribed to Telegram Premium. + class EmailAddressResetState::Available < EmailAddressResetState + attribute :wait_period, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/email_address_reset_state/pending.rb b/lib/tdlib/types/email_address_reset_state/pending.rb new file mode 100644 index 00000000..4654cec4 --- /dev/null +++ b/lib/tdlib/types/email_address_reset_state/pending.rb @@ -0,0 +1,10 @@ +module TD::Types + # Email address reset has already been requested. + # Call resetAuthenticationEmailAddress to check whether immediate reset is possible. + # + # @attr reset_in [Integer] Left time before the email address will be reset, in seconds. + # {TD::Types::Update::AuthorizationState} is not sent when this field changes. + class EmailAddressResetState::Pending < EmailAddressResetState + attribute :reset_in, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/emoji_categories.rb b/lib/tdlib/types/emoji_categories.rb new file mode 100644 index 00000000..bbeca53f --- /dev/null +++ b/lib/tdlib/types/emoji_categories.rb @@ -0,0 +1,8 @@ +module TD::Types + # Represents a list of emoji categories. + # + # @attr categories [Array] List of categories. + class EmojiCategories < Base + attribute :categories, TD::Types::Array.of(TD::Types::EmojiCategory) + end +end diff --git a/lib/tdlib/types/emoji_category.rb b/lib/tdlib/types/emoji_category.rb new file mode 100644 index 00000000..eb22e5c5 --- /dev/null +++ b/lib/tdlib/types/emoji_category.rb @@ -0,0 +1,14 @@ +module TD::Types + # Describes an emoji category. + # + # @attr name [TD::Types::String] Name of the category. + # @attr icon [TD::Types::Sticker] Custom emoji sticker, which represents icon of the category. + # @attr source [TD::Types::EmojiCategorySource] Source of stickers for the emoji category. + # @attr is_greeting [Boolean] True, if the category must be shown first when choosing a sticker for the start page. + class EmojiCategory < Base + attribute :name, TD::Types::String + attribute :icon, TD::Types::Sticker + attribute :source, TD::Types::EmojiCategorySource + attribute :is_greeting, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/emoji_category_source.rb b/lib/tdlib/types/emoji_category_source.rb new file mode 100644 index 00000000..d7694ea6 --- /dev/null +++ b/lib/tdlib/types/emoji_category_source.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes source of stickers for an emoji category. + class EmojiCategorySource < Base + %w[ + search + premium + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/emoji_category_source/#{type}" + end + end +end diff --git a/lib/tdlib/types/emoji_category_source/premium.rb b/lib/tdlib/types/emoji_category_source/premium.rb new file mode 100644 index 00000000..c3998288 --- /dev/null +++ b/lib/tdlib/types/emoji_category_source/premium.rb @@ -0,0 +1,5 @@ +module TD::Types + # The category contains premium stickers that must be found by getPremiumStickers. + class EmojiCategorySource::Premium < EmojiCategorySource + end +end diff --git a/lib/tdlib/types/emoji_category_source/search.rb b/lib/tdlib/types/emoji_category_source/search.rb new file mode 100644 index 00000000..8f8c73a1 --- /dev/null +++ b/lib/tdlib/types/emoji_category_source/search.rb @@ -0,0 +1,9 @@ +module TD::Types + # The category contains a list of similar emoji to search for in getStickers and searchStickers for stickers, or + # getInlineQueryResults with the bot getOption("animation_search_bot_username") for animations. + # + # @attr emojis [Array] List of emojis to search for. + class EmojiCategorySource::Search < EmojiCategorySource + attribute :emojis, TD::Types::Array.of(TD::Types::String) + end +end diff --git a/lib/tdlib/types/emoji_category_type.rb b/lib/tdlib/types/emoji_category_type.rb new file mode 100644 index 00000000..73a16459 --- /dev/null +++ b/lib/tdlib/types/emoji_category_type.rb @@ -0,0 +1,13 @@ +module TD::Types + # Describes type of emoji category. + class EmojiCategoryType < Base + %w[ + default + regular_stickers + emoji_status + chat_photo + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/emoji_category_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/emoji_category_type/chat_photo.rb b/lib/tdlib/types/emoji_category_type/chat_photo.rb new file mode 100644 index 00000000..e7babdf3 --- /dev/null +++ b/lib/tdlib/types/emoji_category_type/chat_photo.rb @@ -0,0 +1,5 @@ +module TD::Types + # The category must be used for chat photo emoji selection. + class EmojiCategoryType::ChatPhoto < EmojiCategoryType + end +end diff --git a/lib/tdlib/types/emoji_category_type/default.rb b/lib/tdlib/types/emoji_category_type/default.rb new file mode 100644 index 00000000..3b954920 --- /dev/null +++ b/lib/tdlib/types/emoji_category_type/default.rb @@ -0,0 +1,5 @@ +module TD::Types + # The category must be used by default (e.g., for custom emoji or animation search). + class EmojiCategoryType::Default < EmojiCategoryType + end +end diff --git a/lib/tdlib/types/emoji_category_type/emoji_status.rb b/lib/tdlib/types/emoji_category_type/emoji_status.rb new file mode 100644 index 00000000..4ba6e02b --- /dev/null +++ b/lib/tdlib/types/emoji_category_type/emoji_status.rb @@ -0,0 +1,5 @@ +module TD::Types + # The category must be used for emoji status selection. + class EmojiCategoryType::EmojiStatus < EmojiCategoryType + end +end diff --git a/lib/tdlib/types/emoji_category_type/regular_stickers.rb b/lib/tdlib/types/emoji_category_type/regular_stickers.rb new file mode 100644 index 00000000..837cab00 --- /dev/null +++ b/lib/tdlib/types/emoji_category_type/regular_stickers.rb @@ -0,0 +1,6 @@ +module TD::Types + # The category must be used by default for regular sticker selection. + # It may contain greeting emoji category and premium stickers. + class EmojiCategoryType::RegularStickers < EmojiCategoryType + end +end diff --git a/lib/tdlib/types/emoji_keyword.rb b/lib/tdlib/types/emoji_keyword.rb new file mode 100644 index 00000000..9841688d --- /dev/null +++ b/lib/tdlib/types/emoji_keyword.rb @@ -0,0 +1,10 @@ +module TD::Types + # Represents an emoji with its keyword. + # + # @attr emoji [TD::Types::String] The emoji. + # @attr keyword [TD::Types::String] The keyword. + class EmojiKeyword < Base + attribute :emoji, TD::Types::String + attribute :keyword, TD::Types::String + end +end diff --git a/lib/tdlib/types/emoji_keywords.rb b/lib/tdlib/types/emoji_keywords.rb new file mode 100644 index 00000000..c32feb47 --- /dev/null +++ b/lib/tdlib/types/emoji_keywords.rb @@ -0,0 +1,8 @@ +module TD::Types + # Represents a list of emojis with their keywords. + # + # @attr emoji_keywords [Array] List of emojis with their keywords. + class EmojiKeywords < Base + attribute :emoji_keywords, TD::Types::Array.of(TD::Types::EmojiKeyword) + end +end diff --git a/lib/tdlib/types/emoji_reaction.rb b/lib/tdlib/types/emoji_reaction.rb new file mode 100644 index 00000000..920c477e --- /dev/null +++ b/lib/tdlib/types/emoji_reaction.rb @@ -0,0 +1,26 @@ +module TD::Types + # Contains information about an emoji reaction. + # + # @attr emoji [TD::Types::String] Text representation of the reaction. + # @attr title [TD::Types::String] Reaction title. + # @attr is_active [Boolean] True, if the reaction can be added to new messages and enabled in chats. + # @attr static_icon [TD::Types::Sticker] Static icon for the reaction. + # @attr appear_animation [TD::Types::Sticker] Appear animation for the reaction. + # @attr select_animation [TD::Types::Sticker] Select animation for the reaction. + # @attr activate_animation [TD::Types::Sticker] Activate animation for the reaction. + # @attr effect_animation [TD::Types::Sticker] Effect animation for the reaction. + # @attr around_animation [TD::Types::Sticker, nil] Around animation for the reaction; may be null. + # @attr center_animation [TD::Types::Sticker, nil] Center animation for the reaction; may be null. + class EmojiReaction < Base + attribute :emoji, TD::Types::String + attribute :title, TD::Types::String + attribute :is_active, TD::Types::Bool + attribute :static_icon, TD::Types::Sticker + attribute :appear_animation, TD::Types::Sticker + attribute :select_animation, TD::Types::Sticker + attribute :activate_animation, TD::Types::Sticker + attribute :effect_animation, TD::Types::Sticker + attribute :around_animation, TD::Types::Sticker.optional.default(nil) + attribute :center_animation, TD::Types::Sticker.optional.default(nil) + end +end diff --git a/lib/tdlib/types/emoji_status.rb b/lib/tdlib/types/emoji_status.rb new file mode 100644 index 00000000..347e585a --- /dev/null +++ b/lib/tdlib/types/emoji_status.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a custom emoji to be shown instead of the Telegram Premium badge. + # + # @attr custom_emoji_id [Integer] Identifier of the custom emoji in {TD::Types::StickerFormat::Tgs} format. + # @attr expiration_date [Integer] Point in time (Unix timestamp) when the status will expire; 0 if never. + class EmojiStatus < Base + attribute :custom_emoji_id, TD::Types::Coercible::Integer + attribute :expiration_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/emoji_statuses.rb b/lib/tdlib/types/emoji_statuses.rb new file mode 100644 index 00000000..e140ded1 --- /dev/null +++ b/lib/tdlib/types/emoji_statuses.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of custom emoji identifiers for emoji statuses. + # + # @attr custom_emoji_ids [Array] The list of custom emoji identifiers. + class EmojiStatuses < Base + attribute :custom_emoji_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/emojis.rb b/lib/tdlib/types/emojis.rb index b5fc874f..7e93056b 100644 --- a/lib/tdlib/types/emojis.rb +++ b/lib/tdlib/types/emojis.rb @@ -1,5 +1,5 @@ module TD::Types - # Represents a list of emoji. + # Represents a list of emojis. # # @attr emojis [Array] List of emojis. class Emojis < Base diff --git a/lib/tdlib/types/fact_check.rb b/lib/tdlib/types/fact_check.rb new file mode 100644 index 00000000..40ff8000 --- /dev/null +++ b/lib/tdlib/types/fact_check.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes a fact-check added to the message by an independent checker. + # + # @attr text [TD::Types::FormattedText] Text of the fact-check. + # @attr country_code [TD::Types::String] A two-letter ISO 3166-1 alpha-2 country code of the country for which the + # fact-check is shown. + class FactCheck < Base + attribute :text, TD::Types::FormattedText + attribute :country_code, TD::Types::String + end +end diff --git a/lib/tdlib/types/failed_to_add_member.rb b/lib/tdlib/types/failed_to_add_member.rb new file mode 100644 index 00000000..6c68c062 --- /dev/null +++ b/lib/tdlib/types/failed_to_add_member.rb @@ -0,0 +1,14 @@ +module TD::Types + # Contains information about a user that has failed to be added to a chat. + # + # @attr user_id [Integer] User identifier. + # @attr premium_would_allow_invite [Boolean] True, if subscription to Telegram Premium would have allowed to add the + # user to the chat. + # @attr premium_required_to_send_messages [Boolean] True, if subscription to Telegram Premium is required to send the + # user chat invite link. + class FailedToAddMember < Base + attribute :user_id, TD::Types::Coercible::Integer + attribute :premium_would_allow_invite, TD::Types::Bool + attribute :premium_required_to_send_messages, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/failed_to_add_members.rb b/lib/tdlib/types/failed_to_add_members.rb new file mode 100644 index 00000000..d6fe4019 --- /dev/null +++ b/lib/tdlib/types/failed_to_add_members.rb @@ -0,0 +1,9 @@ +module TD::Types + # Represents a list of users that has failed to be added to a chat. + # + # @attr failed_to_add_members [Array] Information about users that weren't added to the + # chat. + class FailedToAddMembers < Base + attribute :failed_to_add_members, TD::Types::Array.of(TD::Types::FailedToAddMember) + end +end diff --git a/lib/tdlib/types/file.rb b/lib/tdlib/types/file.rb index 97b9479d..a30b05c9 100644 --- a/lib/tdlib/types/file.rb +++ b/lib/tdlib/types/file.rb @@ -2,9 +2,8 @@ module TD::Types # Represents a file. # # @attr id [Integer] Unique file identifier. - # @attr size [Integer] File size; 0 if unknown. - # @attr expected_size [Integer] Expected file size in case the exact file size is unknown, but an approximate size is - # known. + # @attr size [Integer] File size, in bytes; 0 if unknown. + # @attr expected_size [Integer] Approximate file size in bytes in case the exact file size is unknown. # Can be used to show download/upload progress. # @attr local [TD::Types::LocalFile] Information about the local copy of the file. # @attr remote [TD::Types::RemoteFile] Information about the remote copy of the file. diff --git a/lib/tdlib/types/file_download.rb b/lib/tdlib/types/file_download.rb new file mode 100644 index 00000000..b189cb0b --- /dev/null +++ b/lib/tdlib/types/file_download.rb @@ -0,0 +1,17 @@ +module TD::Types + # Describes a file added to file download list. + # + # @attr file_id [Integer] File identifier. + # @attr message [TD::Types::Message] The message with the file. + # @attr add_date [Integer] Point in time (Unix timestamp) when the file was added to the download list. + # @attr complete_date [Integer] Point in time (Unix timestamp) when the file downloading was completed; 0 if the file + # downloading isn't completed. + # @attr is_paused [Boolean] True, if downloading of the file is paused. + class FileDownload < Base + attribute :file_id, TD::Types::Coercible::Integer + attribute :message, TD::Types::Message + attribute :add_date, TD::Types::Coercible::Integer + attribute :complete_date, TD::Types::Coercible::Integer + attribute :is_paused, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/file_downloaded_prefix_size.rb b/lib/tdlib/types/file_downloaded_prefix_size.rb new file mode 100644 index 00000000..edc6ee07 --- /dev/null +++ b/lib/tdlib/types/file_downloaded_prefix_size.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains size of downloaded prefix of a file. + # + # @attr size [Integer] The prefix size, in bytes. + class FileDownloadedPrefixSize < Base + attribute :size, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/file_type.rb b/lib/tdlib/types/file_type.rb index ed1e7e07..c8fb568c 100644 --- a/lib/tdlib/types/file_type.rb +++ b/lib/tdlib/types/file_type.rb @@ -1,12 +1,14 @@ module TD::Types - # Represents the type of a file. + # Represents the type of file. class FileType < Base %w[ none animation audio document + notification_sound photo + photo_story profile_photo secret secret_thumbnail @@ -16,6 +18,7 @@ class FileType < Base unknown video video_note + video_story voice_note wallpaper ].each do |type| diff --git a/lib/tdlib/types/file_type/notification_sound.rb b/lib/tdlib/types/file_type/notification_sound.rb new file mode 100644 index 00000000..7777d1b4 --- /dev/null +++ b/lib/tdlib/types/file_type/notification_sound.rb @@ -0,0 +1,5 @@ +module TD::Types + # The file is a notification sound. + class FileType::NotificationSound < FileType + end +end diff --git a/lib/tdlib/types/file_type/photo_story.rb b/lib/tdlib/types/file_type/photo_story.rb new file mode 100644 index 00000000..514ffb28 --- /dev/null +++ b/lib/tdlib/types/file_type/photo_story.rb @@ -0,0 +1,5 @@ +module TD::Types + # The file is a photo published as a story. + class FileType::PhotoStory < FileType + end +end diff --git a/lib/tdlib/types/file_type/video_story.rb b/lib/tdlib/types/file_type/video_story.rb new file mode 100644 index 00000000..8d5d78c2 --- /dev/null +++ b/lib/tdlib/types/file_type/video_story.rb @@ -0,0 +1,5 @@ +module TD::Types + # The file is a video published as a story. + class FileType::VideoStory < FileType + end +end diff --git a/lib/tdlib/types/firebase_authentication_settings.rb b/lib/tdlib/types/firebase_authentication_settings.rb new file mode 100644 index 00000000..7e3cd35d --- /dev/null +++ b/lib/tdlib/types/firebase_authentication_settings.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains settings for Firebase Authentication in the official applications. + class FirebaseAuthenticationSettings < Base + %w[ + android + ios + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/firebase_authentication_settings/#{type}" + end + end +end diff --git a/lib/tdlib/types/firebase_authentication_settings/android.rb b/lib/tdlib/types/firebase_authentication_settings/android.rb new file mode 100644 index 00000000..c03a773a --- /dev/null +++ b/lib/tdlib/types/firebase_authentication_settings/android.rb @@ -0,0 +1,5 @@ +module TD::Types + # Settings for Firebase Authentication in the official Android application. + class FirebaseAuthenticationSettings::Android < FirebaseAuthenticationSettings + end +end diff --git a/lib/tdlib/types/firebase_authentication_settings/ios.rb b/lib/tdlib/types/firebase_authentication_settings/ios.rb new file mode 100644 index 00000000..6590fffa --- /dev/null +++ b/lib/tdlib/types/firebase_authentication_settings/ios.rb @@ -0,0 +1,10 @@ +module TD::Types + # Settings for Firebase Authentication in the official iOS application. + # + # @attr device_token [TD::Types::String] Device token from Apple Push Notification service. + # @attr is_app_sandbox [Boolean] True, if App Sandbox is enabled. + class FirebaseAuthenticationSettings::Ios < FirebaseAuthenticationSettings + attribute :device_token, TD::Types::String + attribute :is_app_sandbox, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/firebase_device_verification_parameters.rb b/lib/tdlib/types/firebase_device_verification_parameters.rb new file mode 100644 index 00000000..ceedbee8 --- /dev/null +++ b/lib/tdlib/types/firebase_device_verification_parameters.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes parameters to be used for device verification. + class FirebaseDeviceVerificationParameters < Base + %w[ + safety_net + play_integrity + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/firebase_device_verification_parameters/#{type}" + end + end +end diff --git a/lib/tdlib/types/firebase_device_verification_parameters/play_integrity.rb b/lib/tdlib/types/firebase_device_verification_parameters/play_integrity.rb new file mode 100644 index 00000000..16aa4cd0 --- /dev/null +++ b/lib/tdlib/types/firebase_device_verification_parameters/play_integrity.rb @@ -0,0 +1,11 @@ +module TD::Types + # Device verification must be performed with the classic Play Integrity verification + # (https://developer.android.com/google/play/integrity/classic). + # + # @attr nonce [TD::Types::String] Base64url-encoded nonce to pass to the Play Integrity API. + # @attr cloud_project_number [Integer] Cloud project number to pass to the Play Integrity API. + class FirebaseDeviceVerificationParameters::PlayIntegrity < FirebaseDeviceVerificationParameters + attribute :nonce, TD::Types::String + attribute :cloud_project_number, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/firebase_device_verification_parameters/safety_net.rb b/lib/tdlib/types/firebase_device_verification_parameters/safety_net.rb new file mode 100644 index 00000000..84b4caf7 --- /dev/null +++ b/lib/tdlib/types/firebase_device_verification_parameters/safety_net.rb @@ -0,0 +1,8 @@ +module TD::Types + # Device verification must be performed with the SafetyNet Attestation API. + # + # @attr nonce [String] Nonce to pass to the SafetyNet Attestation API. + class FirebaseDeviceVerificationParameters::SafetyNet < FirebaseDeviceVerificationParameters + attribute :nonce, TD::Types::Coercible::String + end +end diff --git a/lib/tdlib/types/formatted_text.rb b/lib/tdlib/types/formatted_text.rb index 3dacae6c..586ed804 100644 --- a/lib/tdlib/types/formatted_text.rb +++ b/lib/tdlib/types/formatted_text.rb @@ -5,7 +5,8 @@ module TD::Types # @attr entities [Array] Entities contained in the text. # Entities can be nested, but must not mutually intersect with each other. # Pre, Code and PreCode entities can't contain other entities. - # Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. + # BlockQuote entities can't contain other BlockQuote entities. + # Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. # All other entities can't contain each other. class FormattedText < Base attribute :text, TD::Types::String diff --git a/lib/tdlib/types/forum_topic.rb b/lib/tdlib/types/forum_topic.rb new file mode 100644 index 00000000..adca11eb --- /dev/null +++ b/lib/tdlib/types/forum_topic.rb @@ -0,0 +1,26 @@ +module TD::Types + # Describes a forum topic. + # + # @attr info [TD::Types::ForumTopicInfo] Basic information about the topic. + # @attr last_message [TD::Types::Message, nil] Last message in the topic; may be null if unknown. + # @attr is_pinned [Boolean] True, if the topic is pinned in the topic list. + # @attr unread_count [Integer] Number of unread messages in the topic. + # @attr last_read_inbox_message_id [Integer] Identifier of the last read incoming message. + # @attr last_read_outbox_message_id [Integer] Identifier of the last read outgoing message. + # @attr unread_mention_count [Integer] Number of unread messages with a mention/reply in the topic. + # @attr unread_reaction_count [Integer] Number of messages with unread reactions in the topic. + # @attr notification_settings [TD::Types::ChatNotificationSettings] Notification settings for the topic. + # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the topic; may be null if none. + class ForumTopic < Base + attribute :info, TD::Types::ForumTopicInfo + attribute :last_message, TD::Types::Message.optional.default(nil) + attribute :is_pinned, TD::Types::Bool + attribute :unread_count, TD::Types::Coercible::Integer + attribute :last_read_inbox_message_id, TD::Types::Coercible::Integer + attribute :last_read_outbox_message_id, TD::Types::Coercible::Integer + attribute :unread_mention_count, TD::Types::Coercible::Integer + attribute :unread_reaction_count, TD::Types::Coercible::Integer + attribute :notification_settings, TD::Types::ChatNotificationSettings + attribute :draft_message, TD::Types::DraftMessage.optional.default(nil) + end +end diff --git a/lib/tdlib/types/forum_topic_icon.rb b/lib/tdlib/types/forum_topic_icon.rb new file mode 100644 index 00000000..2cc96a1c --- /dev/null +++ b/lib/tdlib/types/forum_topic_icon.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a forum topic icon. + # + # @attr color [Integer] Color of the topic icon in RGB format. + # @attr custom_emoji_id [Integer] Unique identifier of the custom emoji shown on the topic icon; 0 if none. + class ForumTopicIcon < Base + attribute :color, TD::Types::Coercible::Integer + attribute :custom_emoji_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/forum_topic_info.rb b/lib/tdlib/types/forum_topic_info.rb new file mode 100644 index 00000000..f1e63adf --- /dev/null +++ b/lib/tdlib/types/forum_topic_info.rb @@ -0,0 +1,24 @@ +module TD::Types + # Contains basic information about a forum topic. + # + # @attr message_thread_id [Integer] Message thread identifier of the topic. + # @attr name [TD::Types::String] Name of the topic. + # @attr icon [TD::Types::ForumTopicIcon] Icon of the topic. + # @attr creation_date [Integer] Point in time (Unix timestamp) when the topic was created. + # @attr creator_id [TD::Types::MessageSender] Identifier of the creator of the topic. + # @attr is_general [Boolean] True, if the topic is the General topic list. + # @attr is_outgoing [Boolean] True, if the topic was created by the current user. + # @attr is_closed [Boolean] True, if the topic is closed. + # @attr is_hidden [Boolean] True, if the topic is hidden above the topic list and closed; for General topic only. + class ForumTopicInfo < Base + attribute :message_thread_id, TD::Types::Coercible::Integer + attribute :name, TD::Types::String + attribute :icon, TD::Types::ForumTopicIcon + attribute :creation_date, TD::Types::Coercible::Integer + attribute :creator_id, TD::Types::MessageSender + attribute :is_general, TD::Types::Bool + attribute :is_outgoing, TD::Types::Bool + attribute :is_closed, TD::Types::Bool + attribute :is_hidden, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/forum_topics.rb b/lib/tdlib/types/forum_topics.rb new file mode 100644 index 00000000..c88f2443 --- /dev/null +++ b/lib/tdlib/types/forum_topics.rb @@ -0,0 +1,16 @@ +module TD::Types + # Describes a list of forum topics. + # + # @attr total_count [Integer] Approximate total number of forum topics found. + # @attr topics [Array] List of forum topics. + # @attr next_offset_date [Integer] Offset date for the next getForumTopics request. + # @attr next_offset_message_id [Integer] Offset message identifier for the next getForumTopics request. + # @attr next_offset_message_thread_id [Integer] Offset message thread identifier for the next getForumTopics request. + class ForumTopics < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :topics, TD::Types::Array.of(TD::Types::ForumTopic) + attribute :next_offset_date, TD::Types::Coercible::Integer + attribute :next_offset_message_id, TD::Types::Coercible::Integer + attribute :next_offset_message_thread_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/forward_source.rb b/lib/tdlib/types/forward_source.rb new file mode 100644 index 00000000..ec60f418 --- /dev/null +++ b/lib/tdlib/types/forward_source.rb @@ -0,0 +1,21 @@ +module TD::Types + # Contains information about the last message from which a new message was forwarded last time. + # + # @attr chat_id [Integer] Identifier of the chat to which the message that was forwarded belonged; may be 0 if + # unknown. + # @attr message_id [Integer] Identifier of the message; may be 0 if unknown. + # @attr sender_id [TD::Types::MessageSender, nil] Identifier of the sender of the message; may be null if unknown or + # the new message was forwarded not to Saved Messages. + # @attr sender_name [TD::Types::String] Name of the sender of the message if the sender is hidden by their privacy + # settings. + # @attr date [Integer] Point in time (Unix timestamp) when the message is sent; 0 if unknown. + # @attr is_outgoing [Boolean] True, if the message that was forwarded is outgoing; always false if sender is unknown. + class ForwardSource < Base + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :sender_id, TD::Types::MessageSender.optional.default(nil) + attribute :sender_name, TD::Types::String + attribute :date, TD::Types::Coercible::Integer + attribute :is_outgoing, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/found_chat_boosts.rb b/lib/tdlib/types/found_chat_boosts.rb new file mode 100644 index 00000000..5e2af71c --- /dev/null +++ b/lib/tdlib/types/found_chat_boosts.rb @@ -0,0 +1,13 @@ +module TD::Types + # Contains a list of boosts applied to a chat. + # + # @attr total_count [Integer] Total number of boosts applied to the chat. + # @attr boosts [Array] List of boosts. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. + class FoundChatBoosts < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :boosts, TD::Types::Array.of(TD::Types::ChatBoost) + attribute :next_offset, TD::Types::String + end +end diff --git a/lib/tdlib/types/found_chat_messages.rb b/lib/tdlib/types/found_chat_messages.rb new file mode 100644 index 00000000..b56ff856 --- /dev/null +++ b/lib/tdlib/types/found_chat_messages.rb @@ -0,0 +1,13 @@ +module TD::Types + # Contains a list of messages found by a search in a given chat. + # + # @attr total_count [Integer] Approximate total number of messages found; -1 if unknown. + # @attr messages [Array] List of messages. + # @attr next_from_message_id [Integer] The offset for the next request. + # If 0, there are no more results. + class FoundChatMessages < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :messages, TD::Types::Array.of(TD::Types::Message) + attribute :next_from_message_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/found_file_downloads.rb b/lib/tdlib/types/found_file_downloads.rb new file mode 100644 index 00000000..0b1681cb --- /dev/null +++ b/lib/tdlib/types/found_file_downloads.rb @@ -0,0 +1,13 @@ +module TD::Types + # Contains a list of downloaded files, found by a search. + # + # @attr total_counts [TD::Types::DownloadedFileCounts] Total number of suitable files, ignoring offset. + # @attr files [Array] The list of files. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. + class FoundFileDownloads < Base + attribute :total_counts, TD::Types::DownloadedFileCounts + attribute :files, TD::Types::Array.of(TD::Types::FileDownload) + attribute :next_offset, TD::Types::String + end +end diff --git a/lib/tdlib/types/found_messages.rb b/lib/tdlib/types/found_messages.rb index b888f6a7..6fdcf3a8 100644 --- a/lib/tdlib/types/found_messages.rb +++ b/lib/tdlib/types/found_messages.rb @@ -1,10 +1,10 @@ module TD::Types # Contains a list of messages found by a search. # - # @attr total_count [Integer] Approximate total count of messages found; -1 if unknown. + # @attr total_count [Integer] Approximate total number of messages found; -1 if unknown. # @attr messages [Array] List of messages. # @attr next_offset [TD::Types::String] The offset for the next request. - # If empty, there are no more results. + # If empty, then there are no more results. class FoundMessages < Base attribute :total_count, TD::Types::Coercible::Integer attribute :messages, TD::Types::Array.of(TD::Types::Message) diff --git a/lib/tdlib/types/found_position.rb b/lib/tdlib/types/found_position.rb new file mode 100644 index 00000000..9b48f007 --- /dev/null +++ b/lib/tdlib/types/found_position.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains 0-based match position. + # + # @attr position [Integer] The position of the match. + class FoundPosition < Base + attribute :position, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/found_positions.rb b/lib/tdlib/types/found_positions.rb new file mode 100644 index 00000000..9523fc24 --- /dev/null +++ b/lib/tdlib/types/found_positions.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains 0-based positions of matched objects. + # + # @attr total_count [Integer] Total number of matched objects. + # @attr positions [Array] The positions of the matched objects. + class FoundPositions < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :positions, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/found_stories.rb b/lib/tdlib/types/found_stories.rb new file mode 100644 index 00000000..402eafb5 --- /dev/null +++ b/lib/tdlib/types/found_stories.rb @@ -0,0 +1,13 @@ +module TD::Types + # Contains a list of stories found by a search. + # + # @attr total_count [Integer] Approximate total number of stories found. + # @attr stories [Array] List of stories. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. + class FoundStories < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :stories, TD::Types::Array.of(TD::Types::Story) + attribute :next_offset, TD::Types::String + end +end diff --git a/lib/tdlib/types/found_users.rb b/lib/tdlib/types/found_users.rb new file mode 100644 index 00000000..4b04b888 --- /dev/null +++ b/lib/tdlib/types/found_users.rb @@ -0,0 +1,11 @@ +module TD::Types + # Represents a list of found users. + # + # @attr user_ids [Array] Identifiers of the found users. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. + class FoundUsers < Base + attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :next_offset, TD::Types::String + end +end diff --git a/lib/tdlib/types/found_web_app.rb b/lib/tdlib/types/found_web_app.rb new file mode 100644 index 00000000..7ffb3231 --- /dev/null +++ b/lib/tdlib/types/found_web_app.rb @@ -0,0 +1,15 @@ +module TD::Types + # Contains information about a Web App found by its short name. + # + # @attr web_app [TD::Types::WebApp] The Web App. + # @attr request_write_access [Boolean] True, if the user must be asked for the permission to the bot to send them + # messages. + # @attr skip_confirmation [Boolean] True, if there is no need to show an ordinary open URL confirmation before + # opening the Web App. + # The field must be ignored and confirmation must be shown anyway if the Web App link was hidden. + class FoundWebApp < Base + attribute :web_app, TD::Types::WebApp + attribute :request_write_access, TD::Types::Bool + attribute :skip_confirmation, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/game.rb b/lib/tdlib/types/game.rb index 8c9b22ce..8d3589be 100644 --- a/lib/tdlib/types/game.rb +++ b/lib/tdlib/types/game.rb @@ -1,9 +1,9 @@ module TD::Types # Describes a game. + # Use getInternalLink with internalLinkTypeGame to share the game. # - # @attr id [Integer] Game ID. + # @attr id [Integer] Unique game identifier. # @attr short_name [TD::Types::String] Game short name. - # To share a game use the URL https://t.me/{bot_username}?game={game_short_name}. # @attr title [TD::Types::String] Game title. # @attr text [TD::Types::FormattedText] Game text, usually containing scoreboards for a game. # @attr description [TD::Types::String] Game description. diff --git a/lib/tdlib/types/group_call.rb b/lib/tdlib/types/group_call.rb index 9fdb5b29..dbf62f97 100644 --- a/lib/tdlib/types/group_call.rb +++ b/lib/tdlib/types/group_call.rb @@ -6,37 +6,51 @@ module TD::Types # @attr scheduled_start_date [Integer] Point in time (Unix timestamp) when the group call is supposed to be started # by an administrator; 0 if it is already active or was ended. # @attr enabled_start_notification [Boolean] True, if the group call is scheduled and the current user will receive a - # notification when the group call will start. + # notification when the group call starts. # @attr is_active [Boolean] True, if the call is active. + # @attr is_rtmp_stream [Boolean] True, if the chat is an RTMP stream instead of an ordinary video chat. # @attr is_joined [Boolean] True, if the call is joined. # @attr need_rejoin [Boolean] True, if user was kicked from the call because of network loss and the call needs to be # rejoined. # @attr can_be_managed [Boolean] True, if the current user can manage the group call. # @attr participant_count [Integer] Number of participants in the group call. + # @attr has_hidden_listeners [Boolean] True, if group call participants, which are muted, aren't returned in + # participant list. # @attr loaded_all_participants [Boolean] True, if all group call participants are loaded. - # @attr recent_speakers [Array] Recently speaking users in the group call. + # @attr recent_speakers [Array] At most 3 recently speaking users in the group + # call. + # @attr is_my_video_enabled [Boolean] True, if the current user's video is enabled. + # @attr is_my_video_paused [Boolean] True, if the current user's video is paused. + # @attr can_enable_video [Boolean] True, if the current user can broadcast video or share screen. # @attr mute_new_participants [Boolean] True, if only group call administrators can unmute new participants. - # @attr can_change_mute_new_participants [Boolean] True, if the current user can enable or disable + # @attr can_toggle_mute_new_participants [Boolean] True, if the current user can enable or disable # mute_new_participants setting. # @attr record_duration [Integer] Duration of the ongoing group call recording, in seconds; 0 if none. # An {TD::Types::Update::GroupCall} update is not triggered when value of this field changes, but the same # recording goes on. - # @attr duration [Integer] Call duration; for ended calls only. + # @attr is_video_recorded [Boolean] True, if a video file is being recorded for the call. + # @attr duration [Integer] Call duration, in seconds; for ended calls only. class GroupCall < Base attribute :id, TD::Types::Coercible::Integer attribute :title, TD::Types::String attribute :scheduled_start_date, TD::Types::Coercible::Integer attribute :enabled_start_notification, TD::Types::Bool attribute :is_active, TD::Types::Bool + attribute :is_rtmp_stream, TD::Types::Bool attribute :is_joined, TD::Types::Bool attribute :need_rejoin, TD::Types::Bool attribute :can_be_managed, TD::Types::Bool attribute :participant_count, TD::Types::Coercible::Integer + attribute :has_hidden_listeners, TD::Types::Bool attribute :loaded_all_participants, TD::Types::Bool attribute :recent_speakers, TD::Types::Array.of(TD::Types::GroupCallRecentSpeaker) + attribute :is_my_video_enabled, TD::Types::Bool + attribute :is_my_video_paused, TD::Types::Bool + attribute :can_enable_video, TD::Types::Bool attribute :mute_new_participants, TD::Types::Bool - attribute :can_change_mute_new_participants, TD::Types::Bool + attribute :can_toggle_mute_new_participants, TD::Types::Bool attribute :record_duration, TD::Types::Coercible::Integer + attribute :is_video_recorded, TD::Types::Bool attribute :duration, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/group_call_join_response.rb b/lib/tdlib/types/group_call_join_response.rb deleted file mode 100644 index 7ace579e..00000000 --- a/lib/tdlib/types/group_call_join_response.rb +++ /dev/null @@ -1,11 +0,0 @@ -module TD::Types - # Describes a group call join response. - class GroupCallJoinResponse < Base - %w[ - webrtc - stream - ].each do |type| - autoload TD::Types.camelize(type), "tdlib/types/group_call_join_response/#{type}" - end - end -end diff --git a/lib/tdlib/types/group_call_join_response/stream.rb b/lib/tdlib/types/group_call_join_response/stream.rb deleted file mode 100644 index fb8f2c78..00000000 --- a/lib/tdlib/types/group_call_join_response/stream.rb +++ /dev/null @@ -1,5 +0,0 @@ -module TD::Types - # Describes that group call needs to be joined as a stream. - class GroupCallJoinResponse::Stream < GroupCallJoinResponse - end -end diff --git a/lib/tdlib/types/group_call_join_response/webrtc.rb b/lib/tdlib/types/group_call_join_response/webrtc.rb deleted file mode 100644 index 9a17936a..00000000 --- a/lib/tdlib/types/group_call_join_response/webrtc.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # Contains data needed to join the group call with WebRTC. - # - # @attr payload [TD::Types::GroupCallPayload] Group call payload to pass to tgcalls. - # @attr candidates [Array] Join response candidates to pass to tgcalls. - class GroupCallJoinResponse::Webrtc < GroupCallJoinResponse - attribute :payload, TD::Types::GroupCallPayload - attribute :candidates, TD::Types::Array.of(TD::Types::GroupCallJoinResponseCandidate) - end -end diff --git a/lib/tdlib/types/group_call_join_response_candidate.rb b/lib/tdlib/types/group_call_join_response_candidate.rb deleted file mode 100644 index c4e04292..00000000 --- a/lib/tdlib/types/group_call_join_response_candidate.rb +++ /dev/null @@ -1,32 +0,0 @@ -module TD::Types - # Describes a join response candidate for interaction with tgcalls. - # - # @attr port [TD::Types::String] Value of the field port. - # @attr protocol [TD::Types::String] Value of the field protocol. - # @attr network [TD::Types::String] Value of the field network. - # @attr generation [TD::Types::String] Value of the field generation. - # @attr id [TD::Types::String] Value of the field id. - # @attr component [TD::Types::String] Value of the field component. - # @attr foundation [TD::Types::String] Value of the field foundation. - # @attr priority [TD::Types::String] Value of the field priority. - # @attr ip [TD::Types::String] Value of the field ip. - # @attr type [TD::Types::String] Value of the field type. - # @attr tcp_type [TD::Types::String] Value of the field tcp_type. - # @attr rel_addr [TD::Types::String] Value of the field rel_addr. - # @attr rel_port [TD::Types::String] Value of the field rel_port. - class GroupCallJoinResponseCandidate < Base - attribute :port, TD::Types::String - attribute :protocol, TD::Types::String - attribute :network, TD::Types::String - attribute :generation, TD::Types::String - attribute :id, TD::Types::String - attribute :component, TD::Types::String - attribute :foundation, TD::Types::String - attribute :priority, TD::Types::String - attribute :ip, TD::Types::String - attribute :type, TD::Types::String - attribute :tcp_type, TD::Types::String - attribute :rel_addr, TD::Types::String - attribute :rel_port, TD::Types::String - end -end diff --git a/lib/tdlib/types/group_call_participant.rb b/lib/tdlib/types/group_call_participant.rb index b21ad7e3..a4acebc8 100644 --- a/lib/tdlib/types/group_call_participant.rb +++ b/lib/tdlib/types/group_call_participant.rb @@ -2,20 +2,26 @@ module TD::Types # Represents a group call participant. # # @attr participant_id [TD::Types::MessageSender] Identifier of the group call participant. - # @attr source [Integer] User's synchronization source. + # @attr audio_source_id [Integer] User's audio channel synchronization source identifier. + # @attr screen_sharing_audio_source_id [Integer] User's screen sharing audio channel synchronization source + # identifier. + # @attr video_info [TD::Types::GroupCallParticipantVideoInfo, nil] Information about user's video channel; may be + # null if there is no active video. + # @attr screen_sharing_video_info [TD::Types::GroupCallParticipantVideoInfo, nil] Information about user's screen + # sharing video channel; may be null if there is no active screen sharing video. # @attr bio [TD::Types::String] The participant user's bio or the participant chat's description. # @attr is_current_user [Boolean] True, if the participant is the current user. # @attr is_speaking [Boolean] True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking. # @attr is_hand_raised [Boolean] True, if the participant hand is raised. # @attr can_be_muted_for_all_users [Boolean] True, if the current user can mute the participant for all other group # call participants. - # @attr can_be_unmuted_for_all_users [Boolean] True, if the current user can allow the participant to unmute themself - # or unmute the participant (if the participant is the current user). + # @attr can_be_unmuted_for_all_users [Boolean] True, if the current user can allow the participant to unmute + # themselves or unmute the participant (if the participant is the current user). # @attr can_be_muted_for_current_user [Boolean] True, if the current user can mute the participant only for self. # @attr can_be_unmuted_for_current_user [Boolean] True, if the current user can unmute the participant for self. # @attr is_muted_for_all_users [Boolean] True, if the participant is muted for all users. # @attr is_muted_for_current_user [Boolean] True, if the participant is muted for the current user. - # @attr can_unmute_self [Boolean] True, if the participant is muted for all users, but can unmute themself. + # @attr can_unmute_self [Boolean] True, if the participant is muted for all users, but can unmute themselves. # @attr volume_level [Integer] Participant's volume level; 1-20000 in hundreds of percents. # @attr order [TD::Types::String] User's order in the group call participant list. # Orders must be compared lexicographically. @@ -23,7 +29,10 @@ module TD::Types # If order is empty, the user must be removed from the participant list. class GroupCallParticipant < Base attribute :participant_id, TD::Types::MessageSender - attribute :source, TD::Types::Coercible::Integer + attribute :audio_source_id, TD::Types::Coercible::Integer + attribute :screen_sharing_audio_source_id, TD::Types::Coercible::Integer + attribute :video_info, TD::Types::GroupCallParticipantVideoInfo.optional.default(nil) + attribute :screen_sharing_video_info, TD::Types::GroupCallParticipantVideoInfo.optional.default(nil) attribute :bio, TD::Types::String attribute :is_current_user, TD::Types::Bool attribute :is_speaking, TD::Types::Bool diff --git a/lib/tdlib/types/group_call_participant_video_info.rb b/lib/tdlib/types/group_call_participant_video_info.rb new file mode 100644 index 00000000..7bc94b26 --- /dev/null +++ b/lib/tdlib/types/group_call_participant_video_info.rb @@ -0,0 +1,14 @@ +module TD::Types + # Contains information about a group call participant's video channel. + # + # @attr source_groups [Array] List of synchronization source groups of the + # video. + # @attr endpoint_id [TD::Types::String] Video channel endpoint identifier. + # @attr is_paused [Boolean] True, if the video is paused. + # This flag needs to be ignored, if new video frames are received. + class GroupCallParticipantVideoInfo < Base + attribute :source_groups, TD::Types::Array.of(TD::Types::GroupCallVideoSourceGroup) + attribute :endpoint_id, TD::Types::String + attribute :is_paused, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/group_call_payload.rb b/lib/tdlib/types/group_call_payload.rb deleted file mode 100644 index 9ad17f7b..00000000 --- a/lib/tdlib/types/group_call_payload.rb +++ /dev/null @@ -1,12 +0,0 @@ -module TD::Types - # Describes a payload for interaction with tgcalls. - # - # @attr ufrag [TD::Types::String] Value of the field ufrag. - # @attr pwd [TD::Types::String] Value of the field pwd. - # @attr fingerprints [Array] The list of fingerprints. - class GroupCallPayload < Base - attribute :ufrag, TD::Types::String - attribute :pwd, TD::Types::String - attribute :fingerprints, TD::Types::Array.of(TD::Types::GroupCallPayloadFingerprint) - end -end diff --git a/lib/tdlib/types/group_call_payload_fingerprint.rb b/lib/tdlib/types/group_call_payload_fingerprint.rb deleted file mode 100644 index 0ec1a7ff..00000000 --- a/lib/tdlib/types/group_call_payload_fingerprint.rb +++ /dev/null @@ -1,12 +0,0 @@ -module TD::Types - # Describes a payload fingerprint for interaction with tgcalls. - # - # @attr hash [TD::Types::String] Value of the field hash. - # @attr setup [TD::Types::String] Value of the field setup. - # @attr fingerprint [TD::Types::String] Value of the field fingerprint. - class GroupCallPayloadFingerprint < Base - attribute :hash, TD::Types::String - attribute :setup, TD::Types::String - attribute :fingerprint, TD::Types::String - end -end diff --git a/lib/tdlib/types/group_call_stream.rb b/lib/tdlib/types/group_call_stream.rb new file mode 100644 index 00000000..bd6b4614 --- /dev/null +++ b/lib/tdlib/types/group_call_stream.rb @@ -0,0 +1,13 @@ +module TD::Types + # Describes an available stream in a group call. + # + # @attr channel_id [Integer] Identifier of an audio/video channel. + # @attr scale [Integer] Scale of segment durations in the stream. + # The duration is 1000/(2**scale) milliseconds. + # @attr time_offset [Integer] Point in time when the stream currently ends; Unix timestamp in milliseconds. + class GroupCallStream < Base + attribute :channel_id, TD::Types::Coercible::Integer + attribute :scale, TD::Types::Coercible::Integer + attribute :time_offset, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/group_call_streams.rb b/lib/tdlib/types/group_call_streams.rb new file mode 100644 index 00000000..3cbc168d --- /dev/null +++ b/lib/tdlib/types/group_call_streams.rb @@ -0,0 +1,8 @@ +module TD::Types + # Represents a list of group call streams. + # + # @attr streams [Array] A list of group call streams. + class GroupCallStreams < Base + attribute :streams, TD::Types::Array.of(TD::Types::GroupCallStream) + end +end diff --git a/lib/tdlib/types/group_call_video_quality.rb b/lib/tdlib/types/group_call_video_quality.rb new file mode 100644 index 00000000..b63c46d5 --- /dev/null +++ b/lib/tdlib/types/group_call_video_quality.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes the quality of a group call video. + class GroupCallVideoQuality < Base + %w[ + thumbnail + medium + full + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/group_call_video_quality/#{type}" + end + end +end diff --git a/lib/tdlib/types/group_call_video_quality/full.rb b/lib/tdlib/types/group_call_video_quality/full.rb new file mode 100644 index 00000000..397de8bd --- /dev/null +++ b/lib/tdlib/types/group_call_video_quality/full.rb @@ -0,0 +1,5 @@ +module TD::Types + # The best available video quality. + class GroupCallVideoQuality::Full < GroupCallVideoQuality + end +end diff --git a/lib/tdlib/types/group_call_video_quality/medium.rb b/lib/tdlib/types/group_call_video_quality/medium.rb new file mode 100644 index 00000000..2a17d040 --- /dev/null +++ b/lib/tdlib/types/group_call_video_quality/medium.rb @@ -0,0 +1,5 @@ +module TD::Types + # The medium video quality. + class GroupCallVideoQuality::Medium < GroupCallVideoQuality + end +end diff --git a/lib/tdlib/types/group_call_video_quality/thumbnail.rb b/lib/tdlib/types/group_call_video_quality/thumbnail.rb new file mode 100644 index 00000000..b0c54f60 --- /dev/null +++ b/lib/tdlib/types/group_call_video_quality/thumbnail.rb @@ -0,0 +1,5 @@ +module TD::Types + # The worst available video quality. + class GroupCallVideoQuality::Thumbnail < GroupCallVideoQuality + end +end diff --git a/lib/tdlib/types/group_call_video_source_group.rb b/lib/tdlib/types/group_call_video_source_group.rb new file mode 100644 index 00000000..30c7978a --- /dev/null +++ b/lib/tdlib/types/group_call_video_source_group.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a group of video synchronization source identifiers. + # + # @attr semantics [TD::Types::String] The semantics of sources, one of "SIM" or "FID". + # @attr source_ids [Array] The list of synchronization source identifiers. + class GroupCallVideoSourceGroup < Base + attribute :semantics, TD::Types::String + attribute :source_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/identity_document.rb b/lib/tdlib/types/identity_document.rb index 8ac33fc7..50be885a 100644 --- a/lib/tdlib/types/identity_document.rb +++ b/lib/tdlib/types/identity_document.rb @@ -2,17 +2,18 @@ module TD::Types # An identity document. # # @attr number [TD::Types::String] Document number; 1-24 characters. - # @attr expiry_date [TD::Types::Date, nil] Document expiry date; may be null. + # @attr expiration_date [TD::Types::Date, nil] Document expiration date; may be null if not applicable. # @attr front_side [TD::Types::DatedFile] Front side of the document. - # @attr reverse_side [TD::Types::DatedFile] Reverse side of the document; only for driver license and identity card. + # @attr reverse_side [TD::Types::DatedFile, nil] Reverse side of the document; only for driver license and identity + # card; may be null. # @attr selfie [TD::Types::DatedFile, nil] Selfie with the document; may be null. # @attr translation [Array] List of files containing a certified English translation of the # document. class IdentityDocument < Base attribute :number, TD::Types::String - attribute :expiry_date, TD::Types::Date.optional.default(nil) + attribute :expiration_date, TD::Types::Date.optional.default(nil) attribute :front_side, TD::Types::DatedFile - attribute :reverse_side, TD::Types::DatedFile + attribute :reverse_side, TD::Types::DatedFile.optional.default(nil) attribute :selfie, TD::Types::DatedFile.optional.default(nil) attribute :translation, TD::Types::Array.of(TD::Types::DatedFile) end diff --git a/lib/tdlib/types/imported_contacts.rb b/lib/tdlib/types/imported_contacts.rb index ab4f3535..38fff745 100644 --- a/lib/tdlib/types/imported_contacts.rb +++ b/lib/tdlib/types/imported_contacts.rb @@ -1,5 +1,5 @@ module TD::Types - # Represents the result of an ImportContacts request. + # Represents the result of an importContacts request. # # @attr user_ids [Array] User identifiers of the imported contacts in the same order as they were specified # in the request; 0 if the contact is not yet a registered user. diff --git a/lib/tdlib/types/inline_keyboard_button_type.rb b/lib/tdlib/types/inline_keyboard_button_type.rb index ac35ac91..4f2ea15e 100644 --- a/lib/tdlib/types/inline_keyboard_button_type.rb +++ b/lib/tdlib/types/inline_keyboard_button_type.rb @@ -1,14 +1,16 @@ module TD::Types - # Describes the type of an inline keyboard button. + # Describes the type of inline keyboard button. class InlineKeyboardButtonType < Base %w[ url login_url + web_app callback callback_with_password callback_game switch_inline buy + user ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/inline_keyboard_button_type/#{type}" end diff --git a/lib/tdlib/types/inline_keyboard_button_type/callback_with_password.rb b/lib/tdlib/types/inline_keyboard_button_type/callback_with_password.rb index 31c87c3f..75ff4f15 100644 --- a/lib/tdlib/types/inline_keyboard_button_type/callback_with_password.rb +++ b/lib/tdlib/types/inline_keyboard_button_type/callback_with_password.rb @@ -1,5 +1,6 @@ module TD::Types - # A button that asks for password of the current user and then sends a callback query to a bot. + # A button that asks for the 2-step verification password of the current user and then sends a callback query to a + # bot. # # @attr data [String] Data to be sent to the bot via a callback query. class InlineKeyboardButtonType::CallbackWithPassword < InlineKeyboardButtonType diff --git a/lib/tdlib/types/inline_keyboard_button_type/login_url.rb b/lib/tdlib/types/inline_keyboard_button_type/login_url.rb index 48299a91..7c631e1f 100644 --- a/lib/tdlib/types/inline_keyboard_button_type/login_url.rb +++ b/lib/tdlib/types/inline_keyboard_button_type/login_url.rb @@ -1,7 +1,7 @@ module TD::Types - # A button that opens a specified URL and automatically authorize the current user if allowed to do so. + # A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo. # - # @attr url [TD::Types::String] An HTTP URL to open. + # @attr url [TD::Types::String] An HTTP URL to pass to getLoginUrlInfo. # @attr id [Integer] Unique button identifier. # @attr forward_text [TD::Types::String] If non-empty, new text of the button in forwarded messages. class InlineKeyboardButtonType::LoginUrl < InlineKeyboardButtonType diff --git a/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb b/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb index 8c9889c6..6a66cf12 100644 --- a/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb +++ b/lib/tdlib/types/inline_keyboard_button_type/switch_inline.rb @@ -2,9 +2,9 @@ module TD::Types # A button that forces an inline query to the bot to be inserted in the input field. # # @attr query [TD::Types::String] Inline query to be sent to the bot. - # @attr in_current_chat [Boolean] True, if the inline query should be sent from the current chat. + # @attr target_chat [TD::Types::TargetChat] Target chat from which to send the inline query. class InlineKeyboardButtonType::SwitchInline < InlineKeyboardButtonType attribute :query, TD::Types::String - attribute :in_current_chat, TD::Types::Bool + attribute :target_chat, TD::Types::TargetChat end end diff --git a/lib/tdlib/types/inline_keyboard_button_type/url.rb b/lib/tdlib/types/inline_keyboard_button_type/url.rb index 5e11d321..00adbbb7 100644 --- a/lib/tdlib/types/inline_keyboard_button_type/url.rb +++ b/lib/tdlib/types/inline_keyboard_button_type/url.rb @@ -2,6 +2,7 @@ module TD::Types # A button that opens a specified URL. # # @attr url [TD::Types::String] HTTP or tg:// URL to open. + # If the link is of the type internalLinkTypeWebApp, then the button must be marked as a Web App button. class InlineKeyboardButtonType::Url < InlineKeyboardButtonType attribute :url, TD::Types::String end diff --git a/lib/tdlib/types/inline_keyboard_button_type/user.rb b/lib/tdlib/types/inline_keyboard_button_type/user.rb new file mode 100644 index 00000000..ad74af8c --- /dev/null +++ b/lib/tdlib/types/inline_keyboard_button_type/user.rb @@ -0,0 +1,8 @@ +module TD::Types + # A button with a user reference to be handled in the same way as textEntityTypeMentionName entities. + # + # @attr user_id [Integer] User identifier. + class InlineKeyboardButtonType::User < InlineKeyboardButtonType + attribute :user_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/inline_keyboard_button_type/web_app.rb b/lib/tdlib/types/inline_keyboard_button_type/web_app.rb new file mode 100644 index 00000000..6a209332 --- /dev/null +++ b/lib/tdlib/types/inline_keyboard_button_type/web_app.rb @@ -0,0 +1,8 @@ +module TD::Types + # A button that opens a Web App by calling openWebApp. + # + # @attr url [TD::Types::String] An HTTP URL to pass to openWebApp. + class InlineKeyboardButtonType::WebApp < InlineKeyboardButtonType + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/inline_query_results.rb b/lib/tdlib/types/inline_query_results.rb index bf268e65..09c56a47 100644 --- a/lib/tdlib/types/inline_query_results.rb +++ b/lib/tdlib/types/inline_query_results.rb @@ -3,17 +3,14 @@ module TD::Types # Use sendInlineQueryResultMessage to send the result of the query. # # @attr inline_query_id [Integer] Unique identifier of the inline query. - # @attr next_offset [TD::Types::String] The offset for the next request. - # If empty, there are no more results. + # @attr button [TD::Types::InlineQueryResultsButton, nil] Button to be shown above inline query results; may be null. # @attr results [Array] Results of the query. - # @attr switch_pm_text [TD::Types::String] If non-empty, this text should be shown on the button, which opens a - # private chat with the bot and sends the bot a start message with the switch_pm_parameter. - # @attr switch_pm_parameter [TD::Types::String] Parameter for the bot start message. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. class InlineQueryResults < Base attribute :inline_query_id, TD::Types::Coercible::Integer - attribute :next_offset, TD::Types::String + attribute :button, TD::Types::InlineQueryResultsButton.optional.default(nil) attribute :results, TD::Types::Array.of(TD::Types::InlineQueryResult) - attribute :switch_pm_text, TD::Types::String - attribute :switch_pm_parameter, TD::Types::String + attribute :next_offset, TD::Types::String end end diff --git a/lib/tdlib/types/inline_query_results_button.rb b/lib/tdlib/types/inline_query_results_button.rb new file mode 100644 index 00000000..2959958f --- /dev/null +++ b/lib/tdlib/types/inline_query_results_button.rb @@ -0,0 +1,10 @@ +module TD::Types + # Represents a button to be shown above inline query results. + # + # @attr text [TD::Types::String] The text of the button. + # @attr type [TD::Types::InlineQueryResultsButtonType] Type of the button. + class InlineQueryResultsButton < Base + attribute :text, TD::Types::String + attribute :type, TD::Types::InlineQueryResultsButtonType + end +end diff --git a/lib/tdlib/types/inline_query_results_button_type.rb b/lib/tdlib/types/inline_query_results_button_type.rb new file mode 100644 index 00000000..7eb79711 --- /dev/null +++ b/lib/tdlib/types/inline_query_results_button_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Represents type of button in results of inline query. + class InlineQueryResultsButtonType < Base + %w[ + start_bot + web_app + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/inline_query_results_button_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/inline_query_results_button_type/start_bot.rb b/lib/tdlib/types/inline_query_results_button_type/start_bot.rb new file mode 100644 index 00000000..6c89d48d --- /dev/null +++ b/lib/tdlib/types/inline_query_results_button_type/start_bot.rb @@ -0,0 +1,9 @@ +module TD::Types + # Describes the button that opens a private chat with the bot and sends a start message to the bot with the given + # parameter. + # + # @attr parameter [TD::Types::String] The parameter for the bot start message. + class InlineQueryResultsButtonType::StartBot < InlineQueryResultsButtonType + attribute :parameter, TD::Types::String + end +end diff --git a/lib/tdlib/types/inline_query_results_button_type/web_app.rb b/lib/tdlib/types/inline_query_results_button_type/web_app.rb new file mode 100644 index 00000000..31f9c147 --- /dev/null +++ b/lib/tdlib/types/inline_query_results_button_type/web_app.rb @@ -0,0 +1,8 @@ +module TD::Types + # Describes the button that opens a Web App by calling getWebAppUrl. + # + # @attr url [TD::Types::String] An HTTP URL to pass to getWebAppUrl. + class InlineQueryResultsButtonType::WebApp < InlineQueryResultsButtonType + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/input_background.rb b/lib/tdlib/types/input_background.rb index 958ba6b1..9a8f742f 100644 --- a/lib/tdlib/types/input_background.rb +++ b/lib/tdlib/types/input_background.rb @@ -4,6 +4,7 @@ class InputBackground < Base %w[ local remote + previous ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/input_background/#{type}" end diff --git a/lib/tdlib/types/input_background/previous.rb b/lib/tdlib/types/input_background/previous.rb new file mode 100644 index 00000000..1b52d540 --- /dev/null +++ b/lib/tdlib/types/input_background/previous.rb @@ -0,0 +1,8 @@ +module TD::Types + # A background previously set in the chat; for chat backgrounds only. + # + # @attr message_id [Integer] Identifier of the message with the background. + class InputBackground::Previous < InputBackground + attribute :message_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/input_business_chat_link.rb b/lib/tdlib/types/input_business_chat_link.rb new file mode 100644 index 00000000..fe73ad17 --- /dev/null +++ b/lib/tdlib/types/input_business_chat_link.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a business chat link to create or edit. + # + # @attr text [TD::Types::FormattedText] Message draft text that will be added to the input field. + # @attr title [TD::Types::String] Link title. + class InputBusinessChatLink < Base + attribute :text, TD::Types::FormattedText + attribute :title, TD::Types::String + end +end diff --git a/lib/tdlib/types/input_business_start_page.rb b/lib/tdlib/types/input_business_start_page.rb new file mode 100644 index 00000000..f4878fa9 --- /dev/null +++ b/lib/tdlib/types/input_business_start_page.rb @@ -0,0 +1,15 @@ +module TD::Types + # Describes settings for a business account start page to set. + # + # @attr title [TD::Types::String] Title text of the start page; 0-getOption("business_start_page_title_length_max") + # characters. + # @attr message [TD::Types::String] Message text of the start page; + # 0-getOption("business_start_page_message_length_max") characters. + # @attr sticker [TD::Types::InputFile] Greeting sticker of the start page; pass null if none. + # The sticker must belong to a sticker set and must not be a custom emoji. + class InputBusinessStartPage < Base + attribute :title, TD::Types::String + attribute :message, TD::Types::String + attribute :sticker, TD::Types::InputFile + end +end diff --git a/lib/tdlib/types/input_chat_photo.rb b/lib/tdlib/types/input_chat_photo.rb index 85300aa3..ea9fb8d4 100644 --- a/lib/tdlib/types/input_chat_photo.rb +++ b/lib/tdlib/types/input_chat_photo.rb @@ -5,6 +5,7 @@ class InputChatPhoto < Base previous static animation + sticker ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/input_chat_photo/#{type}" end diff --git a/lib/tdlib/types/input_chat_photo/animation.rb b/lib/tdlib/types/input_chat_photo/animation.rb index 53d5e680..f407fb1f 100644 --- a/lib/tdlib/types/input_chat_photo/animation.rb +++ b/lib/tdlib/types/input_chat_photo/animation.rb @@ -1,5 +1,5 @@ module TD::Types - # An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 800 and be at + # An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at # most 2MB in size. # # @attr animation [TD::Types::InputFile] Animation to be set as profile photo. diff --git a/lib/tdlib/types/input_chat_photo/sticker.rb b/lib/tdlib/types/input_chat_photo/sticker.rb new file mode 100644 index 00000000..4c248224 --- /dev/null +++ b/lib/tdlib/types/input_chat_photo/sticker.rb @@ -0,0 +1,8 @@ +module TD::Types + # A sticker on a custom background. + # + # @attr sticker [TD::Types::ChatPhotoSticker] Information about the sticker. + class InputChatPhoto::Sticker < InputChatPhoto + attribute :sticker, TD::Types::ChatPhotoSticker + end +end diff --git a/lib/tdlib/types/input_credentials/new.rb b/lib/tdlib/types/input_credentials/new.rb index cc94fda7..dd32ba9d 100644 --- a/lib/tdlib/types/input_credentials/new.rb +++ b/lib/tdlib/types/input_credentials/new.rb @@ -1,7 +1,7 @@ module TD::Types # Applies if a user enters new credentials on a payment provider website. # - # @attr data [TD::Types::String] Contains JSON-encoded data with a credential identifier from the payment provider. + # @attr data [TD::Types::String] JSON-encoded data with the credential identifier from the payment provider. # @attr allow_save [Boolean] True, if the credential identifier can be saved on the server side. class InputCredentials::New < InputCredentials attribute :data, TD::Types::String diff --git a/lib/tdlib/types/input_file/generated.rb b/lib/tdlib/types/input_file/generated.rb index 73b28e53..0f22aba8 100644 --- a/lib/tdlib/types/input_file/generated.rb +++ b/lib/tdlib/types/input_file/generated.rb @@ -3,10 +3,10 @@ module TD::Types # # @attr original_path [TD::Types::String, nil] Local path to a file from which the file is generated; may be empty if # there is no such file. - # @attr conversion [TD::Types::String] String specifying the conversion applied to the original file; should be + # @attr conversion [TD::Types::String] String specifying the conversion applied to the original file; must be # persistent across application restarts. # Conversions beginning with '#' are reserved for internal TDLib usage. - # @attr expected_size [Integer] Expected size of the generated file; 0 if unknown. + # @attr expected_size [Integer] Expected size of the generated file, in bytes; 0 if unknown. class InputFile::Generated < InputFile attribute :original_path, TD::Types::String.optional.default(nil) attribute :conversion, TD::Types::String diff --git a/lib/tdlib/types/input_file/id.rb b/lib/tdlib/types/input_file/id.rb index 34ca9bba..e1d7bbf0 100644 --- a/lib/tdlib/types/input_file/id.rb +++ b/lib/tdlib/types/input_file/id.rb @@ -1,5 +1,5 @@ module TD::Types - # A file defined by its unique ID. + # A file defined by its unique identifier. # # @attr id [Integer] Unique file identifier. class InputFile::Id < InputFile diff --git a/lib/tdlib/types/input_file/remote.rb b/lib/tdlib/types/input_file/remote.rb index 4535f9eb..fbbc6767 100644 --- a/lib/tdlib/types/input_file/remote.rb +++ b/lib/tdlib/types/input_file/remote.rb @@ -1,7 +1,7 @@ module TD::Types - # A file defined by its remote ID. - # The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known - # to TDLib. + # A file defined by its remote identifier. + # The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and + # known to TDLib. # For example, if the file is from a message, then the message must be not deleted and accessible to the user. # If the file database is disabled, then the corresponding object with the file must be preloaded by the application. # diff --git a/lib/tdlib/types/input_identity_document.rb b/lib/tdlib/types/input_identity_document.rb index 63726bea..9750d40a 100644 --- a/lib/tdlib/types/input_identity_document.rb +++ b/lib/tdlib/types/input_identity_document.rb @@ -2,18 +2,19 @@ module TD::Types # An identity document to be saved to Telegram Passport. # # @attr number [TD::Types::String] Document number; 1-24 characters. - # @attr expiry_date [TD::Types::Date, nil] Document expiry date, if available. + # @attr expiration_date [TD::Types::Date] Document expiration date; pass null if not applicable. # @attr front_side [TD::Types::InputFile] Front side of the document. - # @attr reverse_side [TD::Types::InputFile] Reverse side of the document; only for driver license and identity card. - # @attr selfie [TD::Types::InputFile, nil] Selfie with the document, if available. + # @attr reverse_side [TD::Types::InputFile] Reverse side of the document; only for driver license and identity card; + # pass null otherwise. + # @attr selfie [TD::Types::InputFile] Selfie with the document; pass null if unavailable. # @attr translation [Array] List of files containing a certified English translation of the # document. class InputIdentityDocument < Base attribute :number, TD::Types::String - attribute :expiry_date, TD::Types::Date.optional.default(nil) + attribute :expiration_date, TD::Types::Date attribute :front_side, TD::Types::InputFile attribute :reverse_side, TD::Types::InputFile - attribute :selfie, TD::Types::InputFile.optional.default(nil) + attribute :selfie, TD::Types::InputFile attribute :translation, TD::Types::Array.of(TD::Types::InputFile) end end diff --git a/lib/tdlib/types/input_inline_query_result/animation.rb b/lib/tdlib/types/input_inline_query_result/animation.rb index 7642218f..d673089a 100644 --- a/lib/tdlib/types/input_inline_query_result/animation.rb +++ b/lib/tdlib/types/input_inline_query_result/animation.rb @@ -1,6 +1,5 @@ module TD::Types - # Represents a link to an animated GIF or an animated (i.e. - # without sound) H.264/MPEG-4 AVC video. + # Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video. # # @attr id [TD::Types::String] Unique identifier of the query result. # @attr title [TD::Types::String] Title of the query result. @@ -13,7 +12,7 @@ module TD::Types # @attr video_duration [Integer] Duration of the video, in seconds. # @attr video_width [Integer] Width of the video. # @attr video_height [Integer] Height of the video. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/article.rb b/lib/tdlib/types/input_inline_query_result/article.rb index 655e4e32..41226310 100644 --- a/lib/tdlib/types/input_inline_query_result/article.rb +++ b/lib/tdlib/types/input_inline_query_result/article.rb @@ -9,7 +9,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] URL of the result thumbnail, if it exists. # @attr thumbnail_width [Integer] Thumbnail width, if known. # @attr thumbnail_height [Integer] Thumbnail height, if known. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, diff --git a/lib/tdlib/types/input_inline_query_result/audio.rb b/lib/tdlib/types/input_inline_query_result/audio.rb index 7b213f28..d18ad68e 100644 --- a/lib/tdlib/types/input_inline_query_result/audio.rb +++ b/lib/tdlib/types/input_inline_query_result/audio.rb @@ -6,7 +6,7 @@ module TD::Types # @attr performer [TD::Types::String] Performer of the audio file. # @attr audio_url [TD::Types::String] The URL of the audio file. # @attr audio_duration [Integer] Audio file duration, in seconds. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/contact.rb b/lib/tdlib/types/input_inline_query_result/contact.rb index 39243dfd..e58ac656 100644 --- a/lib/tdlib/types/input_inline_query_result/contact.rb +++ b/lib/tdlib/types/input_inline_query_result/contact.rb @@ -6,7 +6,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] URL of the result thumbnail, if it exists. # @attr thumbnail_width [Integer] Thumbnail width, if known. # @attr thumbnail_height [Integer] Thumbnail height, if known. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, diff --git a/lib/tdlib/types/input_inline_query_result/document.rb b/lib/tdlib/types/input_inline_query_result/document.rb index 4063ccde..dbec7193 100644 --- a/lib/tdlib/types/input_inline_query_result/document.rb +++ b/lib/tdlib/types/input_inline_query_result/document.rb @@ -10,7 +10,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] The URL of the file thumbnail, if it exists. # @attr thumbnail_width [Integer] Width of the thumbnail. # @attr thumbnail_height [Integer] Height of the thumbnail. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/game.rb b/lib/tdlib/types/input_inline_query_result/game.rb index 956cc609..6d9b4618 100644 --- a/lib/tdlib/types/input_inline_query_result/game.rb +++ b/lib/tdlib/types/input_inline_query_result/game.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr id [TD::Types::String] Unique identifier of the query result. # @attr game_short_name [TD::Types::String] Short name of the game. - # @attr reply_markup [TD::Types::ReplyMarkup] Message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. class InputInlineQueryResult::Game < InputInlineQueryResult attribute :id, TD::Types::String diff --git a/lib/tdlib/types/input_inline_query_result/location.rb b/lib/tdlib/types/input_inline_query_result/location.rb index e38197d7..3dc75fdc 100644 --- a/lib/tdlib/types/input_inline_query_result/location.rb +++ b/lib/tdlib/types/input_inline_query_result/location.rb @@ -9,7 +9,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] URL of the result thumbnail, if it exists. # @attr thumbnail_width [Integer] Thumbnail width, if known. # @attr thumbnail_height [Integer] Thumbnail height, if known. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, diff --git a/lib/tdlib/types/input_inline_query_result/photo.rb b/lib/tdlib/types/input_inline_query_result/photo.rb index 03d77bce..45f525aa 100644 --- a/lib/tdlib/types/input_inline_query_result/photo.rb +++ b/lib/tdlib/types/input_inline_query_result/photo.rb @@ -8,7 +8,7 @@ module TD::Types # @attr photo_url [TD::Types::String] The URL of the JPEG photo (photo size must not exceed 5MB). # @attr photo_width [Integer] Width of the photo. # @attr photo_height [Integer] Height of the photo. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/sticker.rb b/lib/tdlib/types/input_inline_query_result/sticker.rb index d9431f06..c919e103 100644 --- a/lib/tdlib/types/input_inline_query_result/sticker.rb +++ b/lib/tdlib/types/input_inline_query_result/sticker.rb @@ -1,12 +1,13 @@ module TD::Types - # Represents a link to a WEBP or TGS sticker. + # Represents a link to a WEBP, TGS, or WEBM sticker. # # @attr id [TD::Types::String] Unique identifier of the query result. # @attr thumbnail_url [TD::Types::String] URL of the sticker thumbnail, if it exists. - # @attr sticker_url [TD::Types::String] The URL of the WEBP or TGS sticker (sticker file size must not exceed 5MB). + # @attr sticker_url [TD::Types::String] The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed + # 5MB). # @attr sticker_width [Integer] Width of the sticker. # @attr sticker_height [Integer] Height of the sticker. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/venue.rb b/lib/tdlib/types/input_inline_query_result/venue.rb index 2c1291d3..b658b1b2 100644 --- a/lib/tdlib/types/input_inline_query_result/venue.rb +++ b/lib/tdlib/types/input_inline_query_result/venue.rb @@ -6,7 +6,7 @@ module TD::Types # @attr thumbnail_url [TD::Types::String] URL of the result thumbnail, if it exists. # @attr thumbnail_width [Integer] Thumbnail width, if known. # @attr thumbnail_height [Integer] Thumbnail height, if known. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, diff --git a/lib/tdlib/types/input_inline_query_result/video.rb b/lib/tdlib/types/input_inline_query_result/video.rb index b71e3a1b..54e307b3 100644 --- a/lib/tdlib/types/input_inline_query_result/video.rb +++ b/lib/tdlib/types/input_inline_query_result/video.rb @@ -11,7 +11,7 @@ module TD::Types # @attr video_width [Integer] Width of the video. # @attr video_height [Integer] Height of the video. # @attr video_duration [Integer] Video duration, in seconds. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, diff --git a/lib/tdlib/types/input_inline_query_result/voice_note.rb b/lib/tdlib/types/input_inline_query_result/voice_note.rb index 832b9cff..c4f1513d 100644 --- a/lib/tdlib/types/input_inline_query_result/voice_note.rb +++ b/lib/tdlib/types/input_inline_query_result/voice_note.rb @@ -5,7 +5,7 @@ module TD::Types # @attr title [TD::Types::String] Title of the voice note. # @attr voice_note_url [TD::Types::String] The URL of the voice note file. # @attr voice_note_duration [Integer] Duration of the voice note, in seconds. - # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup. + # @attr reply_markup [TD::Types::ReplyMarkup] The message reply markup; pass null if none. # Must be of type {TD::Types::ReplyMarkup::InlineKeyboard} or null. # @attr input_message_content [TD::Types::InputMessageContent] The content of the message to be sent. # Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, diff --git a/lib/tdlib/types/input_invoice.rb b/lib/tdlib/types/input_invoice.rb new file mode 100644 index 00000000..1a2212ec --- /dev/null +++ b/lib/tdlib/types/input_invoice.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes an invoice to process. + class InputInvoice < Base + %w[ + message + name + telegram + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/input_invoice/#{type}" + end + end +end diff --git a/lib/tdlib/types/input_invoice/message.rb b/lib/tdlib/types/input_invoice/message.rb new file mode 100644 index 00000000..11b84a76 --- /dev/null +++ b/lib/tdlib/types/input_invoice/message.rb @@ -0,0 +1,10 @@ +module TD::Types + # An invoice from a message of the type messageInvoice or paid media purchase from messagePaidMedia. + # + # @attr chat_id [Integer] Chat identifier of the message. + # @attr message_id [Integer] Message identifier. + class InputInvoice::Message < InputInvoice + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/input_invoice/name.rb b/lib/tdlib/types/input_invoice/name.rb new file mode 100644 index 00000000..1e40ae74 --- /dev/null +++ b/lib/tdlib/types/input_invoice/name.rb @@ -0,0 +1,8 @@ +module TD::Types + # An invoice from a link of the type internalLinkTypeInvoice. + # + # @attr name [TD::Types::String] Name of the invoice. + class InputInvoice::Name < InputInvoice + attribute :name, TD::Types::String + end +end diff --git a/lib/tdlib/types/input_invoice/telegram.rb b/lib/tdlib/types/input_invoice/telegram.rb new file mode 100644 index 00000000..d9a72ba5 --- /dev/null +++ b/lib/tdlib/types/input_invoice/telegram.rb @@ -0,0 +1,8 @@ +module TD::Types + # An invoice for a payment toward Telegram; must not be used in the in-store apps. + # + # @attr purpose [TD::Types::TelegramPaymentPurpose] Transaction purpose. + class InputInvoice::Telegram < InputInvoice + attribute :purpose, TD::Types::TelegramPaymentPurpose + end +end diff --git a/lib/tdlib/types/input_message_content.rb b/lib/tdlib/types/input_message_content.rb index ed882b98..29ac7121 100644 --- a/lib/tdlib/types/input_message_content.rb +++ b/lib/tdlib/types/input_message_content.rb @@ -6,6 +6,7 @@ class InputMessageContent < Base animation audio document + paid_media photo sticker video @@ -18,6 +19,7 @@ class InputMessageContent < Base game invoice poll + story forwarded ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/input_message_content/#{type}" diff --git a/lib/tdlib/types/input_message_content/animation.rb b/lib/tdlib/types/input_message_content/animation.rb index 7e87fab3..62da50e1 100644 --- a/lib/tdlib/types/input_message_content/animation.rb +++ b/lib/tdlib/types/input_message_content/animation.rb @@ -2,20 +2,27 @@ module TD::Types # An animation message (GIF-style).. # # @attr animation [TD::Types::InputFile] Animation file to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Animation thumbnail, if available. + # @attr thumbnail [TD::Types::InputThumbnail] Animation thumbnail; pass null to skip thumbnail uploading. # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the animation, if # applicable. # @attr duration [Integer] Duration of the animation, in seconds. # @attr width [Integer] Width of the animation; may be replaced by the server. # @attr height [Integer] Height of the animation; may be replaced by the server. - # @attr caption [TD::Types::FormattedText] Animation caption; 0-GetOption("message_caption_length_max") characters. + # @attr caption [TD::Types::FormattedText] Animation caption; pass null to use an empty caption; + # 0-getOption("message_caption_length_max") characters. + # @attr show_caption_above_media [Boolean] True, if the caption must be shown above the animation; otherwise, the + # caption must be shown below the animation; not supported in secret chats. + # @attr has_spoiler [Boolean] True, if the animation preview must be covered by a spoiler animation; not supported in + # secret chats. class InputMessageContent::Animation < InputMessageContent attribute :animation, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :added_sticker_file_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) attribute :duration, TD::Types::Coercible::Integer attribute :width, TD::Types::Coercible::Integer attribute :height, TD::Types::Coercible::Integer attribute :caption, TD::Types::FormattedText + attribute :show_caption_above_media, TD::Types::Bool + attribute :has_spoiler, TD::Types::Bool end end diff --git a/lib/tdlib/types/input_message_content/audio.rb b/lib/tdlib/types/input_message_content/audio.rb index 5cf443a9..93946dd4 100644 --- a/lib/tdlib/types/input_message_content/audio.rb +++ b/lib/tdlib/types/input_message_content/audio.rb @@ -2,14 +2,16 @@ module TD::Types # An audio message. # # @attr audio [TD::Types::InputFile] Audio file to be sent. - # @attr album_cover_thumbnail [TD::Types::InputThumbnail, nil] Thumbnail of the cover for the album, if available. + # @attr album_cover_thumbnail [TD::Types::InputThumbnail] Thumbnail of the cover for the album; pass null to skip + # thumbnail uploading. # @attr duration [Integer] Duration of the audio, in seconds; may be replaced by the server. # @attr title [TD::Types::String] Title of the audio; 0-64 characters; may be replaced by the server. # @attr performer [TD::Types::String] Performer of the audio; 0-64 characters, may be replaced by the server. - # @attr caption [TD::Types::FormattedText] Audio caption; 0-GetOption("message_caption_length_max") characters. + # @attr caption [TD::Types::FormattedText] Audio caption; pass null to use an empty caption; + # 0-getOption("message_caption_length_max") characters. class InputMessageContent::Audio < InputMessageContent attribute :audio, TD::Types::InputFile - attribute :album_cover_thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :album_cover_thumbnail, TD::Types::InputThumbnail attribute :duration, TD::Types::Coercible::Integer attribute :title, TD::Types::String attribute :performer, TD::Types::String diff --git a/lib/tdlib/types/input_message_content/dice.rb b/lib/tdlib/types/input_message_content/dice.rb index 32f3a81f..b2457171 100644 --- a/lib/tdlib/types/input_message_content/dice.rb +++ b/lib/tdlib/types/input_message_content/dice.rb @@ -2,7 +2,7 @@ module TD::Types # A dice message. # # @attr emoji [TD::Types::String] Emoji on which the dice throw animation is based. - # @attr clear_draft [Boolean] True, if a chat message draft should be deleted. + # @attr clear_draft [Boolean] True, if the chat message draft must be deleted. class InputMessageContent::Dice < InputMessageContent attribute :emoji, TD::Types::String attribute :clear_draft, TD::Types::Bool diff --git a/lib/tdlib/types/input_message_content/document.rb b/lib/tdlib/types/input_message_content/document.rb index 307a72ce..af3b48c1 100644 --- a/lib/tdlib/types/input_message_content/document.rb +++ b/lib/tdlib/types/input_message_content/document.rb @@ -2,14 +2,15 @@ module TD::Types # A document message (general file). # # @attr document [TD::Types::InputFile] Document to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Document thumbnail, if available. - # @attr disable_content_type_detection [Boolean] If true, automatic file type detection will be disabled and the - # document will be always sent as file. + # @attr thumbnail [TD::Types::InputThumbnail] Document thumbnail; pass null to skip thumbnail uploading. + # @attr disable_content_type_detection [Boolean] Pass true to disable automatic file type detection and send the + # document as a file. # Always true for files sent to secret chats. - # @attr caption [TD::Types::FormattedText] Document caption; 0-GetOption("message_caption_length_max") characters. + # @attr caption [TD::Types::FormattedText] Document caption; pass null to use an empty caption; + # 0-getOption("message_caption_length_max") characters. class InputMessageContent::Document < InputMessageContent attribute :document, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :disable_content_type_detection, TD::Types::Bool attribute :caption, TD::Types::FormattedText end diff --git a/lib/tdlib/types/input_message_content/forwarded.rb b/lib/tdlib/types/input_message_content/forwarded.rb index 516fbb74..6c814edd 100644 --- a/lib/tdlib/types/input_message_content/forwarded.rb +++ b/lib/tdlib/types/input_message_content/forwarded.rb @@ -3,10 +3,11 @@ module TD::Types # # @attr from_chat_id [Integer] Identifier for the chat this forwarded message came from. # @attr message_id [Integer] Identifier of the message to forward. - # @attr in_game_share [Boolean] True, if a game message should be shared within a launched game; applies only to game + # A message can be forwarded only if messageProperties.can_be_forwarded. + # @attr in_game_share [Boolean] True, if a game message is being shared from a launched game; applies only to game # messages. - # @attr copy_options [TD::Types::MessageCopyOptions] Options to be used to copy content of the message without a link - # to the original message. + # @attr copy_options [TD::Types::MessageCopyOptions] Options to be used to copy content of the message without + # reference to the original sender; pass null to forward the message as usual. class InputMessageContent::Forwarded < InputMessageContent attribute :from_chat_id, TD::Types::Coercible::Integer attribute :message_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/input_message_content/invoice.rb b/lib/tdlib/types/input_message_content/invoice.rb index f1e81c1c..a36138ef 100644 --- a/lib/tdlib/types/input_message_content/invoice.rb +++ b/lib/tdlib/types/input_message_content/invoice.rb @@ -9,12 +9,15 @@ module TD::Types # @attr photo_width [Integer] Product photo width. # @attr photo_height [Integer] Product photo height. # @attr payload [String] The invoice payload. - # @attr provider_token [TD::Types::String] Payment provider token. + # @attr provider_token [TD::Types::String, nil] Payment provider token; may be empty for payments in Telegram Stars. # @attr provider_data [TD::Types::String] JSON-encoded data about the invoice, which will be shared with the payment # provider. # @attr start_parameter [TD::Types::String] Unique invoice bot deep link parameter for the generation of this # invoice. # If empty, it would be possible to pay directly from forwards of the invoice message. + # @attr paid_media [TD::Types::InputPaidMedia] The content of paid media attached to the invoice; pass null if none. + # @attr paid_media_caption [TD::Types::FormattedText] Paid media caption; pass null to use an empty caption; + # 0-getOption("message_caption_length_max") characters. class InputMessageContent::Invoice < InputMessageContent attribute :invoice, TD::Types::Invoice attribute :title, TD::Types::String @@ -24,8 +27,10 @@ class InputMessageContent::Invoice < InputMessageContent attribute :photo_width, TD::Types::Coercible::Integer attribute :photo_height, TD::Types::Coercible::Integer attribute :payload, TD::Types::Coercible::String - attribute :provider_token, TD::Types::String + attribute :provider_token, TD::Types::String.optional.default(nil) attribute :provider_data, TD::Types::String attribute :start_parameter, TD::Types::String + attribute :paid_media, TD::Types::InputPaidMedia + attribute :paid_media_caption, TD::Types::FormattedText end end diff --git a/lib/tdlib/types/input_message_content/location.rb b/lib/tdlib/types/input_message_content/location.rb index cd204ed8..6113c92a 100644 --- a/lib/tdlib/types/input_message_content/location.rb +++ b/lib/tdlib/types/input_message_content/location.rb @@ -2,8 +2,8 @@ module TD::Types # A message with a location. # # @attr location [TD::Types::Location] Location to be sent. - # @attr live_period [Integer] Period for which the location can be updated, in seconds; should be between 60 and - # 86400 for a live location and 0 otherwise. + # @attr live_period [Integer] Period for which the location can be updated, in seconds; must be between 60 and 86400 + # for a temporary live location, 0x7FFFFFFF for permanent live location, and 0 otherwise. # @attr heading [Integer] For live locations, a direction in which the location moves, in degrees; 1-360. # Pass 0 if unknown. # @attr proximity_alert_radius [Integer] For live locations, a maximum distance to another chat member for proximity diff --git a/lib/tdlib/types/input_message_content/paid_media.rb b/lib/tdlib/types/input_message_content/paid_media.rb new file mode 100644 index 00000000..b1a6ca73 --- /dev/null +++ b/lib/tdlib/types/input_message_content/paid_media.rb @@ -0,0 +1,17 @@ +module TD::Types + # A message with paid media; can be used only in channel chats with supergroupFullInfo.has_paid_media_allowed. + # + # @attr star_count [Integer] The number of Telegram Stars that must be paid to see the media; + # 1-getOption("paid_media_message_star_count_max"). + # @attr paid_media [Array] The content of the paid media. + # @attr caption [TD::Types::FormattedText] Message caption; pass null to use an empty caption; + # 0-getOption("message_caption_length_max") characters. + # @attr show_caption_above_media [Boolean] True, if the caption must be shown above the video; otherwise, the caption + # must be shown below the video; not supported in secret chats. + class InputMessageContent::PaidMedia < InputMessageContent + attribute :star_count, TD::Types::Coercible::Integer + attribute :paid_media, TD::Types::Array.of(TD::Types::InputPaidMedia) + attribute :caption, TD::Types::FormattedText + attribute :show_caption_above_media, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/input_message_content/photo.rb b/lib/tdlib/types/input_message_content/photo.rb index 1b05c39f..8985b346 100644 --- a/lib/tdlib/types/input_message_content/photo.rb +++ b/lib/tdlib/types/input_message_content/photo.rb @@ -2,14 +2,22 @@ module TD::Types # A photo message. # # @attr photo [TD::Types::InputFile] Photo to send. - # @attr thumbnail [TD::Types::InputThumbnail] Photo thumbnail to be sent, this is sent to the other party in secret - # chats only. + # The photo must be at most 10 MB in size. + # The photo's width and height must not exceed 10000 in total. + # Width and height ratio must be at most 20. + # @attr thumbnail [TD::Types::InputThumbnail] Photo thumbnail to be sent; pass null to skip thumbnail uploading. + # The thumbnail is sent to the other party only in secret chats. # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the photo, if applicable. # @attr width [Integer] Photo width. # @attr height [Integer] Photo height. - # @attr caption [TD::Types::FormattedText] Photo caption; 0-GetOption("message_caption_length_max") characters. - # @attr ttl [Integer] Photo TTL (Time To Live), in seconds (0-60). - # A non-zero TTL can be specified only in private chats. + # @attr caption [TD::Types::FormattedText] Photo caption; pass null to use an empty caption; + # 0-getOption("message_caption_length_max") characters. + # @attr show_caption_above_media [Boolean] True, if the caption must be shown above the photo; otherwise, the caption + # must be shown below the photo; not supported in secret chats. + # @attr self_destruct_type [TD::Types::MessageSelfDestructType] Photo self-destruct type; pass null if none; private + # chats only. + # @attr has_spoiler [Boolean] True, if the photo preview must be covered by a spoiler animation; not supported in + # secret chats. class InputMessageContent::Photo < InputMessageContent attribute :photo, TD::Types::InputFile attribute :thumbnail, TD::Types::InputThumbnail @@ -17,6 +25,8 @@ class InputMessageContent::Photo < InputMessageContent attribute :width, TD::Types::Coercible::Integer attribute :height, TD::Types::Coercible::Integer attribute :caption, TD::Types::FormattedText - attribute :ttl, TD::Types::Coercible::Integer + attribute :show_caption_above_media, TD::Types::Bool + attribute :self_destruct_type, TD::Types::MessageSelfDestructType + attribute :has_spoiler, TD::Types::Bool end end diff --git a/lib/tdlib/types/input_message_content/poll.rb b/lib/tdlib/types/input_message_content/poll.rb index db8944b2..cfd45b32 100644 --- a/lib/tdlib/types/input_message_content/poll.rb +++ b/lib/tdlib/types/input_message_content/poll.rb @@ -3,18 +3,20 @@ module TD::Types # Polls can't be sent to secret chats. # Polls can be sent only to a private chat with a bot. # - # @attr question [TD::Types::String] Poll question; 1-255 characters (up to 300 characters for bots). - # @attr options [Array] List of poll answer options, 2-10 strings 1-100 characters each. + # @attr question [TD::Types::FormattedText] Poll question; 1-255 characters (up to 300 characters for bots). + # Only custom emoji entities are allowed to be added and only by Premium users. + # @attr options [Array] List of poll answer options, 2-10 strings 1-100 characters each. + # Only custom emoji entities are allowed to be added and only by Premium users. # @attr is_anonymous [Boolean] True, if the poll voters are anonymous. # Non-anonymous polls can't be sent or forwarded to channels. # @attr type [TD::Types::PollType] Type of the poll. # @attr open_period [Integer] Amount of time the poll will be active after creation, in seconds; for bots only. - # @attr close_date [Integer] Point in time (Unix timestamp) when the poll will be automatically closed; for bots + # @attr close_date [Integer] Point in time (Unix timestamp) when the poll will automatically be closed; for bots # only. # @attr is_closed [Boolean] True, if the poll needs to be sent already closed; for bots only. class InputMessageContent::Poll < InputMessageContent - attribute :question, TD::Types::String - attribute :options, TD::Types::Array.of(TD::Types::String) + attribute :question, TD::Types::FormattedText + attribute :options, TD::Types::Array.of(TD::Types::FormattedText) attribute :is_anonymous, TD::Types::Bool attribute :type, TD::Types::PollType attribute :open_period, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/input_message_content/sticker.rb b/lib/tdlib/types/input_message_content/sticker.rb index cd03881b..810a6968 100644 --- a/lib/tdlib/types/input_message_content/sticker.rb +++ b/lib/tdlib/types/input_message_content/sticker.rb @@ -2,13 +2,13 @@ module TD::Types # A sticker message. # # @attr sticker [TD::Types::InputFile] Sticker to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Sticker thumbnail, if available. + # @attr thumbnail [TD::Types::InputThumbnail] Sticker thumbnail; pass null to skip thumbnail uploading. # @attr width [Integer] Sticker width. # @attr height [Integer] Sticker height. # @attr emoji [TD::Types::String] Emoji used to choose the sticker. class InputMessageContent::Sticker < InputMessageContent attribute :sticker, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :width, TD::Types::Coercible::Integer attribute :height, TD::Types::Coercible::Integer attribute :emoji, TD::Types::String diff --git a/lib/tdlib/types/input_message_content/story.rb b/lib/tdlib/types/input_message_content/story.rb new file mode 100644 index 00000000..fedfa92c --- /dev/null +++ b/lib/tdlib/types/input_message_content/story.rb @@ -0,0 +1,12 @@ +module TD::Types + # A message with a forwarded story. + # Stories can't be sent to secret chats. + # A story can be forwarded only if story.can_be_forwarded. + # + # @attr story_sender_chat_id [Integer] Identifier of the chat that posted the story. + # @attr story_id [Integer] Story identifier. + class InputMessageContent::Story < InputMessageContent + attribute :story_sender_chat_id, TD::Types::Coercible::Integer + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/input_message_content/text.rb b/lib/tdlib/types/input_message_content/text.rb index 6fb1529a..c5d6773f 100644 --- a/lib/tdlib/types/input_message_content/text.rb +++ b/lib/tdlib/types/input_message_content/text.rb @@ -1,15 +1,15 @@ module TD::Types # A text message. # - # @attr text [TD::Types::FormattedText] Formatted text to be sent; 1-GetOption("message_text_length_max") characters. - # Only Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to - # be specified manually. - # @attr disable_web_page_preview [Boolean] True, if rich web page previews for URLs in the message text should be - # disabled. - # @attr clear_draft [Boolean] True, if a chat message draft should be deleted. + # @attr text [TD::Types::FormattedText] Formatted text to be sent; 0-getOption("message_text_length_max") characters. + # Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, + # PreCode, TextUrl and MentionName entities are allowed to be specified manually. + # @attr link_preview_options [TD::Types::LinkPreviewOptions, nil] Options to be used for generation of a link + # preview; may be null if none; pass null to use default link preview options. + # @attr clear_draft [Boolean] True, if a chat message draft must be deleted. class InputMessageContent::Text < InputMessageContent attribute :text, TD::Types::FormattedText - attribute :disable_web_page_preview, TD::Types::Bool + attribute :link_preview_options, TD::Types::LinkPreviewOptions.optional.default(nil) attribute :clear_draft, TD::Types::Bool end end diff --git a/lib/tdlib/types/input_message_content/video.rb b/lib/tdlib/types/input_message_content/video.rb index d6fb847a..68cef4ff 100644 --- a/lib/tdlib/types/input_message_content/video.rb +++ b/lib/tdlib/types/input_message_content/video.rb @@ -2,24 +2,31 @@ module TD::Types # A video message. # # @attr video [TD::Types::InputFile] Video to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Video thumbnail, if available. + # @attr thumbnail [TD::Types::InputThumbnail] Video thumbnail; pass null to skip thumbnail uploading. # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the video, if applicable. # @attr duration [Integer] Duration of the video, in seconds. # @attr width [Integer] Video width. # @attr height [Integer] Video height. - # @attr supports_streaming [Boolean] True, if the video should be tried to be streamed. - # @attr caption [TD::Types::FormattedText] Video caption; 0-GetOption("message_caption_length_max") characters. - # @attr ttl [Integer] Video TTL (Time To Live), in seconds (0-60). - # A non-zero TTL can be specified only in private chats. + # @attr supports_streaming [Boolean] True, if the video is supposed to be streamed. + # @attr caption [TD::Types::FormattedText] Video caption; pass null to use an empty caption; + # 0-getOption("message_caption_length_max") characters. + # @attr show_caption_above_media [Boolean] True, if the caption must be shown above the video; otherwise, the caption + # must be shown below the video; not supported in secret chats. + # @attr self_destruct_type [TD::Types::MessageSelfDestructType] Video self-destruct type; pass null if none; private + # chats only. + # @attr has_spoiler [Boolean] True, if the video preview must be covered by a spoiler animation; not supported in + # secret chats. class InputMessageContent::Video < InputMessageContent attribute :video, TD::Types::InputFile - attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::InputThumbnail attribute :added_sticker_file_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) attribute :duration, TD::Types::Coercible::Integer attribute :width, TD::Types::Coercible::Integer attribute :height, TD::Types::Coercible::Integer attribute :supports_streaming, TD::Types::Bool attribute :caption, TD::Types::FormattedText - attribute :ttl, TD::Types::Coercible::Integer + attribute :show_caption_above_media, TD::Types::Bool + attribute :self_destruct_type, TD::Types::MessageSelfDestructType + attribute :has_spoiler, TD::Types::Bool end end diff --git a/lib/tdlib/types/input_message_content/video_note.rb b/lib/tdlib/types/input_message_content/video_note.rb index 95781277..fd843619 100644 --- a/lib/tdlib/types/input_message_content/video_note.rb +++ b/lib/tdlib/types/input_message_content/video_note.rb @@ -2,13 +2,17 @@ module TD::Types # A video note message. # # @attr video_note [TD::Types::InputFile] Video note to be sent. - # @attr thumbnail [TD::Types::InputThumbnail, nil] Video thumbnail, if available. - # @attr duration [Integer] Duration of the video, in seconds. + # @attr thumbnail [TD::Types::InputThumbnail, nil] Video thumbnail; may be null if empty; pass null to skip thumbnail + # uploading. + # @attr duration [Integer] Duration of the video, in seconds; 0-60. # @attr length [Integer] Video width and height; must be positive and not greater than 640. + # @attr self_destruct_type [TD::Types::MessageSelfDestructType, nil] Video note self-destruct type; may be null if + # none; pass null if none; private chats only. class InputMessageContent::VideoNote < InputMessageContent attribute :video_note, TD::Types::InputFile attribute :thumbnail, TD::Types::InputThumbnail.optional.default(nil) attribute :duration, TD::Types::Coercible::Integer attribute :length, TD::Types::Coercible::Integer + attribute :self_destruct_type, TD::Types::MessageSelfDestructType.optional.default(nil) end end diff --git a/lib/tdlib/types/input_message_content/voice_note.rb b/lib/tdlib/types/input_message_content/voice_note.rb index 0e2e0718..472104a1 100644 --- a/lib/tdlib/types/input_message_content/voice_note.rb +++ b/lib/tdlib/types/input_message_content/voice_note.rb @@ -2,13 +2,19 @@ module TD::Types # A voice note message. # # @attr voice_note [TD::Types::InputFile] Voice note to be sent. + # The voice note must be encoded with the Opus codec and stored inside an OGG container with a single audio + # channel, or be in MP3 or M4A format as regular audio. # @attr duration [Integer] Duration of the voice note, in seconds. - # @attr waveform [String] Waveform representation of the voice note, in 5-bit format. - # @attr caption [TD::Types::FormattedText] Voice note caption; 0-GetOption("message_caption_length_max") characters. + # @attr waveform [String] Waveform representation of the voice note in 5-bit format. + # @attr caption [TD::Types::FormattedText, nil] Voice note caption; may be null if empty; pass null to use an empty + # caption; 0-getOption("message_caption_length_max") characters. + # @attr self_destruct_type [TD::Types::MessageSelfDestructType, nil] Voice note self-destruct type; may be null if + # none; pass null if none; private chats only. class InputMessageContent::VoiceNote < InputMessageContent attribute :voice_note, TD::Types::InputFile attribute :duration, TD::Types::Coercible::Integer attribute :waveform, TD::Types::Coercible::String - attribute :caption, TD::Types::FormattedText + attribute :caption, TD::Types::FormattedText.optional.default(nil) + attribute :self_destruct_type, TD::Types::MessageSelfDestructType.optional.default(nil) end end diff --git a/lib/tdlib/types/input_message_reply_to.rb b/lib/tdlib/types/input_message_reply_to.rb new file mode 100644 index 00000000..ca006192 --- /dev/null +++ b/lib/tdlib/types/input_message_reply_to.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains information about the message or the story to be replied. + class InputMessageReplyTo < Base + %w[ + message + external_message + story + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/input_message_reply_to/#{type}" + end + end +end diff --git a/lib/tdlib/types/input_message_reply_to/external_message.rb b/lib/tdlib/types/input_message_reply_to/external_message.rb new file mode 100644 index 00000000..062689fc --- /dev/null +++ b/lib/tdlib/types/input_message_reply_to/external_message.rb @@ -0,0 +1,13 @@ +module TD::Types + # Describes a message to be replied that is from a different chat or a forum topic; not supported in secret chats. + # + # @attr chat_id [Integer] The identifier of the chat to which the message to be replied belongs. + # @attr message_id [Integer] The identifier of the message to be replied in the specified chat. + # A message can be replied in another chat or forum topic only if messageProperties.can_be_replied_in_another_chat. + # @attr quote [TD::Types::InputTextQuote] Quote from the message to be replied; pass null if none. + class InputMessageReplyTo::ExternalMessage < InputMessageReplyTo + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :quote, TD::Types::InputTextQuote + end +end diff --git a/lib/tdlib/types/input_message_reply_to/message.rb b/lib/tdlib/types/input_message_reply_to/message.rb new file mode 100644 index 00000000..9d89fdb3 --- /dev/null +++ b/lib/tdlib/types/input_message_reply_to/message.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes a message to be replied in the same chat and forum topic. + # + # @attr message_id [Integer] The identifier of the message to be replied in the same chat and forum topic. + # A message can be replied in the same chat and forum topic only if messageProperties.can_be_replied. + # @attr quote [TD::Types::InputTextQuote] Quote from the message to be replied; pass null if none. + # Must always be null for replies in secret chats. + class InputMessageReplyTo::Message < InputMessageReplyTo + attribute :message_id, TD::Types::Coercible::Integer + attribute :quote, TD::Types::InputTextQuote + end +end diff --git a/lib/tdlib/types/input_message_reply_to/story.rb b/lib/tdlib/types/input_message_reply_to/story.rb new file mode 100644 index 00000000..be683a46 --- /dev/null +++ b/lib/tdlib/types/input_message_reply_to/story.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes a story to be replied. + # + # @attr story_sender_chat_id [Integer] The identifier of the sender of the story. + # Currently, stories can be replied only in the sender's chat and channel stories can't be replied. + # @attr story_id [Integer] The identifier of the story. + class InputMessageReplyTo::Story < InputMessageReplyTo + attribute :story_sender_chat_id, TD::Types::Coercible::Integer + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/input_paid_media.rb b/lib/tdlib/types/input_paid_media.rb new file mode 100644 index 00000000..9f67210b --- /dev/null +++ b/lib/tdlib/types/input_paid_media.rb @@ -0,0 +1,18 @@ +module TD::Types + # Describes a paid media to be sent. + # + # @attr type [TD::Types::InputPaidMediaType] Type of the media. + # @attr media [TD::Types::InputFile] Photo or video to be sent. + # @attr thumbnail [TD::Types::InputThumbnail] Media thumbnail; pass null to skip thumbnail uploading. + # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the media, if applicable. + # @attr width [Integer] Media width. + # @attr height [Integer] Media height. + class InputPaidMedia < Base + attribute :type, TD::Types::InputPaidMediaType + attribute :media, TD::Types::InputFile + attribute :thumbnail, TD::Types::InputThumbnail + attribute :added_sticker_file_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :width, TD::Types::Coercible::Integer + attribute :height, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/input_paid_media_type.rb b/lib/tdlib/types/input_paid_media_type.rb new file mode 100644 index 00000000..67cfac0e --- /dev/null +++ b/lib/tdlib/types/input_paid_media_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes type of paid media to sent. + class InputPaidMediaType < Base + %w[ + photo + video + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/input_paid_media_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/input_paid_media_type/photo.rb b/lib/tdlib/types/input_paid_media_type/photo.rb new file mode 100644 index 00000000..cf2f314b --- /dev/null +++ b/lib/tdlib/types/input_paid_media_type/photo.rb @@ -0,0 +1,8 @@ +module TD::Types + # The media is a photo. + # The photo must be at most 10 MB in size. + # The photo's width and height must not exceed 10000 in total. + # Width and height ratio must be at most 20. + class InputPaidMediaType::Photo < InputPaidMediaType + end +end diff --git a/lib/tdlib/types/input_paid_media_type/video.rb b/lib/tdlib/types/input_paid_media_type/video.rb new file mode 100644 index 00000000..7c736b47 --- /dev/null +++ b/lib/tdlib/types/input_paid_media_type/video.rb @@ -0,0 +1,10 @@ +module TD::Types + # The media is a video. + # + # @attr duration [Integer] Duration of the video, in seconds. + # @attr supports_streaming [Boolean] True, if the video is supposed to be streamed. + class InputPaidMediaType::Video < InputPaidMediaType + attribute :duration, TD::Types::Coercible::Integer + attribute :supports_streaming, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/input_sticker.rb b/lib/tdlib/types/input_sticker.rb index 21ee45e9..0c451ef3 100644 --- a/lib/tdlib/types/input_sticker.rb +++ b/lib/tdlib/types/input_sticker.rb @@ -1,11 +1,19 @@ module TD::Types - # Describes a sticker that needs to be added to a sticker set. + # A sticker to be added to a sticker set. + # + # @attr sticker [TD::Types::InputFile] File with the sticker; must fit in a 512x512 square. + # For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. + # See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements. + # @attr format [TD::Types::StickerFormat] Format of the sticker. + # @attr emojis [TD::Types::String] String with 1-20 emoji corresponding to the sticker. + # @attr mask_position [TD::Types::MaskPosition] Position where the mask is placed; pass null if not specified. + # @attr keywords [Array] List of up to 20 keywords with total length up to 64 characters, which + # can be used to find the sticker. class InputSticker < Base - %w[ - static - animated - ].each do |type| - autoload TD::Types.camelize(type), "tdlib/types/input_sticker/#{type}" - end + attribute :sticker, TD::Types::InputFile + attribute :format, TD::Types::StickerFormat + attribute :emojis, TD::Types::String + attribute :mask_position, TD::Types::MaskPosition + attribute :keywords, TD::Types::Array.of(TD::Types::String) end end diff --git a/lib/tdlib/types/input_sticker/animated.rb b/lib/tdlib/types/input_sticker/animated.rb deleted file mode 100644 index da21e16f..00000000 --- a/lib/tdlib/types/input_sticker/animated.rb +++ /dev/null @@ -1,12 +0,0 @@ -module TD::Types - # An animated sticker in TGS format. - # - # @attr sticker [TD::Types::InputFile] File with the animated sticker. - # Only local or uploaded within a week files are supported. - # See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements. - # @attr emojis [TD::Types::String] Emojis corresponding to the sticker. - class InputSticker::Animated < InputSticker - attribute :sticker, TD::Types::InputFile - attribute :emojis, TD::Types::String - end -end diff --git a/lib/tdlib/types/input_sticker/static.rb b/lib/tdlib/types/input_sticker/static.rb deleted file mode 100644 index b5f52c13..00000000 --- a/lib/tdlib/types/input_sticker/static.rb +++ /dev/null @@ -1,14 +0,0 @@ -module TD::Types - # A static sticker in PNG format, which will be converted to WEBP server-side. - # - # @attr sticker [TD::Types::InputFile] PNG image with the sticker; must be up to 512 KB in size and fit in a 512x512 - # square. - # @attr emojis [TD::Types::String] Emojis corresponding to the sticker. - # @attr mask_position [TD::Types::MaskPosition, nil] For masks, position where the mask should be placed; may be - # null. - class InputSticker::Static < InputSticker - attribute :sticker, TD::Types::InputFile - attribute :emojis, TD::Types::String - attribute :mask_position, TD::Types::MaskPosition.optional.default(nil) - end -end diff --git a/lib/tdlib/types/input_story_area.rb b/lib/tdlib/types/input_story_area.rb new file mode 100644 index 00000000..54e884c7 --- /dev/null +++ b/lib/tdlib/types/input_story_area.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a clickable rectangle area on a story media to be added. + # + # @attr position [TD::Types::StoryAreaPosition] Position of the area. + # @attr type [TD::Types::InputStoryAreaType] Type of the area. + class InputStoryArea < Base + attribute :position, TD::Types::StoryAreaPosition + attribute :type, TD::Types::InputStoryAreaType + end +end diff --git a/lib/tdlib/types/input_story_area_type.rb b/lib/tdlib/types/input_story_area_type.rb new file mode 100644 index 00000000..7b17aed8 --- /dev/null +++ b/lib/tdlib/types/input_story_area_type.rb @@ -0,0 +1,16 @@ +module TD::Types + # Describes type of clickable area on a story media to be added. + class InputStoryAreaType < Base + %w[ + location + found_venue + previous_venue + suggested_reaction + message + link + weather + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/input_story_area_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/input_story_area_type/found_venue.rb b/lib/tdlib/types/input_story_area_type/found_venue.rb new file mode 100644 index 00000000..0c1db794 --- /dev/null +++ b/lib/tdlib/types/input_story_area_type/found_venue.rb @@ -0,0 +1,10 @@ +module TD::Types + # An area pointing to a venue found by the bot getOption("venue_search_bot_username"). + # + # @attr query_id [Integer] Identifier of the inline query, used to found the venue. + # @attr result_id [TD::Types::String] Identifier of the inline query result. + class InputStoryAreaType::FoundVenue < InputStoryAreaType + attribute :query_id, TD::Types::Coercible::Integer + attribute :result_id, TD::Types::String + end +end diff --git a/lib/tdlib/types/input_story_area_type/link.rb b/lib/tdlib/types/input_story_area_type/link.rb new file mode 100644 index 00000000..d888dd66 --- /dev/null +++ b/lib/tdlib/types/input_story_area_type/link.rb @@ -0,0 +1,8 @@ +module TD::Types + # An area pointing to a HTTP or tg:// link. + # + # @attr url [TD::Types::String] HTTP or tg:// URL to be opened when the area is clicked. + class InputStoryAreaType::Link < InputStoryAreaType + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/input_story_area_type/location.rb b/lib/tdlib/types/input_story_area_type/location.rb new file mode 100644 index 00000000..117222fb --- /dev/null +++ b/lib/tdlib/types/input_story_area_type/location.rb @@ -0,0 +1,10 @@ +module TD::Types + # An area pointing to a location. + # + # @attr location [TD::Types::Location] The location. + # @attr address [TD::Types::LocationAddress] Address of the location; pass null if unknown. + class InputStoryAreaType::Location < InputStoryAreaType + attribute :location, TD::Types::Location + attribute :address, TD::Types::LocationAddress + end +end diff --git a/lib/tdlib/types/input_story_area_type/message.rb b/lib/tdlib/types/input_story_area_type/message.rb new file mode 100644 index 00000000..262ecf57 --- /dev/null +++ b/lib/tdlib/types/input_story_area_type/message.rb @@ -0,0 +1,12 @@ +module TD::Types + # An area pointing to a message. + # + # @attr chat_id [Integer] Identifier of the chat with the message. + # Currently, the chat must be a supergroup or a channel chat. + # @attr message_id [Integer] Identifier of the message. + # Use messageProperties.can_be_shared_in_story to check whether the message is suitable. + class InputStoryAreaType::Message < InputStoryAreaType + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/input_story_area_type/previous_venue.rb b/lib/tdlib/types/input_story_area_type/previous_venue.rb new file mode 100644 index 00000000..262300a8 --- /dev/null +++ b/lib/tdlib/types/input_story_area_type/previous_venue.rb @@ -0,0 +1,10 @@ +module TD::Types + # An area pointing to a venue already added to the story. + # + # @attr venue_provider [TD::Types::String] Provider of the venue. + # @attr venue_id [TD::Types::String] Identifier of the venue in the provider database. + class InputStoryAreaType::PreviousVenue < InputStoryAreaType + attribute :venue_provider, TD::Types::String + attribute :venue_id, TD::Types::String + end +end diff --git a/lib/tdlib/types/input_story_area_type/suggested_reaction.rb b/lib/tdlib/types/input_story_area_type/suggested_reaction.rb new file mode 100644 index 00000000..2602f23e --- /dev/null +++ b/lib/tdlib/types/input_story_area_type/suggested_reaction.rb @@ -0,0 +1,12 @@ +module TD::Types + # An area pointing to a suggested reaction. + # + # @attr reaction_type [TD::Types::ReactionType] Type of the reaction. + # @attr is_dark [Boolean] True, if reaction has a dark background. + # @attr is_flipped [Boolean] True, if reaction corner is flipped. + class InputStoryAreaType::SuggestedReaction < InputStoryAreaType + attribute :reaction_type, TD::Types::ReactionType + attribute :is_dark, TD::Types::Bool + attribute :is_flipped, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/input_story_area_type/weather.rb b/lib/tdlib/types/input_story_area_type/weather.rb new file mode 100644 index 00000000..406ee331 --- /dev/null +++ b/lib/tdlib/types/input_story_area_type/weather.rb @@ -0,0 +1,12 @@ +module TD::Types + # An area with information about weather. + # + # @attr temperature [Float] Temperature, in degree Celsius. + # @attr emoji [TD::Types::String] Emoji representing the weather. + # @attr background_color [Integer] A color of the area background in the ARGB format. + class InputStoryAreaType::Weather < InputStoryAreaType + attribute :temperature, TD::Types::Coercible::Float + attribute :emoji, TD::Types::String + attribute :background_color, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/input_story_areas.rb b/lib/tdlib/types/input_story_areas.rb new file mode 100644 index 00000000..4e22ade5 --- /dev/null +++ b/lib/tdlib/types/input_story_areas.rb @@ -0,0 +1,13 @@ +module TD::Types + # Contains a list of story areas to be added. + # + # @attr areas [Array] List of input story areas. + # Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and + # {TD::Types::InputStoryAreaType::PreviousVenue} areas, up to getOption("story_suggested_reaction_area_count_max") + # {TD::Types::InputStoryAreaType::SuggestedReaction} areas, up to 1 {TD::Types::InputStoryAreaType::Message} area, up to + # getOption("story_link_area_count_max") {TD::Types::InputStoryAreaType::Link} areas if the current user is a Telegram + # Premium user, and up to 3 {TD::Types::InputStoryAreaType::Weather} areas. + class InputStoryAreas < Base + attribute :areas, TD::Types::Array.of(TD::Types::InputStoryArea) + end +end diff --git a/lib/tdlib/types/input_story_content.rb b/lib/tdlib/types/input_story_content.rb new file mode 100644 index 00000000..ef496c52 --- /dev/null +++ b/lib/tdlib/types/input_story_content.rb @@ -0,0 +1,11 @@ +module TD::Types + # The content of a story to send. + class InputStoryContent < Base + %w[ + photo + video + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/input_story_content/#{type}" + end + end +end diff --git a/lib/tdlib/types/input_story_content/photo.rb b/lib/tdlib/types/input_story_content/photo.rb new file mode 100644 index 00000000..c38c8083 --- /dev/null +++ b/lib/tdlib/types/input_story_content/photo.rb @@ -0,0 +1,12 @@ +module TD::Types + # A photo story. + # + # @attr photo [TD::Types::InputFile] Photo to send. + # The photo must be at most 10 MB in size. + # The photo size must be 1080x1920. + # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the photo, if applicable. + class InputStoryContent::Photo < InputStoryContent + attribute :photo, TD::Types::InputFile + attribute :added_sticker_file_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/input_story_content/video.rb b/lib/tdlib/types/input_story_content/video.rb new file mode 100644 index 00000000..84c5c803 --- /dev/null +++ b/lib/tdlib/types/input_story_content/video.rb @@ -0,0 +1,19 @@ +module TD::Types + # A video story. + # + # @attr video [TD::Types::InputFile] Video to be sent. + # The video size must be 720x1280. + # The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each + # second. + # @attr added_sticker_file_ids [Array] File identifiers of the stickers added to the video, if applicable. + # @attr duration [Float] Precise duration of the video, in seconds; 0-60. + # @attr cover_frame_timestamp [Float] Timestamp of the frame, which will be used as video thumbnail. + # @attr is_animation [Boolean] True, if the video has no sound. + class InputStoryContent::Video < InputStoryContent + attribute :video, TD::Types::InputFile + attribute :added_sticker_file_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :duration, TD::Types::Coercible::Float + attribute :cover_frame_timestamp, TD::Types::Coercible::Float + attribute :is_animation, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/input_text_quote.rb b/lib/tdlib/types/input_text_quote.rb new file mode 100644 index 00000000..f886bf2d --- /dev/null +++ b/lib/tdlib/types/input_text_quote.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes manually chosen quote from another message. + # + # @attr text [TD::Types::FormattedText] Text of the quote; 0-getOption("message_reply_quote_length_max") characters. + # Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be + # kept in the quote. + # @attr position [Integer] Quote position in the original message in UTF-16 code units. + class InputTextQuote < Base + attribute :text, TD::Types::FormattedText + attribute :position, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/internal_link_type.rb b/lib/tdlib/types/internal_link_type.rb new file mode 100644 index 00000000..f65b2d34 --- /dev/null +++ b/lib/tdlib/types/internal_link_type.rb @@ -0,0 +1,54 @@ +module TD::Types + # Describes an internal https://t.me or tg: link, which must be processed by the application in a special way. + class InternalLinkType < Base + %w[ + active_sessions + attachment_menu_bot + authentication_code + background + bot_add_to_channel + bot_start + bot_start_in_group + business_chat + buy_stars + change_phone_number + chat_boost + chat_folder_invite + chat_folder_settings + chat_invite + default_message_auto_delete_timer_settings + edit_profile_settings + game + instant_view + invoice + language_pack + language_settings + main_web_app + message + message_draft + passport_data_request + phone_number_confirmation + premium_features + premium_gift + premium_gift_code + privacy_and_security_settings + proxy + public_chat + qr_code_authentication + restore_purchases + settings + sticker_set + story + theme + theme_settings + unknown_deep_link + unsupported_proxy + user_phone_number + user_token + video_chat + web_app + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/internal_link_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/internal_link_type/active_sessions.rb b/lib/tdlib/types/internal_link_type/active_sessions.rb new file mode 100644 index 00000000..8ba6bbba --- /dev/null +++ b/lib/tdlib/types/internal_link_type/active_sessions.rb @@ -0,0 +1,6 @@ +module TD::Types + # The link is a link to the Devices section of the application. + # Use getActiveSessions to get the list of active sessions and show them to the user. + class InternalLinkType::ActiveSessions < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/attachment_menu_bot.rb b/lib/tdlib/types/internal_link_type/attachment_menu_bot.rb new file mode 100644 index 00000000..36b9d2aa --- /dev/null +++ b/lib/tdlib/types/internal_link_type/attachment_menu_bot.rb @@ -0,0 +1,21 @@ +module TD::Types + # The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. + # Process given target_chat to open the chat. + # Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to + # attachment menu. + # Then, use getAttachmentMenuBot to receive information about the bot. + # If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being third-party applications, + # ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. + # If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. + # If the attachment menu bot can't be used in the opened chat, show an error to the user. + # If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL. + # + # @attr target_chat [TD::Types::TargetChat] Target chat to be opened. + # @attr bot_username [TD::Types::String] Username of the bot. + # @attr url [TD::Types::String] URL to be passed to openWebApp. + class InternalLinkType::AttachmentMenuBot < InternalLinkType + attribute :target_chat, TD::Types::TargetChat + attribute :bot_username, TD::Types::String + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/authentication_code.rb b/lib/tdlib/types/internal_link_type/authentication_code.rb new file mode 100644 index 00000000..00385859 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/authentication_code.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link contains an authentication code. + # Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode. + # + # @attr code [TD::Types::String] The authentication code. + class InternalLinkType::AuthenticationCode < InternalLinkType + attribute :code, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/background.rb b/lib/tdlib/types/internal_link_type/background.rb new file mode 100644 index 00000000..b72d053b --- /dev/null +++ b/lib/tdlib/types/internal_link_type/background.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a background. + # Call searchBackground with the given background name to process the link If background is found and the user wants + # to apply it, then call setDefaultBackground. + # + # @attr background_name [TD::Types::String] Name of the background. + class InternalLinkType::Background < InternalLinkType + attribute :background_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/bot_add_to_channel.rb b/lib/tdlib/types/internal_link_type/bot_add_to_channel.rb new file mode 100644 index 00000000..c43c0654 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/bot_add_to_channel.rb @@ -0,0 +1,16 @@ +module TD::Types + # The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. + # Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select + # a channel chat to add the bot to as an administrator. + # Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, + # check that the current user can edit its administrator rights and combine received rights with the requested + # administrator rights. + # Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights. + # + # @attr bot_username [TD::Types::String] Username of the bot. + # @attr administrator_rights [TD::Types::ChatAdministratorRights] Expected administrator rights for the bot. + class InternalLinkType::BotAddToChannel < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :administrator_rights, TD::Types::ChatAdministratorRights + end +end diff --git a/lib/tdlib/types/internal_link_type/bot_start.rb b/lib/tdlib/types/internal_link_type/bot_start.rb new file mode 100644 index 00000000..e9f6e565 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/bot_start.rb @@ -0,0 +1,15 @@ +module TD::Types + # The link is a link to a chat with a Telegram bot. + # Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with + # the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed. + # + # @attr bot_username [TD::Types::String] Username of the bot. + # @attr start_parameter [TD::Types::String] The parameter to be passed to sendBotStartMessage. + # @attr autostart [Boolean] True, if sendBotStartMessage must be called automatically without showing the START + # button. + class InternalLinkType::BotStart < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :start_parameter, TD::Types::String + attribute :autostart, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/internal_link_type/bot_start_in_group.rb b/lib/tdlib/types/internal_link_type/bot_start_in_group.rb new file mode 100644 index 00000000..4e7e8495 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/bot_start_in_group.rb @@ -0,0 +1,23 @@ +module TD::Types + # The link is a link to a Telegram bot, which is supposed to be added to a group chat. + # Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the + # current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added + # to a public supergroup only by administrators of the supergroup. + # If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat + # and if the bot already is an administrator, check that the current user can edit its administrator rights, combine + # received rights with the requested administrator rights, show confirmation box to the user, and call + # setChatMemberStatus with the chosen chat and confirmed administrator rights. + # Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. + # Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; + # otherwise, just send /start message with bot's username added to the chat. + # + # @attr bot_username [TD::Types::String] Username of the bot. + # @attr start_parameter [TD::Types::String] The parameter to be passed to sendBotStartMessage. + # @attr administrator_rights [TD::Types::ChatAdministratorRights, nil] Expected administrator rights for the bot; may + # be null. + class InternalLinkType::BotStartInGroup < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :start_parameter, TD::Types::String + attribute :administrator_rights, TD::Types::ChatAdministratorRights.optional.default(nil) + end +end diff --git a/lib/tdlib/types/internal_link_type/business_chat.rb b/lib/tdlib/types/internal_link_type/business_chat.rb new file mode 100644 index 00000000..f56bfdf0 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/business_chat.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a business chat. + # Use getBusinessChatLinkInfo with the provided link name to get information about the link, then open received + # private chat and replace chat draft with the provided text. + # + # @attr link_name [TD::Types::String] Name of the link. + class InternalLinkType::BusinessChat < InternalLinkType + attribute :link_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/buy_stars.rb b/lib/tdlib/types/internal_link_type/buy_stars.rb new file mode 100644 index 00000000..7f3214bf --- /dev/null +++ b/lib/tdlib/types/internal_link_type/buy_stars.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link is a link to the Telegram Star purchase section of the application. + # + # @attr star_count [Integer] The number of Telegram Stars that must be owned by the user. + # @attr purpose [TD::Types::String] Purpose of Telegram Star purchase. + # Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend + # channel subscriptions. + class InternalLinkType::BuyStars < InternalLinkType + attribute :star_count, TD::Types::Coercible::Integer + attribute :purpose, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/change_phone_number.rb b/lib/tdlib/types/internal_link_type/change_phone_number.rb new file mode 100644 index 00000000..67c40ef9 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/change_phone_number.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the change phone number section of the application. + class InternalLinkType::ChangePhoneNumber < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/chat_boost.rb b/lib/tdlib/types/internal_link_type/chat_boost.rb new file mode 100644 index 00000000..1dcddc16 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/chat_boost.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link is a link to boost a Telegram chat. + # Call getChatBoostLinkInfo with the given URL to process the link. + # If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status + # and check whether the chat can be boosted. + # If the user wants to boost the chat and the chat can be boosted, then call boostChat. + # + # @attr url [TD::Types::String] URL to be passed to getChatBoostLinkInfo. + class InternalLinkType::ChatBoost < InternalLinkType + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/chat_folder_invite.rb b/lib/tdlib/types/internal_link_type/chat_folder_invite.rb new file mode 100644 index 00000000..752924fa --- /dev/null +++ b/lib/tdlib/types/internal_link_type/chat_folder_invite.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is an invite link to a chat folder. + # Call checkChatFolderInviteLink with the given invite link to process the link. + # If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink. + # + # @attr invite_link [TD::Types::String] Internal representation of the invite link. + class InternalLinkType::ChatFolderInvite < InternalLinkType + attribute :invite_link, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/chat_folder_settings.rb b/lib/tdlib/types/internal_link_type/chat_folder_settings.rb new file mode 100644 index 00000000..a16708bf --- /dev/null +++ b/lib/tdlib/types/internal_link_type/chat_folder_settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the folder section of the application settings. + class InternalLinkType::ChatFolderSettings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/chat_invite.rb b/lib/tdlib/types/internal_link_type/chat_invite.rb new file mode 100644 index 00000000..f0311d7a --- /dev/null +++ b/lib/tdlib/types/internal_link_type/chat_invite.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a chat invite link. + # Call checkChatInviteLink with the given invite link to process the link. + # If the link is valid and the user wants to join the chat, then call joinChatByInviteLink. + # + # @attr invite_link [TD::Types::String] Internal representation of the invite link. + class InternalLinkType::ChatInvite < InternalLinkType + attribute :invite_link, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/default_message_auto_delete_timer_settings.rb b/lib/tdlib/types/internal_link_type/default_message_auto_delete_timer_settings.rb new file mode 100644 index 00000000..b4f2c462 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/default_message_auto_delete_timer_settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the default message auto-delete timer settings section of the application settings. + class InternalLinkType::DefaultMessageAutoDeleteTimerSettings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/edit_profile_settings.rb b/lib/tdlib/types/internal_link_type/edit_profile_settings.rb new file mode 100644 index 00000000..3a240a1b --- /dev/null +++ b/lib/tdlib/types/internal_link_type/edit_profile_settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the edit profile section of the application settings. + class InternalLinkType::EditProfileSettings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/game.rb b/lib/tdlib/types/internal_link_type/game.rb new file mode 100644 index 00000000..eabf0705 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/game.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link is a link to a game. + # Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a + # chat to send the game, and then call sendMessage with inputMessageGame. + # + # @attr bot_username [TD::Types::String] Username of the bot that owns the game. + # @attr game_short_name [TD::Types::String] Short name of the game. + class InternalLinkType::Game < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :game_short_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/instant_view.rb b/lib/tdlib/types/internal_link_type/instant_view.rb new file mode 100644 index 00000000..411e8a46 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/instant_view.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link must be opened in an Instant View. + # Call getWebPageInstantView with the given URL to process the link. + # If Instant View is found, then show it, otherwise, open the fallback URL in an external browser. + # + # @attr url [TD::Types::String] URL to be passed to getWebPageInstantView. + # @attr fallback_url [TD::Types::String] An URL to open if getWebPageInstantView fails. + class InternalLinkType::InstantView < InternalLinkType + attribute :url, TD::Types::String + attribute :fallback_url, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/invoice.rb b/lib/tdlib/types/internal_link_type/invoice.rb new file mode 100644 index 00000000..db646900 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/invoice.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to an invoice. + # Call getPaymentForm with the given invoice name to process the link. + # + # @attr invoice_name [TD::Types::String] Name of the invoice. + class InternalLinkType::Invoice < InternalLinkType + attribute :invoice_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/language_pack.rb b/lib/tdlib/types/internal_link_type/language_pack.rb new file mode 100644 index 00000000..3b00cd81 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/language_pack.rb @@ -0,0 +1,11 @@ +module TD::Types + # The link is a link to a language pack. + # Call getLanguagePackInfo with the given language pack identifier to process the link. + # If the language pack is found and the user wants to apply it, then call setOption for the option + # "language_pack_id". + # + # @attr language_pack_id [TD::Types::String] Language pack identifier. + class InternalLinkType::LanguagePack < InternalLinkType + attribute :language_pack_id, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/language_settings.rb b/lib/tdlib/types/internal_link_type/language_settings.rb new file mode 100644 index 00000000..8f2e9842 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/language_settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the language section of the application settings. + class InternalLinkType::LanguageSettings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/main_web_app.rb b/lib/tdlib/types/internal_link_type/main_web_app.rb new file mode 100644 index 00000000..6512a80d --- /dev/null +++ b/lib/tdlib/types/internal_link_type/main_web_app.rb @@ -0,0 +1,18 @@ +module TD::Types + # The link is a link to the main Web App of a bot. + # Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. + # If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, + # then if the bot isn't added to side menu, show a disclaimer about Mini Apps being third-party applications, ask the + # user to accept their Terms of service and confirm adding the bot to side and attachment menu, then if the user accepts + # the terms and confirms adding, use toggleBotIsAddedToAttachmentMenu to add the bot. + # Then, use getMainWebApp with the given start parameter and open the returned URL as a Web App. + # + # @attr bot_username [TD::Types::String] Username of the bot. + # @attr start_parameter [TD::Types::String] Start parameter to be passed to getMainWebApp. + # @attr is_compact [Boolean] True, if the Web App must be opened in the compact mode instead of the full-size mode. + class InternalLinkType::MainWebApp < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :start_parameter, TD::Types::String + attribute :is_compact, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/internal_link_type/message.rb b/lib/tdlib/types/internal_link_type/message.rb new file mode 100644 index 00000000..7d496b31 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/message.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a Telegram message or a forum topic. + # Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show + # the message there. + # + # @attr url [TD::Types::String] URL to be passed to getMessageLinkInfo. + class InternalLinkType::Message < InternalLinkType + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/message_draft.rb b/lib/tdlib/types/internal_link_type/message_draft.rb new file mode 100644 index 00000000..9447933b --- /dev/null +++ b/lib/tdlib/types/internal_link_type/message_draft.rb @@ -0,0 +1,13 @@ +module TD::Types + # The link contains a message draft text. + # A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the + # input field. + # + # @attr text [TD::Types::FormattedText] Message draft text. + # @attr contains_link [Boolean] True, if the first line of the text contains a link. + # If true, the input field needs to be focused and the text after the link must be selected. + class InternalLinkType::MessageDraft < InternalLinkType + attribute :text, TD::Types::FormattedText + attribute :contains_link, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/internal_link_type/passport_data_request.rb b/lib/tdlib/types/internal_link_type/passport_data_request.rb new file mode 100644 index 00000000..0b4df5cd --- /dev/null +++ b/lib/tdlib/types/internal_link_type/passport_data_request.rb @@ -0,0 +1,22 @@ +module TD::Types + # The link contains a request of Telegram passport data. + # Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from + # outside of the application; otherwise, ignore it. + # + # @attr bot_user_id [Integer] User identifier of the service's bot; the corresponding user may be unknown yet. + # @attr scope [TD::Types::String] Telegram Passport element types requested by the service. + # @attr public_key [TD::Types::String] Service's public key. + # @attr nonce [TD::Types::String] Unique request identifier provided by the service. + # @attr callback_url [TD::Types::String, nil] An HTTP URL to open once the request is finished, canceled, or failed + # with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error&error=... + # respectively. + # If empty, then onActivityResult method must be used to return response on Android, or the link + # tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise. + class InternalLinkType::PassportDataRequest < InternalLinkType + attribute :bot_user_id, TD::Types::Coercible::Integer + attribute :scope, TD::Types::String + attribute :public_key, TD::Types::String + attribute :nonce, TD::Types::String + attribute :callback_url, TD::Types::String.optional.default(nil) + end +end diff --git a/lib/tdlib/types/internal_link_type/phone_number_confirmation.rb b/lib/tdlib/types/internal_link_type/phone_number_confirmation.rb new file mode 100644 index 00000000..a4c5e78f --- /dev/null +++ b/lib/tdlib/types/internal_link_type/phone_number_confirmation.rb @@ -0,0 +1,13 @@ +module TD::Types + # The link can be used to confirm ownership of a phone number to prevent account deletion. + # Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given + # hash to process the link. + # If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it. + # + # @attr hash [TD::Types::String] Hash value from the link. + # @attr phone_number [TD::Types::String] Phone number value from the link. + class InternalLinkType::PhoneNumberConfirmation < InternalLinkType + attribute :hash, TD::Types::String + attribute :phone_number, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/premium_features.rb b/lib/tdlib/types/internal_link_type/premium_features.rb new file mode 100644 index 00000000..d75f8dcd --- /dev/null +++ b/lib/tdlib/types/internal_link_type/premium_features.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram + # Premium. + # Call getPremiumFeatures with the given referrer to process the link. + # + # @attr referrer [TD::Types::String] Referrer specified in the link. + class InternalLinkType::PremiumFeatures < InternalLinkType + attribute :referrer, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/premium_gift.rb b/lib/tdlib/types/internal_link_type/premium_gift.rb new file mode 100644 index 00000000..fc21c820 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/premium_gift.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram + # payments or in-store purchases. + # + # @attr referrer [TD::Types::String] Referrer specified in the link. + class InternalLinkType::PremiumGift < InternalLinkType + attribute :referrer, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/premium_gift_code.rb b/lib/tdlib/types/internal_link_type/premium_gift_code.rb new file mode 100644 index 00000000..f37cccb2 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/premium_gift_code.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link with a Telegram Premium gift code. + # Call checkPremiumGiftCode with the given code to process the link. + # If the code is valid and the user wants to apply it, then call applyPremiumGiftCode. + # + # @attr code [TD::Types::String] The Telegram Premium gift code. + class InternalLinkType::PremiumGiftCode < InternalLinkType + attribute :code, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/privacy_and_security_settings.rb b/lib/tdlib/types/internal_link_type/privacy_and_security_settings.rb new file mode 100644 index 00000000..288b5827 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/privacy_and_security_settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the privacy and security section of the application settings. + class InternalLinkType::PrivacyAndSecuritySettings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/proxy.rb b/lib/tdlib/types/internal_link_type/proxy.rb new file mode 100644 index 00000000..a9a67441 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/proxy.rb @@ -0,0 +1,13 @@ +module TD::Types + # The link is a link to a proxy. + # Call addProxy with the given parameters to process the link and add the proxy. + # + # @attr server [TD::Types::String] Proxy server domain or IP address. + # @attr port [Integer] Proxy server port. + # @attr type [TD::Types::ProxyType] Type of the proxy. + class InternalLinkType::Proxy < InternalLinkType + attribute :server, TD::Types::String + attribute :port, TD::Types::Coercible::Integer + attribute :type, TD::Types::ProxyType + end +end diff --git a/lib/tdlib/types/internal_link_type/public_chat.rb b/lib/tdlib/types/internal_link_type/public_chat.rb new file mode 100644 index 00000000..5fb2f2c3 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/public_chat.rb @@ -0,0 +1,17 @@ +module TD::Types + # The link is a link to a chat by its username. + # Call searchPublicChat with the given chat username to process the link If the chat is found, open its profile + # information screen or the chat itself. + # If draft text isn't empty and the chat is a private chat with a regular user, then put the draft text in the input + # field. + # + # @attr chat_username [TD::Types::String] Username of the chat. + # @attr draft_text [TD::Types::String] Draft text for message to send in the chat. + # @attr open_profile [Boolean] True, if chat profile information screen must be opened; otherwise, the chat itself + # must be opened. + class InternalLinkType::PublicChat < InternalLinkType + attribute :chat_username, TD::Types::String + attribute :draft_text, TD::Types::String + attribute :open_profile, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/internal_link_type/qr_code_authentication.rb b/lib/tdlib/types/internal_link_type/qr_code_authentication.rb new file mode 100644 index 00000000..d7c42718 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/qr_code_authentication.rb @@ -0,0 +1,8 @@ +module TD::Types + # The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app + # camera. + # An alert similar to "This code can be used to allow someone to log in to your Telegram account. + # To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown. + class InternalLinkType::QrCodeAuthentication < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/restore_purchases.rb b/lib/tdlib/types/internal_link_type/restore_purchases.rb new file mode 100644 index 00000000..33ee3519 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/restore_purchases.rb @@ -0,0 +1,6 @@ +module TD::Types + # The link forces restore of App Store purchases when opened. + # For official iOS application only. + class InternalLinkType::RestorePurchases < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/settings.rb b/lib/tdlib/types/internal_link_type/settings.rb new file mode 100644 index 00000000..dac5ea34 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to application settings. + class InternalLinkType::Settings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/sticker_set.rb b/lib/tdlib/types/internal_link_type/sticker_set.rb new file mode 100644 index 00000000..2c6b3b67 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/sticker_set.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link is a link to a sticker set. + # Call searchStickerSet with the given sticker set name to process the link and show the sticker set. + # If the sticker set is found and the user wants to add it, then call changeStickerSet. + # + # @attr sticker_set_name [TD::Types::String] Name of the sticker set. + # @attr expect_custom_emoji [Boolean] True, if the sticker set is expected to contain custom emoji. + class InternalLinkType::StickerSet < InternalLinkType + attribute :sticker_set_name, TD::Types::String + attribute :expect_custom_emoji, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/internal_link_type/story.rb b/lib/tdlib/types/internal_link_type/story.rb new file mode 100644 index 00000000..a339d827 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/story.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link is a link to a story. + # Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the + # given story identifier, then show the story if received. + # + # @attr story_sender_username [TD::Types::String] Username of the sender of the story. + # @attr story_id [Integer] Story identifier. + class InternalLinkType::Story < InternalLinkType + attribute :story_sender_username, TD::Types::String + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/internal_link_type/theme.rb b/lib/tdlib/types/internal_link_type/theme.rb new file mode 100644 index 00000000..42a5e80d --- /dev/null +++ b/lib/tdlib/types/internal_link_type/theme.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to a cloud theme. + # TDLib has no theme support yet. + # + # @attr theme_name [TD::Types::String] Name of the theme. + class InternalLinkType::Theme < InternalLinkType + attribute :theme_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/theme_settings.rb b/lib/tdlib/types/internal_link_type/theme_settings.rb new file mode 100644 index 00000000..545cc9c5 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/theme_settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to the theme section of the application settings. + class InternalLinkType::ThemeSettings < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/unknown_deep_link.rb b/lib/tdlib/types/internal_link_type/unknown_deep_link.rb new file mode 100644 index 00000000..ea3f1d1a --- /dev/null +++ b/lib/tdlib/types/internal_link_type/unknown_deep_link.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is an unknown tg: link. + # Call getDeepLinkInfo to process the link. + # + # @attr link [TD::Types::String] Link to be passed to getDeepLinkInfo. + class InternalLinkType::UnknownDeepLink < InternalLinkType + attribute :link, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/unsupported_proxy.rb b/lib/tdlib/types/internal_link_type/unsupported_proxy.rb new file mode 100644 index 00000000..e094d095 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/unsupported_proxy.rb @@ -0,0 +1,6 @@ +module TD::Types + # The link is a link to an unsupported proxy. + # An alert can be shown to the user. + class InternalLinkType::UnsupportedProxy < InternalLinkType + end +end diff --git a/lib/tdlib/types/internal_link_type/user_phone_number.rb b/lib/tdlib/types/internal_link_type/user_phone_number.rb new file mode 100644 index 00000000..bdc46f35 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/user_phone_number.rb @@ -0,0 +1,16 @@ +module TD::Types + # The link is a link to a user by its phone number. + # Call searchUserByPhoneNumber with the given phone number to process the link. + # If the user is found, then call createPrivateChat and open user's profile information screen or the chat itself. + # If draft text isn't empty, then put the draft text in the input field. + # + # @attr phone_number [TD::Types::String] Phone number of the user. + # @attr draft_text [TD::Types::String] Draft text for message to send in the chat. + # @attr open_profile [Boolean] True, if user's profile information screen must be opened; otherwise, the chat itself + # must be opened. + class InternalLinkType::UserPhoneNumber < InternalLinkType + attribute :phone_number, TD::Types::String + attribute :draft_text, TD::Types::String + attribute :open_profile, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/internal_link_type/user_token.rb b/lib/tdlib/types/internal_link_type/user_token.rb new file mode 100644 index 00000000..ced13e03 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/user_token.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a user by a temporary token. + # Call searchUserByToken with the given token to process the link. + # If the user is found, then call createPrivateChat and open the chat. + # + # @attr token [TD::Types::String] The token. + class InternalLinkType::UserToken < InternalLinkType + attribute :token, TD::Types::String + end +end diff --git a/lib/tdlib/types/internal_link_type/video_chat.rb b/lib/tdlib/types/internal_link_type/video_chat.rb new file mode 100644 index 00000000..b5d93d2a --- /dev/null +++ b/lib/tdlib/types/internal_link_type/video_chat.rb @@ -0,0 +1,16 @@ +module TD::Types + # The link is a link to a video chat. + # Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process + # the link. + # + # @attr chat_username [TD::Types::String] Username of the chat with the video chat. + # @attr invite_hash [TD::Types::String] If non-empty, invite hash to be used to join the video chat without being + # muted by administrators. + # @attr is_live_stream [Boolean] True, if the video chat is expected to be a live stream in a channel or a broadcast + # group. + class InternalLinkType::VideoChat < InternalLinkType + attribute :chat_username, TD::Types::String + attribute :invite_hash, TD::Types::String + attribute :is_live_stream, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/internal_link_type/web_app.rb b/lib/tdlib/types/internal_link_type/web_app.rb new file mode 100644 index 00000000..805a9068 --- /dev/null +++ b/lib/tdlib/types/internal_link_type/web_app.rb @@ -0,0 +1,21 @@ +module TD::Types + # The link is a link to a Web App. + # Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the + # received bot and the given web_app_short_name. + # Process received foundWebApp by showing a confirmation dialog if needed. + # If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps + # being third-party applications instead of the dialog and ask the user to accept their Terms of service. + # If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. + # Then, call getWebAppLinkUrl and open the returned URL as a Web App. + # + # @attr bot_username [TD::Types::String] Username of the bot that owns the Web App. + # @attr web_app_short_name [TD::Types::String] Short name of the Web App. + # @attr start_parameter [TD::Types::String] Start parameter to be passed to getWebAppLinkUrl. + # @attr is_compact [Boolean] True, if the Web App must be opened in the compact mode instead of the full-size mode. + class InternalLinkType::WebApp < InternalLinkType + attribute :bot_username, TD::Types::String + attribute :web_app_short_name, TD::Types::String + attribute :start_parameter, TD::Types::String + attribute :is_compact, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/invite_link_chat_type.rb b/lib/tdlib/types/invite_link_chat_type.rb new file mode 100644 index 00000000..eecf2cf1 --- /dev/null +++ b/lib/tdlib/types/invite_link_chat_type.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes the type of chat to which points an invite link. + class InviteLinkChatType < Base + %w[ + basic_group + supergroup + channel + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/invite_link_chat_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/invite_link_chat_type/basic_group.rb b/lib/tdlib/types/invite_link_chat_type/basic_group.rb new file mode 100644 index 00000000..4beac869 --- /dev/null +++ b/lib/tdlib/types/invite_link_chat_type/basic_group.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is an invite link for a basic group. + class InviteLinkChatType::BasicGroup < InviteLinkChatType + end +end diff --git a/lib/tdlib/types/invite_link_chat_type/channel.rb b/lib/tdlib/types/invite_link_chat_type/channel.rb new file mode 100644 index 00000000..1492aa00 --- /dev/null +++ b/lib/tdlib/types/invite_link_chat_type/channel.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is an invite link for a channel. + class InviteLinkChatType::Channel < InviteLinkChatType + end +end diff --git a/lib/tdlib/types/invite_link_chat_type/supergroup.rb b/lib/tdlib/types/invite_link_chat_type/supergroup.rb new file mode 100644 index 00000000..54bc3503 --- /dev/null +++ b/lib/tdlib/types/invite_link_chat_type/supergroup.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is an invite link for a supergroup. + class InviteLinkChatType::Supergroup < InviteLinkChatType + end +end diff --git a/lib/tdlib/types/invoice.rb b/lib/tdlib/types/invoice.rb index f5a4b800..d1066ee1 100644 --- a/lib/tdlib/types/invoice.rb +++ b/lib/tdlib/types/invoice.rb @@ -6,6 +6,12 @@ module TD::Types # product. # @attr max_tip_amount [Integer] The maximum allowed amount of tip in the smallest units of the currency. # @attr suggested_tip_amounts [Array] Suggested amounts of tip in the smallest units of the currency. + # @attr recurring_payment_terms_of_service_url [TD::Types::String] An HTTP URL with terms of service for recurring + # payments. + # If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service + # before allowed to pay. + # @attr terms_of_service_url [TD::Types::String] An HTTP URL with terms of service for non-recurring payments. + # If non-empty, then the user must accept the terms of service before allowed to pay. # @attr is_test [Boolean] True, if the payment is a test payment. # @attr need_name [Boolean] True, if the user's name is needed for payment. # @attr need_phone_number [Boolean] True, if the user's phone number is needed for payment. @@ -19,6 +25,8 @@ class Invoice < Base attribute :price_parts, TD::Types::Array.of(TD::Types::LabeledPricePart) attribute :max_tip_amount, TD::Types::Coercible::Integer attribute :suggested_tip_amounts, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :recurring_payment_terms_of_service_url, TD::Types::String + attribute :terms_of_service_url, TD::Types::String attribute :is_test, TD::Types::Bool attribute :need_name, TD::Types::Bool attribute :need_phone_number, TD::Types::Bool diff --git a/lib/tdlib/types/keyboard_button_type.rb b/lib/tdlib/types/keyboard_button_type.rb index a6fd43ed..e72e46b0 100644 --- a/lib/tdlib/types/keyboard_button_type.rb +++ b/lib/tdlib/types/keyboard_button_type.rb @@ -6,6 +6,9 @@ class KeyboardButtonType < Base request_phone_number request_location request_poll + request_users + request_chat + web_app ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/keyboard_button_type/#{type}" end diff --git a/lib/tdlib/types/keyboard_button_type/request_chat.rb b/lib/tdlib/types/keyboard_button_type/request_chat.rb new file mode 100644 index 00000000..cd0cdd74 --- /dev/null +++ b/lib/tdlib/types/keyboard_button_type/request_chat.rb @@ -0,0 +1,41 @@ +module TD::Types + # A button that requests a chat to be shared by the current user; available only in private chats. + # Use the method shareChatWithBot to complete the request. + # + # @attr id [Integer] Unique button identifier. + # @attr chat_is_channel [Boolean] True, if the chat must be a channel; otherwise, a basic group or a supergroup chat + # is shared. + # @attr restrict_chat_is_forum [Boolean] True, if the chat must or must not be a forum supergroup. + # @attr chat_is_forum [Boolean] True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum + # supergroup. + # Ignored if restrict_chat_is_forum is false. + # @attr restrict_chat_has_username [Boolean] True, if the chat must or must not have a username. + # @attr chat_has_username [Boolean] True, if the chat must have a username; otherwise, the chat must not have a + # username. + # Ignored if restrict_chat_has_username is false. + # @attr chat_is_created [Boolean] True, if the chat must be created by the current user. + # @attr user_administrator_rights [TD::Types::ChatAdministratorRights, nil] Expected user administrator rights in the + # chat; may be null if they aren't restricted. + # @attr bot_administrator_rights [TD::Types::ChatAdministratorRights, nil] Expected bot administrator rights in the + # chat; may be null if they aren't restricted. + # @attr bot_is_member [Boolean] True, if the bot must be a member of the chat; for basic group and supergroup chats + # only. + # @attr request_title [Boolean] Pass true to request title of the chat; bots only. + # @attr request_username [Boolean] Pass true to request username of the chat; bots only. + # @attr request_photo [Boolean] Pass true to request photo of the chat; bots only. + class KeyboardButtonType::RequestChat < KeyboardButtonType + attribute :id, TD::Types::Coercible::Integer + attribute :chat_is_channel, TD::Types::Bool + attribute :restrict_chat_is_forum, TD::Types::Bool + attribute :chat_is_forum, TD::Types::Bool + attribute :restrict_chat_has_username, TD::Types::Bool + attribute :chat_has_username, TD::Types::Bool + attribute :chat_is_created, TD::Types::Bool + attribute :user_administrator_rights, TD::Types::ChatAdministratorRights.optional.default(nil) + attribute :bot_administrator_rights, TD::Types::ChatAdministratorRights.optional.default(nil) + attribute :bot_is_member, TD::Types::Bool + attribute :request_title, TD::Types::Bool + attribute :request_username, TD::Types::Bool + attribute :request_photo, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/keyboard_button_type/request_users.rb b/lib/tdlib/types/keyboard_button_type/request_users.rb new file mode 100644 index 00000000..079a99d2 --- /dev/null +++ b/lib/tdlib/types/keyboard_button_type/request_users.rb @@ -0,0 +1,28 @@ +module TD::Types + # A button that requests users to be shared by the current user; available only in private chats. + # Use the method shareUsersWithBot to complete the request. + # + # @attr id [Integer] Unique button identifier. + # @attr restrict_user_is_bot [Boolean] True, if the shared users must or must not be bots. + # @attr user_is_bot [Boolean] True, if the shared users must be bots; otherwise, the shared users must not be bots. + # Ignored if restrict_user_is_bot is false. + # @attr restrict_user_is_premium [Boolean] True, if the shared users must or must not be Telegram Premium users. + # @attr user_is_premium [Boolean] True, if the shared users must be Telegram Premium users; otherwise, the shared + # users must not be Telegram Premium users. + # Ignored if restrict_user_is_premium is false. + # @attr max_quantity [Integer] The maximum number of users to share. + # @attr request_name [Boolean] Pass true to request name of the users; bots only. + # @attr request_username [Boolean] Pass true to request username of the users; bots only. + # @attr request_photo [Boolean] Pass true to request photo of the users; bots only. + class KeyboardButtonType::RequestUsers < KeyboardButtonType + attribute :id, TD::Types::Coercible::Integer + attribute :restrict_user_is_bot, TD::Types::Bool + attribute :user_is_bot, TD::Types::Bool + attribute :restrict_user_is_premium, TD::Types::Bool + attribute :user_is_premium, TD::Types::Bool + attribute :max_quantity, TD::Types::Coercible::Integer + attribute :request_name, TD::Types::Bool + attribute :request_username, TD::Types::Bool + attribute :request_photo, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/keyboard_button_type/text.rb b/lib/tdlib/types/keyboard_button_type/text.rb index d1a172f1..107f30b2 100644 --- a/lib/tdlib/types/keyboard_button_type/text.rb +++ b/lib/tdlib/types/keyboard_button_type/text.rb @@ -1,5 +1,5 @@ module TD::Types - # A simple button, with text that should be sent when the button is pressed. + # A simple button, with text that must be sent when the button is pressed. class KeyboardButtonType::Text < KeyboardButtonType end end diff --git a/lib/tdlib/types/keyboard_button_type/web_app.rb b/lib/tdlib/types/keyboard_button_type/web_app.rb new file mode 100644 index 00000000..04b1e5ec --- /dev/null +++ b/lib/tdlib/types/keyboard_button_type/web_app.rb @@ -0,0 +1,8 @@ +module TD::Types + # A button that opens a Web App by calling getWebAppUrl. + # + # @attr url [TD::Types::String] An HTTP URL to pass to getWebAppUrl. + class KeyboardButtonType::WebApp < KeyboardButtonType + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/language_pack_info.rb b/lib/tdlib/types/language_pack_info.rb index d70ac122..918b0bc7 100644 --- a/lib/tdlib/types/language_pack_info.rb +++ b/lib/tdlib/types/language_pack_info.rb @@ -3,12 +3,12 @@ module TD::Types # # @attr id [TD::Types::String] Unique language pack identifier. # @attr base_language_pack_id [TD::Types::String, nil] Identifier of a base language pack; may be empty. - # If a string is missed in the language pack, then it should be fetched from base language pack. + # If a string is missed in the language pack, then it must be fetched from base language pack. # Unsupported in custom language packs. # @attr name [TD::Types::String] Language name. # @attr native_name [TD::Types::String] Name of the language in that language. # @attr plural_code [TD::Types::String] A language code to be used to apply plural forms. - # See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info. + # See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information. # @attr is_official [Boolean] True, if the language pack is official. # @attr is_rtl [Boolean] True, if the language pack strings are RTL. # @attr is_beta [Boolean] True, if the language pack is a beta language pack. diff --git a/lib/tdlib/types/language_pack_string.rb b/lib/tdlib/types/language_pack_string.rb index 99873444..cf5f9dff 100644 --- a/lib/tdlib/types/language_pack_string.rb +++ b/lib/tdlib/types/language_pack_string.rb @@ -2,7 +2,8 @@ module TD::Types # Represents one language pack string. # # @attr key [TD::Types::String] String key. - # @attr value [TD::Types::LanguagePackStringValue] String value. + # @attr value [TD::Types::LanguagePackStringValue] String value; pass null if the string needs to be taken from the + # built-in English language pack. class LanguagePackString < Base attribute :key, TD::Types::String attribute :value, TD::Types::LanguagePackStringValue diff --git a/lib/tdlib/types/language_pack_string_value/deleted.rb b/lib/tdlib/types/language_pack_string_value/deleted.rb index 99a05ea0..6ce65cb0 100644 --- a/lib/tdlib/types/language_pack_string_value/deleted.rb +++ b/lib/tdlib/types/language_pack_string_value/deleted.rb @@ -1,5 +1,5 @@ module TD::Types - # A deleted language pack string, the value should be taken from the built-in english language pack. + # A deleted language pack string, the value must be taken from the built-in English language pack. class LanguagePackStringValue::Deleted < LanguagePackStringValue end end diff --git a/lib/tdlib/types/language_pack_string_value/pluralized.rb b/lib/tdlib/types/language_pack_string_value/pluralized.rb index 71e0ac62..40f8d22f 100644 --- a/lib/tdlib/types/language_pack_string_value/pluralized.rb +++ b/lib/tdlib/types/language_pack_string_value/pluralized.rb @@ -1,6 +1,6 @@ module TD::Types # A language pack string which has different forms based on the number of some object it mentions. - # See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more info. + # See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information. # # @attr zero_value [TD::Types::String] Value for zero objects. # @attr one_value [TD::Types::String] Value for one object. diff --git a/lib/tdlib/types/link_preview.rb b/lib/tdlib/types/link_preview.rb new file mode 100644 index 00000000..a19a9392 --- /dev/null +++ b/lib/tdlib/types/link_preview.rb @@ -0,0 +1,35 @@ +module TD::Types + # Describes a link preview. + # + # @attr url [TD::Types::String] Original URL of the link. + # @attr display_url [TD::Types::String] URL to display. + # @attr site_name [TD::Types::String] Short name of the site (e.g., Google Docs, App Store). + # @attr title [TD::Types::String] Title of the content. + # @attr description [TD::Types::FormattedText] Description of the content. + # @attr type [TD::Types::LinkPreviewType] Type of the link preview. + # @attr has_large_media [Boolean] True, if size of media in the preview can be changed. + # @attr show_large_media [Boolean] True, if large media preview must be shown; otherwise, the media preview must be + # shown small and only the first frame must be shown for videos. + # @attr show_media_above_description [Boolean] True, if media must be shown above link preview description; + # otherwise, the media must be shown below the description. + # @attr skip_confirmation [Boolean] True, if there is no need to show an ordinary open URL confirmation, when opening + # the URL from the preview, because the URL is shown in the message text in clear. + # @attr show_above_text [Boolean] True, if the link preview must be shown above message text; otherwise, the link + # preview must be shown below the message text. + # @attr instant_view_version [Integer] Version of instant view (currently, can be 1 or 2) for the web page; 0 if + # none. + class LinkPreview < Base + attribute :url, TD::Types::String + attribute :display_url, TD::Types::String + attribute :site_name, TD::Types::String + attribute :title, TD::Types::String + attribute :description, TD::Types::FormattedText + attribute :type, TD::Types::LinkPreviewType + attribute :has_large_media, TD::Types::Bool + attribute :show_large_media, TD::Types::Bool + attribute :show_media_above_description, TD::Types::Bool + attribute :skip_confirmation, TD::Types::Bool + attribute :show_above_text, TD::Types::Bool + attribute :instant_view_version, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/link_preview_album_media.rb b/lib/tdlib/types/link_preview_album_media.rb new file mode 100644 index 00000000..712324ae --- /dev/null +++ b/lib/tdlib/types/link_preview_album_media.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes a media from a link preview album. + class LinkPreviewAlbumMedia < Base + %w[ + photo + video + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/link_preview_album_media/#{type}" + end + end +end diff --git a/lib/tdlib/types/link_preview_album_media/photo.rb b/lib/tdlib/types/link_preview_album_media/photo.rb new file mode 100644 index 00000000..4d83b9d6 --- /dev/null +++ b/lib/tdlib/types/link_preview_album_media/photo.rb @@ -0,0 +1,8 @@ +module TD::Types + # The media is a photo. + # + # @attr photo [TD::Types::Photo] Photo description. + class LinkPreviewAlbumMedia::Photo < LinkPreviewAlbumMedia + attribute :photo, TD::Types::Photo + end +end diff --git a/lib/tdlib/types/link_preview_album_media/video.rb b/lib/tdlib/types/link_preview_album_media/video.rb new file mode 100644 index 00000000..794b1558 --- /dev/null +++ b/lib/tdlib/types/link_preview_album_media/video.rb @@ -0,0 +1,8 @@ +module TD::Types + # The media is a video. + # + # @attr video [TD::Types::Video] Video description. + class LinkPreviewAlbumMedia::Video < LinkPreviewAlbumMedia + attribute :video, TD::Types::Video + end +end diff --git a/lib/tdlib/types/link_preview_options.rb b/lib/tdlib/types/link_preview_options.rb new file mode 100644 index 00000000..5c202dec --- /dev/null +++ b/lib/tdlib/types/link_preview_options.rb @@ -0,0 +1,20 @@ +module TD::Types + # Options to be used for generation of a link preview. + # + # @attr is_disabled [Boolean] True, if link preview must be disabled. + # @attr url [TD::Types::String] URL to use for link preview. + # If empty, then the first URL found in the message text will be used. + # @attr force_small_media [Boolean] True, if shown media preview must be small; ignored in secret chats or if the URL + # isn't explicitly specified. + # @attr force_large_media [Boolean] True, if shown media preview must be large; ignored in secret chats or if the URL + # isn't explicitly specified. + # @attr show_above_text [Boolean] True, if link preview must be shown above message text; otherwise, the link preview + # will be shown below the message text; ignored in secret chats. + class LinkPreviewOptions < Base + attribute :is_disabled, TD::Types::Bool + attribute :url, TD::Types::String + attribute :force_small_media, TD::Types::Bool + attribute :force_large_media, TD::Types::Bool + attribute :show_above_text, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/link_preview_type.rb b/lib/tdlib/types/link_preview_type.rb new file mode 100644 index 00000000..3f4729fa --- /dev/null +++ b/lib/tdlib/types/link_preview_type.rb @@ -0,0 +1,38 @@ +module TD::Types + # Describes type of link preview. + class LinkPreviewType < Base + %w[ + album + animation + app + article + audio + background + channel_boost + chat + document + embedded_animation_player + embedded_audio_player + embedded_video_player + invoice + message + photo + premium_gift_code + shareable_chat_folder + sticker + sticker_set + story + supergroup_boost + theme + unsupported + user + video + video_chat + video_note + voice_note + web_app + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/link_preview_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/link_preview_type/album.rb b/lib/tdlib/types/link_preview_type/album.rb new file mode 100644 index 00000000..702c0cbd --- /dev/null +++ b/lib/tdlib/types/link_preview_type/album.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a media album consisting of photos and videos. + # + # @attr media [Array] The list of album media. + # @attr caption [TD::Types::String] Album caption. + class LinkPreviewType::Album < LinkPreviewType + attribute :media, TD::Types::Array.of(TD::Types::LinkPreviewAlbumMedia) + attribute :caption, TD::Types::String + end +end diff --git a/lib/tdlib/types/link_preview_type/animation.rb b/lib/tdlib/types/link_preview_type/animation.rb new file mode 100644 index 00000000..4a5481d6 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/animation.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to an animation. + # + # @attr animation [TD::Types::Animation] The animation. + # @attr author [TD::Types::String] Author of the animation. + class LinkPreviewType::Animation < LinkPreviewType + attribute :animation, TD::Types::Animation + attribute :author, TD::Types::String + end +end diff --git a/lib/tdlib/types/link_preview_type/app.rb b/lib/tdlib/types/link_preview_type/app.rb new file mode 100644 index 00000000..16c25a14 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/app.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to an app at App Store or Google Play. + # + # @attr photo [TD::Types::Photo] Photo for the app. + # @attr author [TD::Types::String] Author of the app. + class LinkPreviewType::App < LinkPreviewType + attribute :photo, TD::Types::Photo + attribute :author, TD::Types::String + end +end diff --git a/lib/tdlib/types/link_preview_type/article.rb b/lib/tdlib/types/link_preview_type/article.rb new file mode 100644 index 00000000..31066e9b --- /dev/null +++ b/lib/tdlib/types/link_preview_type/article.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a web site. + # + # @attr photo [TD::Types::Photo, nil] Article's main photo; may be null. + # @attr author [TD::Types::String] Author of the article. + class LinkPreviewType::Article < LinkPreviewType + attribute :photo, TD::Types::Photo.optional.default(nil) + attribute :author, TD::Types::String + end +end diff --git a/lib/tdlib/types/link_preview_type/audio.rb b/lib/tdlib/types/link_preview_type/audio.rb new file mode 100644 index 00000000..f00fd7a8 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/audio.rb @@ -0,0 +1,16 @@ +module TD::Types + # The link is a link to an audio. + # + # @attr url [TD::Types::String, nil] URL of the audio; may be empty if none. + # @attr mime_type [TD::Types::String] MIME type of the audio file. + # @attr audio [TD::Types::Audio, nil] The audio description; may be null if unknown. + # @attr duration [Integer] Duration of the audio, in seconds; 0 if unknown. + # @attr author [TD::Types::String] Author of the audio. + class LinkPreviewType::Audio < LinkPreviewType + attribute :url, TD::Types::String.optional.default(nil) + attribute :mime_type, TD::Types::String + attribute :audio, TD::Types::Audio.optional.default(nil) + attribute :duration, TD::Types::Coercible::Integer + attribute :author, TD::Types::String + end +end diff --git a/lib/tdlib/types/link_preview_type/background.rb b/lib/tdlib/types/link_preview_type/background.rb new file mode 100644 index 00000000..1bd672a5 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/background.rb @@ -0,0 +1,11 @@ +module TD::Types + # The link is a link to a background. + # Link preview title and description are available only for filled backgrounds. + # + # @attr document [TD::Types::Document, nil] Document with the background; may be null for filled backgrounds. + # @attr background_type [TD::Types::BackgroundType, nil] Type of the background; may be null if unknown. + class LinkPreviewType::Background < LinkPreviewType + attribute :document, TD::Types::Document.optional.default(nil) + attribute :background_type, TD::Types::BackgroundType.optional.default(nil) + end +end diff --git a/lib/tdlib/types/link_preview_type/channel_boost.rb b/lib/tdlib/types/link_preview_type/channel_boost.rb new file mode 100644 index 00000000..cdc6aa5a --- /dev/null +++ b/lib/tdlib/types/link_preview_type/channel_boost.rb @@ -0,0 +1,8 @@ +module TD::Types + # The link is a link to boost a channel chat. + # + # @attr photo [TD::Types::ChatPhoto, nil] Photo of the chat; may be null. + class LinkPreviewType::ChannelBoost < LinkPreviewType + attribute :photo, TD::Types::ChatPhoto.optional.default(nil) + end +end diff --git a/lib/tdlib/types/link_preview_type/chat.rb b/lib/tdlib/types/link_preview_type/chat.rb new file mode 100644 index 00000000..12843064 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/chat.rb @@ -0,0 +1,12 @@ +module TD::Types + # The link is a link to a chat. + # + # @attr type [TD::Types::InviteLinkChatType] Type of the chat. + # @attr photo [TD::Types::ChatPhoto, nil] Photo of the chat; may be null. + # @attr creates_join_request [Boolean] True, if the link only creates join request. + class LinkPreviewType::Chat < LinkPreviewType + attribute :type, TD::Types::InviteLinkChatType + attribute :photo, TD::Types::ChatPhoto.optional.default(nil) + attribute :creates_join_request, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/link_preview_type/document.rb b/lib/tdlib/types/link_preview_type/document.rb new file mode 100644 index 00000000..bdc8fd17 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/document.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a general file. + # + # @attr document [TD::Types::Document] The document description. + # @attr author [TD::Types::String] Author of the document. + class LinkPreviewType::Document < LinkPreviewType + attribute :document, TD::Types::Document + attribute :author, TD::Types::String + end +end diff --git a/lib/tdlib/types/link_preview_type/embedded_animation_player.rb b/lib/tdlib/types/link_preview_type/embedded_animation_player.rb new file mode 100644 index 00000000..64192775 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/embedded_animation_player.rb @@ -0,0 +1,18 @@ +module TD::Types + # The link is a link to an animation player. + # + # @attr url [TD::Types::String] URL of the external animation player. + # @attr thumbnail [TD::Types::Photo, nil] Thumbnail of the animation; may be null if unknown. + # @attr duration [Integer] Duration of the animation, in seconds. + # @attr author [TD::Types::String] Author of the animation. + # @attr width [Integer] Expected width of the embedded player. + # @attr height [Integer] Expected height of the embedded player. + class LinkPreviewType::EmbeddedAnimationPlayer < LinkPreviewType + attribute :url, TD::Types::String + attribute :thumbnail, TD::Types::Photo.optional.default(nil) + attribute :duration, TD::Types::Coercible::Integer + attribute :author, TD::Types::String + attribute :width, TD::Types::Coercible::Integer + attribute :height, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/link_preview_type/embedded_audio_player.rb b/lib/tdlib/types/link_preview_type/embedded_audio_player.rb new file mode 100644 index 00000000..4a4772ad --- /dev/null +++ b/lib/tdlib/types/link_preview_type/embedded_audio_player.rb @@ -0,0 +1,18 @@ +module TD::Types + # The link is a link to an audio player. + # + # @attr url [TD::Types::String] URL of the external audio player. + # @attr thumbnail [TD::Types::Photo, nil] Thumbnail of the audio; may be null if unknown. + # @attr duration [Integer] Duration of the audio, in seconds. + # @attr author [TD::Types::String] Author of the audio. + # @attr width [Integer] Expected width of the embedded player. + # @attr height [Integer] Expected height of the embedded player. + class LinkPreviewType::EmbeddedAudioPlayer < LinkPreviewType + attribute :url, TD::Types::String + attribute :thumbnail, TD::Types::Photo.optional.default(nil) + attribute :duration, TD::Types::Coercible::Integer + attribute :author, TD::Types::String + attribute :width, TD::Types::Coercible::Integer + attribute :height, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/link_preview_type/embedded_video_player.rb b/lib/tdlib/types/link_preview_type/embedded_video_player.rb new file mode 100644 index 00000000..e04a5e36 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/embedded_video_player.rb @@ -0,0 +1,18 @@ +module TD::Types + # The link is a link to a video player. + # + # @attr url [TD::Types::String] URL of the external video player. + # @attr thumbnail [TD::Types::Photo, nil] Thumbnail of the video; may be null if unknown. + # @attr duration [Integer] Duration of the video, in seconds. + # @attr author [TD::Types::String] Author of the video. + # @attr width [Integer] Expected width of the embedded player. + # @attr height [Integer] Expected height of the embedded player. + class LinkPreviewType::EmbeddedVideoPlayer < LinkPreviewType + attribute :url, TD::Types::String + attribute :thumbnail, TD::Types::Photo.optional.default(nil) + attribute :duration, TD::Types::Coercible::Integer + attribute :author, TD::Types::String + attribute :width, TD::Types::Coercible::Integer + attribute :height, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/link_preview_type/invoice.rb b/lib/tdlib/types/link_preview_type/invoice.rb new file mode 100644 index 00000000..4ebc9d42 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/invoice.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to an invoice. + class LinkPreviewType::Invoice < LinkPreviewType + end +end diff --git a/lib/tdlib/types/link_preview_type/message.rb b/lib/tdlib/types/link_preview_type/message.rb new file mode 100644 index 00000000..0d42d8d9 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/message.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to a text or a poll Telegram message. + class LinkPreviewType::Message < LinkPreviewType + end +end diff --git a/lib/tdlib/types/link_preview_type/photo.rb b/lib/tdlib/types/link_preview_type/photo.rb new file mode 100644 index 00000000..c5a296b0 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/photo.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a photo. + # + # @attr photo [TD::Types::Photo] The photo. + # @attr author [TD::Types::String] Author of the photo. + class LinkPreviewType::Photo < LinkPreviewType + attribute :photo, TD::Types::Photo + attribute :author, TD::Types::String + end +end diff --git a/lib/tdlib/types/link_preview_type/premium_gift_code.rb b/lib/tdlib/types/link_preview_type/premium_gift_code.rb new file mode 100644 index 00000000..81d10605 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/premium_gift_code.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to a Telegram Premium gift code. + class LinkPreviewType::PremiumGiftCode < LinkPreviewType + end +end diff --git a/lib/tdlib/types/link_preview_type/shareable_chat_folder.rb b/lib/tdlib/types/link_preview_type/shareable_chat_folder.rb new file mode 100644 index 00000000..f4f5aee9 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/shareable_chat_folder.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link is a link to a shareable chat folder. + class LinkPreviewType::ShareableChatFolder < LinkPreviewType + end +end diff --git a/lib/tdlib/types/link_preview_type/sticker.rb b/lib/tdlib/types/link_preview_type/sticker.rb new file mode 100644 index 00000000..a3880409 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/sticker.rb @@ -0,0 +1,9 @@ +module TD::Types + # The link is a link to a sticker. + # + # @attr sticker [TD::Types::Sticker] The sticker. + # It can be an arbitrary WEBP image and can have dimensions bigger than 512. + class LinkPreviewType::Sticker < LinkPreviewType + attribute :sticker, TD::Types::Sticker + end +end diff --git a/lib/tdlib/types/link_preview_type/sticker_set.rb b/lib/tdlib/types/link_preview_type/sticker_set.rb new file mode 100644 index 00000000..a9fbb2e2 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/sticker_set.rb @@ -0,0 +1,8 @@ +module TD::Types + # The link is a link to a sticker set. + # + # @attr stickers [Array] Up to 4 stickers from the sticker set. + class LinkPreviewType::StickerSet < LinkPreviewType + attribute :stickers, TD::Types::Array.of(TD::Types::Sticker) + end +end diff --git a/lib/tdlib/types/link_preview_type/story.rb b/lib/tdlib/types/link_preview_type/story.rb new file mode 100644 index 00000000..7394cbca --- /dev/null +++ b/lib/tdlib/types/link_preview_type/story.rb @@ -0,0 +1,11 @@ +module TD::Types + # The link is a link to a story. + # Link preview description is unavailable. + # + # @attr story_sender_chat_id [Integer] The identifier of the chat that posted the story. + # @attr story_id [Integer] Story identifier. + class LinkPreviewType::Story < LinkPreviewType + attribute :story_sender_chat_id, TD::Types::Coercible::Integer + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/link_preview_type/supergroup_boost.rb b/lib/tdlib/types/link_preview_type/supergroup_boost.rb new file mode 100644 index 00000000..012b722f --- /dev/null +++ b/lib/tdlib/types/link_preview_type/supergroup_boost.rb @@ -0,0 +1,8 @@ +module TD::Types + # The link is a link to boost a supergroup chat. + # + # @attr photo [TD::Types::ChatPhoto, nil] Photo of the chat; may be null. + class LinkPreviewType::SupergroupBoost < LinkPreviewType + attribute :photo, TD::Types::ChatPhoto.optional.default(nil) + end +end diff --git a/lib/tdlib/types/link_preview_type/theme.rb b/lib/tdlib/types/link_preview_type/theme.rb new file mode 100644 index 00000000..1c222cff --- /dev/null +++ b/lib/tdlib/types/link_preview_type/theme.rb @@ -0,0 +1,11 @@ +module TD::Types + # The link is a link to a cloud theme. + # TDLib has no theme support yet. + # + # @attr documents [Array] The list of files with theme description. + # @attr settings [TD::Types::ThemeSettings] Settings for the cloud theme. + class LinkPreviewType::Theme < LinkPreviewType + attribute :documents, TD::Types::Array.of(TD::Types::Document) + attribute :settings, TD::Types::ThemeSettings + end +end diff --git a/lib/tdlib/types/link_preview_type/unsupported.rb b/lib/tdlib/types/link_preview_type/unsupported.rb new file mode 100644 index 00000000..a7e75a05 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/unsupported.rb @@ -0,0 +1,5 @@ +module TD::Types + # The link preview type is unsupported yet. + class LinkPreviewType::Unsupported < LinkPreviewType + end +end diff --git a/lib/tdlib/types/link_preview_type/user.rb b/lib/tdlib/types/link_preview_type/user.rb new file mode 100644 index 00000000..40904729 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/user.rb @@ -0,0 +1,10 @@ +module TD::Types + # The link is a link to a user. + # + # @attr photo [TD::Types::ChatPhoto, nil] Photo of the user; may be null if none. + # @attr is_bot [Boolean] True, if the user is a bot. + class LinkPreviewType::User < LinkPreviewType + attribute :photo, TD::Types::ChatPhoto.optional.default(nil) + attribute :is_bot, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/link_preview_type/video.rb b/lib/tdlib/types/link_preview_type/video.rb new file mode 100644 index 00000000..a6a5444f --- /dev/null +++ b/lib/tdlib/types/link_preview_type/video.rb @@ -0,0 +1,20 @@ +module TD::Types + # The link is a link to a video. + # + # @attr url [TD::Types::String, nil] URL of the video; may be empty if none. + # @attr mime_type [TD::Types::String] MIME type of the video file. + # @attr video [TD::Types::Video, nil] The video description; may be null if unknown. + # @attr width [Integer] Expected width of the preview. + # @attr height [Integer] Expected height of the preview. + # @attr duration [Integer] Duration of the video, in seconds; 0 if unknown. + # @attr author [TD::Types::String] Author of the video. + class LinkPreviewType::Video < LinkPreviewType + attribute :url, TD::Types::String.optional.default(nil) + attribute :mime_type, TD::Types::String + attribute :video, TD::Types::Video.optional.default(nil) + attribute :width, TD::Types::Coercible::Integer + attribute :height, TD::Types::Coercible::Integer + attribute :duration, TD::Types::Coercible::Integer + attribute :author, TD::Types::String + end +end diff --git a/lib/tdlib/types/link_preview_type/video_chat.rb b/lib/tdlib/types/link_preview_type/video_chat.rb new file mode 100644 index 00000000..46ec34d1 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/video_chat.rb @@ -0,0 +1,11 @@ +module TD::Types + # The link is a link to a video chat. + # + # @attr photo [TD::Types::ChatPhoto, nil] Photo of the chat with the video chat; may be null if none. + # @attr is_live_stream [Boolean] True, if the video chat is expected to be a live stream in a channel or a broadcast + # group. + class LinkPreviewType::VideoChat < LinkPreviewType + attribute :photo, TD::Types::ChatPhoto.optional.default(nil) + attribute :is_live_stream, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/link_preview_type/video_note.rb b/lib/tdlib/types/link_preview_type/video_note.rb new file mode 100644 index 00000000..46954826 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/video_note.rb @@ -0,0 +1,8 @@ +module TD::Types + # The link is a link to a video note message. + # + # @attr video_note [TD::Types::VideoNote] The video note. + class LinkPreviewType::VideoNote < LinkPreviewType + attribute :video_note, TD::Types::VideoNote + end +end diff --git a/lib/tdlib/types/link_preview_type/voice_note.rb b/lib/tdlib/types/link_preview_type/voice_note.rb new file mode 100644 index 00000000..0f672ba7 --- /dev/null +++ b/lib/tdlib/types/link_preview_type/voice_note.rb @@ -0,0 +1,8 @@ +module TD::Types + # The link is a link to a voice note message. + # + # @attr voice_note [TD::Types::VoiceNote] The voice note. + class LinkPreviewType::VoiceNote < LinkPreviewType + attribute :voice_note, TD::Types::VoiceNote + end +end diff --git a/lib/tdlib/types/link_preview_type/web_app.rb b/lib/tdlib/types/link_preview_type/web_app.rb new file mode 100644 index 00000000..40eded2d --- /dev/null +++ b/lib/tdlib/types/link_preview_type/web_app.rb @@ -0,0 +1,8 @@ +module TD::Types + # The link is a link to a Web App. + # + # @attr photo [TD::Types::Photo] Web App photo. + class LinkPreviewType::WebApp < LinkPreviewType + attribute :photo, TD::Types::Photo + end +end diff --git a/lib/tdlib/types/local_file.rb b/lib/tdlib/types/local_file.rb index 3ccddf4c..262d8da9 100644 --- a/lib/tdlib/types/local_file.rb +++ b/lib/tdlib/types/local_file.rb @@ -2,7 +2,7 @@ module TD::Types # Represents a local file. # # @attr path [TD::Types::String, nil] Local path to the locally available file part; may be empty. - # @attr can_be_downloaded [Boolean] True, if it is possible to try to download or generate the file. + # @attr can_be_downloaded [Boolean] True, if it is possible to download or generate the file. # @attr can_be_deleted [Boolean] True, if the file can be deleted. # @attr is_downloading_active [Boolean] True, if the file is currently being downloaded (or a local copy is being # generated by some other means). @@ -11,9 +11,9 @@ module TD::Types # downloaded_prefix_size is calculated from this offset. # @attr downloaded_prefix_size [Integer] If is_downloading_completed is false, then only some prefix of the file # starting from download_offset is ready to be read. - # downloaded_prefix_size is the size of that prefix. - # @attr downloaded_size [Integer] Total downloaded file bytes. - # Should be used only for calculating download progress. + # downloaded_prefix_size is the size of that prefix in bytes. + # @attr downloaded_size [Integer] Total downloaded file size, in bytes. + # Can be used only for calculating download progress. # The actual file size may be bigger, and some parts of it may contain garbage. class LocalFile < Base attribute :path, TD::Types::String.optional.default(nil) diff --git a/lib/tdlib/types/location_address.rb b/lib/tdlib/types/location_address.rb new file mode 100644 index 00000000..6aa321e0 --- /dev/null +++ b/lib/tdlib/types/location_address.rb @@ -0,0 +1,14 @@ +module TD::Types + # Describes an address of a location. + # + # @attr country_code [TD::Types::String] A two-letter ISO 3166-1 alpha-2 country code. + # @attr state [TD::Types::String] State, if applicable; empty if unknown. + # @attr city [TD::Types::String] City; empty if unknown. + # @attr street [TD::Types::String] The address; empty if unknown. + class LocationAddress < Base + attribute :country_code, TD::Types::String + attribute :state, TD::Types::String + attribute :city, TD::Types::String + attribute :street, TD::Types::String + end +end diff --git a/lib/tdlib/types/log_stream/file.rb b/lib/tdlib/types/log_stream/file.rb index e819a2d2..e3130e2e 100644 --- a/lib/tdlib/types/log_stream/file.rb +++ b/lib/tdlib/types/log_stream/file.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr path [TD::Types::String] Path to the file to where the internal TDLib log will be written. # @attr max_file_size [Integer] The maximum size of the file to where the internal TDLib log is written before the - # file will be auto-rotated. + # file will automatically be rotated, in bytes. # @attr redirect_stderr [Boolean] Pass true to additionally redirect stderr to the log file. # Ignored on Windows. class LogStream::File < LogStream diff --git a/lib/tdlib/types/login_url_info/open.rb b/lib/tdlib/types/login_url_info/open.rb index fabdaaf0..cb13a128 100644 --- a/lib/tdlib/types/login_url_info/open.rb +++ b/lib/tdlib/types/login_url_info/open.rb @@ -1,10 +1,10 @@ module TD::Types - # An HTTP url needs to be open. + # An HTTP URL needs to be open. # # @attr url [TD::Types::String] The URL to open. - # @attr skip_confirm [Boolean] True, if there is no need to show an ordinary open URL confirm. + # @attr skip_confirmation [Boolean] True, if there is no need to show an ordinary open URL confirmation. class LoginUrlInfo::Open < LoginUrlInfo attribute :url, TD::Types::String - attribute :skip_confirm, TD::Types::Bool + attribute :skip_confirmation, TD::Types::Bool end end diff --git a/lib/tdlib/types/login_url_info/request_confirmation.rb b/lib/tdlib/types/login_url_info/request_confirmation.rb index 1041d5ed..d597046d 100644 --- a/lib/tdlib/types/login_url_info/request_confirmation.rb +++ b/lib/tdlib/types/login_url_info/request_confirmation.rb @@ -4,8 +4,8 @@ module TD::Types # @attr url [TD::Types::String] An HTTP URL to be opened. # @attr domain [TD::Types::String] A domain of the URL. # @attr bot_user_id [Integer] User identifier of a bot linked with the website. - # @attr request_write_access [Boolean] True, if the user needs to be requested to give the permission to the bot to - # send them messages. + # @attr request_write_access [Boolean] True, if the user must be asked for the permission to the bot to send them + # messages. class LoginUrlInfo::RequestConfirmation < LoginUrlInfo attribute :url, TD::Types::String attribute :domain, TD::Types::String diff --git a/lib/tdlib/types/main_web_app.rb b/lib/tdlib/types/main_web_app.rb new file mode 100644 index 00000000..3f87ce99 --- /dev/null +++ b/lib/tdlib/types/main_web_app.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains information about the main Web App of a bot. + # + # @attr url [TD::Types::String] URL of the Web App to open. + # @attr is_compact [Boolean] True, if the Web App must always be opened in the compact mode instead of the full-size + # mode. + class MainWebApp < Base + attribute :url, TD::Types::String + attribute :is_compact, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/mask_point.rb b/lib/tdlib/types/mask_point.rb index dc41f195..8fc74ac9 100644 --- a/lib/tdlib/types/mask_point.rb +++ b/lib/tdlib/types/mask_point.rb @@ -1,5 +1,5 @@ module TD::Types - # Part of the face, relative to which a mask should be placed. + # Part of the face, relative to which a mask is placed. class MaskPoint < Base %w[ forehead diff --git a/lib/tdlib/types/mask_point/chin.rb b/lib/tdlib/types/mask_point/chin.rb index b9174d76..e272b9ad 100644 --- a/lib/tdlib/types/mask_point/chin.rb +++ b/lib/tdlib/types/mask_point/chin.rb @@ -1,5 +1,5 @@ module TD::Types - # A mask should be placed relatively to the chin. + # The mask is placed relatively to the chin. class MaskPoint::Chin < MaskPoint end end diff --git a/lib/tdlib/types/mask_point/eyes.rb b/lib/tdlib/types/mask_point/eyes.rb index 90bb21e3..26edf353 100644 --- a/lib/tdlib/types/mask_point/eyes.rb +++ b/lib/tdlib/types/mask_point/eyes.rb @@ -1,5 +1,5 @@ module TD::Types - # A mask should be placed relatively to the eyes. + # The mask is placed relatively to the eyes. class MaskPoint::Eyes < MaskPoint end end diff --git a/lib/tdlib/types/mask_point/forehead.rb b/lib/tdlib/types/mask_point/forehead.rb index 611a1ba7..05f46781 100644 --- a/lib/tdlib/types/mask_point/forehead.rb +++ b/lib/tdlib/types/mask_point/forehead.rb @@ -1,5 +1,5 @@ module TD::Types - # A mask should be placed relatively to the forehead. + # The mask is placed relatively to the forehead. class MaskPoint::Forehead < MaskPoint end end diff --git a/lib/tdlib/types/mask_point/mouth.rb b/lib/tdlib/types/mask_point/mouth.rb index 7f9676d4..d6889511 100644 --- a/lib/tdlib/types/mask_point/mouth.rb +++ b/lib/tdlib/types/mask_point/mouth.rb @@ -1,5 +1,5 @@ module TD::Types - # A mask should be placed relatively to the mouth. + # The mask is placed relatively to the mouth. class MaskPoint::Mouth < MaskPoint end end diff --git a/lib/tdlib/types/mask_position.rb b/lib/tdlib/types/mask_position.rb index 44df2119..ac69daa9 100644 --- a/lib/tdlib/types/mask_position.rb +++ b/lib/tdlib/types/mask_position.rb @@ -1,7 +1,7 @@ module TD::Types - # Position on a photo where a mask should be placed. + # Position on a photo where a mask is placed. # - # @attr point [TD::Types::MaskPoint] Part of the face, relative to which the mask should be placed. + # @attr point [TD::Types::MaskPoint] Part of the face, relative to which the mask is placed. # @attr x_shift [Float] Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. # (For example, -1.0 will place the mask just to the left of the default mask position). # @attr y_shift [Float] Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. diff --git a/lib/tdlib/types/message.rb b/lib/tdlib/types/message.rb index 44a0a8e3..f58fb63d 100644 --- a/lib/tdlib/types/message.rb +++ b/lib/tdlib/types/message.rb @@ -2,77 +2,97 @@ module TD::Types # Describes a message. # # @attr id [Integer] Message identifier; unique for the chat to which the message belongs. - # @attr sender [TD::Types::MessageSender] The sender of the message. + # @attr sender_id [TD::Types::MessageSender] Identifier of the sender of the message. # @attr chat_id [Integer] Chat identifier. - # @attr sending_state [TD::Types::MessageSendingState, nil] Information about the sending state of the message; may - # be null. - # @attr scheduling_state [TD::Types::MessageSchedulingState, nil] Information about the scheduling state of the - # message; may be null. + # @attr sending_state [TD::Types::MessageSendingState, nil] The sending state of the message; may be null if the + # message isn't being sent and didn't fail to be sent. + # @attr scheduling_state [TD::Types::MessageSchedulingState, nil] The scheduling state of the message; may be null if + # the message isn't scheduled. # @attr is_outgoing [Boolean] True, if the message is outgoing. # @attr is_pinned [Boolean] True, if the message is pinned. - # @attr can_be_edited [Boolean] True, if the message can be edited. - # For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used - # with this message by the application. - # @attr can_be_forwarded [Boolean] True, if the message can be forwarded. - # @attr can_be_deleted_only_for_self [Boolean] True, if the message can be deleted only for the current user while - # other users will continue to see it. - # @attr can_be_deleted_for_all_users [Boolean] True, if the message can be deleted for all users. - # @attr can_get_statistics [Boolean] True, if the message statistics are available. - # @attr can_get_message_thread [Boolean] True, if the message thread info is available. + # @attr is_from_offline [Boolean] True, if the message was sent because of a scheduled action by the message sender, + # for example, as away, or greeting service message. + # @attr can_be_saved [Boolean] True, if content of the message can be saved locally or copied. + # @attr has_timestamped_media [Boolean] True, if media timestamp entities refers to a media in this message as + # opposed to a media in the replied message. # @attr is_channel_post [Boolean] True, if the message is a channel post. # All messages to channels are channel posts, all other messages are not channel posts. + # @attr is_topic_message [Boolean] True, if the message is a forum topic message. # @attr contains_unread_mention [Boolean] True, if the message contains an unread mention for the current user. # @attr date [Integer] Point in time (Unix timestamp) when the message was sent. # @attr edit_date [Integer] Point in time (Unix timestamp) when the message was last edited. - # @attr forward_info [TD::Types::MessageForwardInfo, nil] Information about the initial message sender; may be null. + # @attr forward_info [TD::Types::MessageForwardInfo, nil] Information about the initial message sender; may be null + # if none or unknown. + # @attr import_info [TD::Types::MessageImportInfo, nil] Information about the initial message for messages created + # with importMessages; may be null if the message isn't imported. # @attr interaction_info [TD::Types::MessageInteractionInfo, nil] Information about interactions with the message; - # may be null. - # @attr reply_in_chat_id [Integer] If non-zero, the identifier of the chat to which the replied message belongs; - # Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id. - # @attr reply_to_message_id [Integer] If non-zero, the identifier of the message this message is replying to; can be - # the identifier of a deleted message. + # may be null if none. + # @attr unread_reactions [Array] Information about unread reactions added to the message. + # @attr fact_check [TD::Types::FactCheck, nil] Information about fact-check added to the message; may be null if + # none. + # @attr reply_to [TD::Types::MessageReplyTo, nil] Information about the message or the story this message is replying + # to; may be null if none. # @attr message_thread_id [Integer] If non-zero, the identifier of the message thread the message belongs to; unique # within the chat to which the message belongs. - # @attr ttl [Integer] For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. - # TDLib will send {TD::Types::Update::DeleteMessages} or {TD::Types::Update::MessageContent} once the TTL expires. - # @attr ttl_expires_in [Float] Time left before the message expires, in seconds. - # @attr via_bot_user_id [Integer] If non-zero, the user identifier of the bot through which this message was sent. + # @attr saved_messages_topic_id [Integer] Identifier of the Saved Messages topic for the message; 0 for messages not + # from Saved Messages. + # @attr self_destruct_type [TD::Types::MessageSelfDestructType, nil] The message's self-destruct type; may be null if + # none. + # @attr self_destruct_in [Float] Time left before the message self-destruct timer expires, in seconds; 0 if + # self-destruction isn't scheduled yet. + # @attr auto_delete_in [Float] Time left before the message will be automatically deleted by message_auto_delete_time + # setting of the chat, in seconds; 0 if never. + # @attr via_bot_user_id [Integer] If non-zero, the user identifier of the inline bot through which this message was + # sent. + # @attr sender_business_bot_user_id [Integer] If non-zero, the user identifier of the business bot that sent this + # message. + # @attr sender_boost_count [Integer] Number of times the sender of the message boosted the supergroup at the time the + # message was sent; 0 if none or unknown. + # For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead. # @attr author_signature [TD::Types::String, nil] For channel posts and anonymous group messages, optional author # signature. - # @attr media_album_id [Integer] Unique identifier of an album this message belongs to. + # @attr media_album_id [Integer] Unique identifier of an album this message belongs to; 0 if none. # Only audios, documents, photos and videos can be grouped together in albums. + # @attr effect_id [Integer] Unique identifier of the effect added to the message; 0 if none. + # @attr has_sensitive_content [Boolean] True, if media content of the message must be hidden with 18+ spoiler. # @attr restriction_reason [TD::Types::String] If non-empty, contains a human-readable description of the reason why # access to this message must be restricted. # @attr content [TD::Types::MessageContent] Content of the message. - # @attr reply_markup [TD::Types::ReplyMarkup, nil] Reply markup for the message; may be null. + # @attr reply_markup [TD::Types::ReplyMarkup, nil] Reply markup for the message; may be null if none. class Message < Base attribute :id, TD::Types::Coercible::Integer - attribute :sender, TD::Types::MessageSender + attribute :sender_id, TD::Types::MessageSender attribute :chat_id, TD::Types::Coercible::Integer attribute :sending_state, TD::Types::MessageSendingState.optional.default(nil) attribute :scheduling_state, TD::Types::MessageSchedulingState.optional.default(nil) attribute :is_outgoing, TD::Types::Bool attribute :is_pinned, TD::Types::Bool - attribute :can_be_edited, TD::Types::Bool - attribute :can_be_forwarded, TD::Types::Bool - attribute :can_be_deleted_only_for_self, TD::Types::Bool - attribute :can_be_deleted_for_all_users, TD::Types::Bool - attribute :can_get_statistics, TD::Types::Bool - attribute :can_get_message_thread, TD::Types::Bool + attribute :is_from_offline, TD::Types::Bool + attribute :can_be_saved, TD::Types::Bool + attribute :has_timestamped_media, TD::Types::Bool attribute :is_channel_post, TD::Types::Bool + attribute :is_topic_message, TD::Types::Bool attribute :contains_unread_mention, TD::Types::Bool attribute :date, TD::Types::Coercible::Integer attribute :edit_date, TD::Types::Coercible::Integer attribute :forward_info, TD::Types::MessageForwardInfo.optional.default(nil) + attribute :import_info, TD::Types::MessageImportInfo.optional.default(nil) attribute :interaction_info, TD::Types::MessageInteractionInfo.optional.default(nil) - attribute :reply_in_chat_id, TD::Types::Coercible::Integer - attribute :reply_to_message_id, TD::Types::Coercible::Integer + attribute :unread_reactions, TD::Types::Array.of(TD::Types::UnreadReaction) + attribute :fact_check, TD::Types::FactCheck.optional.default(nil) + attribute :reply_to, TD::Types::MessageReplyTo.optional.default(nil) attribute :message_thread_id, TD::Types::Coercible::Integer - attribute :ttl, TD::Types::Coercible::Integer - attribute :ttl_expires_in, TD::Types::Coercible::Float + attribute :saved_messages_topic_id, TD::Types::Coercible::Integer + attribute :self_destruct_type, TD::Types::MessageSelfDestructType.optional.default(nil) + attribute :self_destruct_in, TD::Types::Coercible::Float + attribute :auto_delete_in, TD::Types::Coercible::Float attribute :via_bot_user_id, TD::Types::Coercible::Integer + attribute :sender_business_bot_user_id, TD::Types::Coercible::Integer + attribute :sender_boost_count, TD::Types::Coercible::Integer attribute :author_signature, TD::Types::String.optional.default(nil) attribute :media_album_id, TD::Types::Coercible::Integer + attribute :effect_id, TD::Types::Coercible::Integer + attribute :has_sensitive_content, TD::Types::Bool attribute :restriction_reason, TD::Types::String attribute :content, TD::Types::MessageContent attribute :reply_markup, TD::Types::ReplyMarkup.optional.default(nil) diff --git a/lib/tdlib/types/message_auto_delete_time.rb b/lib/tdlib/types/message_auto_delete_time.rb new file mode 100644 index 00000000..305efe5c --- /dev/null +++ b/lib/tdlib/types/message_auto_delete_time.rb @@ -0,0 +1,9 @@ +module TD::Types + # Contains default auto-delete timer setting for new chats. + # + # @attr time [Integer] Message auto-delete time, in seconds. + # If 0, then messages aren't deleted automatically. + class MessageAutoDeleteTime < Base + attribute :time, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_calendar.rb b/lib/tdlib/types/message_calendar.rb new file mode 100644 index 00000000..a8e7156f --- /dev/null +++ b/lib/tdlib/types/message_calendar.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about found messages, split by days according to the option "utc_time_offset". + # + # @attr total_count [Integer] Total number of found messages. + # @attr days [Array] Information about messages sent. + class MessageCalendar < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :days, TD::Types::Array.of(TD::Types::MessageCalendarDay) + end +end diff --git a/lib/tdlib/types/message_calendar_day.rb b/lib/tdlib/types/message_calendar_day.rb new file mode 100644 index 00000000..fa05eba1 --- /dev/null +++ b/lib/tdlib/types/message_calendar_day.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about found messages sent on a specific day. + # + # @attr total_count [Integer] Total number of found messages sent on the day. + # @attr message [TD::Types::Message] First message sent on the day. + class MessageCalendarDay < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :message, TD::Types::Message + end +end diff --git a/lib/tdlib/types/message_content.rb b/lib/tdlib/types/message_content.rb index ccc16953..2009a236 100644 --- a/lib/tdlib/types/message_content.rb +++ b/lib/tdlib/types/message_content.rb @@ -6,25 +6,30 @@ class MessageContent < Base animation audio document + paid_media photo - expired_photo sticker video - expired_video video_note voice_note + expired_photo + expired_video + expired_video_note + expired_voice_note location venue contact + animated_emoji dice game poll + story invoice call - voice_chat_scheduled - voice_chat_started - voice_chat_ended - invite_voice_chat_participants + video_chat_scheduled + video_chat_started + video_chat_ended + invite_video_chat_participants basic_group_chat_create supergroup_chat_create chat_change_title @@ -32,18 +37,39 @@ class MessageContent < Base chat_delete_photo chat_add_members chat_join_by_link + chat_join_by_request chat_delete_member chat_upgrade_to chat_upgrade_from pin_message screenshot_taken - chat_set_ttl + chat_set_background + chat_set_theme + chat_set_message_auto_delete_time + chat_boost + forum_topic_created + forum_topic_edited + forum_topic_is_closed_toggled + forum_topic_is_hidden_toggled + suggest_profile_photo custom_service_action game_score payment_successful payment_successful_bot + payment_refunded + gifted_premium + premium_gift_code + premium_giveaway_created + premium_giveaway + premium_giveaway_completed + premium_giveaway_winners + gifted_stars contact_registered - website_connected + users_shared + chat_shared + bot_write_access_allowed + web_app_data_sent + web_app_data_received passport_data_sent passport_data_received proximity_alert_triggered diff --git a/lib/tdlib/types/message_content/animated_emoji.rb b/lib/tdlib/types/message_content/animated_emoji.rb new file mode 100644 index 00000000..4120e8ff --- /dev/null +++ b/lib/tdlib/types/message_content/animated_emoji.rb @@ -0,0 +1,10 @@ +module TD::Types + # A message with an animated emoji. + # + # @attr animated_emoji [TD::Types::AnimatedEmoji] The animated emoji. + # @attr emoji [TD::Types::String] The corresponding emoji. + class MessageContent::AnimatedEmoji < MessageContent + attribute :animated_emoji, TD::Types::AnimatedEmoji + attribute :emoji, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_content/animation.rb b/lib/tdlib/types/message_content/animation.rb index 7346f31a..12098f89 100644 --- a/lib/tdlib/types/message_content/animation.rb +++ b/lib/tdlib/types/message_content/animation.rb @@ -3,11 +3,16 @@ module TD::Types # # @attr animation [TD::Types::Animation] The animation description. # @attr caption [TD::Types::FormattedText] Animation caption. + # @attr show_caption_above_media [Boolean] True, if the caption must be shown above the animation; otherwise, the + # caption must be shown below the animation. + # @attr has_spoiler [Boolean] True, if the animation preview must be covered by a spoiler animation. # @attr is_secret [Boolean] True, if the animation thumbnail must be blurred and the animation must be shown only # while tapped. class MessageContent::Animation < MessageContent attribute :animation, TD::Types::Animation attribute :caption, TD::Types::FormattedText + attribute :show_caption_above_media, TD::Types::Bool + attribute :has_spoiler, TD::Types::Bool attribute :is_secret, TD::Types::Bool end end diff --git a/lib/tdlib/types/message_content/bot_write_access_allowed.rb b/lib/tdlib/types/message_content/bot_write_access_allowed.rb new file mode 100644 index 00000000..bce36779 --- /dev/null +++ b/lib/tdlib/types/message_content/bot_write_access_allowed.rb @@ -0,0 +1,8 @@ +module TD::Types + # The user allowed the bot to send messages. + # + # @attr reason [TD::Types::BotWriteAccessAllowReason] The reason why the bot was allowed to write messages. + class MessageContent::BotWriteAccessAllowed < MessageContent + attribute :reason, TD::Types::BotWriteAccessAllowReason + end +end diff --git a/lib/tdlib/types/message_content/chat_boost.rb b/lib/tdlib/types/message_content/chat_boost.rb new file mode 100644 index 00000000..5c0e3bea --- /dev/null +++ b/lib/tdlib/types/message_content/chat_boost.rb @@ -0,0 +1,8 @@ +module TD::Types + # The chat was boosted by the sender of the message. + # + # @attr boost_count [Integer] Number of times the chat was boosted. + class MessageContent::ChatBoost < MessageContent + attribute :boost_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/chat_join_by_link.rb b/lib/tdlib/types/message_content/chat_join_by_link.rb index cb09e442..138d9542 100644 --- a/lib/tdlib/types/message_content/chat_join_by_link.rb +++ b/lib/tdlib/types/message_content/chat_join_by_link.rb @@ -1,5 +1,5 @@ module TD::Types - # A new member joined the chat by invite link. + # A new member joined the chat via an invite link. class MessageContent::ChatJoinByLink < MessageContent end end diff --git a/lib/tdlib/types/message_content/chat_join_by_request.rb b/lib/tdlib/types/message_content/chat_join_by_request.rb new file mode 100644 index 00000000..accaad6c --- /dev/null +++ b/lib/tdlib/types/message_content/chat_join_by_request.rb @@ -0,0 +1,5 @@ +module TD::Types + # A new member was accepted to the chat by an administrator. + class MessageContent::ChatJoinByRequest < MessageContent + end +end diff --git a/lib/tdlib/types/message_content/chat_set_background.rb b/lib/tdlib/types/message_content/chat_set_background.rb new file mode 100644 index 00000000..3c567f15 --- /dev/null +++ b/lib/tdlib/types/message_content/chat_set_background.rb @@ -0,0 +1,14 @@ +module TD::Types + # A new background was set in the chat. + # + # @attr old_background_message_id [Integer] Identifier of the message with a previously set same background; 0 if + # none. + # Can be an identifier of a deleted message. + # @attr background [TD::Types::ChatBackground] The new background. + # @attr only_for_self [Boolean] True, if the background was set only for self. + class MessageContent::ChatSetBackground < MessageContent + attribute :old_background_message_id, TD::Types::Coercible::Integer + attribute :background, TD::Types::ChatBackground + attribute :only_for_self, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/message_content/chat_set_message_auto_delete_time.rb b/lib/tdlib/types/message_content/chat_set_message_auto_delete_time.rb new file mode 100644 index 00000000..5d6c62f5 --- /dev/null +++ b/lib/tdlib/types/message_content/chat_set_message_auto_delete_time.rb @@ -0,0 +1,10 @@ +module TD::Types + # The auto-delete or self-destruct timer for messages in the chat has been changed. + # + # @attr message_auto_delete_time [Integer] New value auto-delete or self-destruct time, in seconds; 0 if disabled. + # @attr from_user_id [Integer] If not 0, a user identifier, which default setting was automatically applied. + class MessageContent::ChatSetMessageAutoDeleteTime < MessageContent + attribute :message_auto_delete_time, TD::Types::Coercible::Integer + attribute :from_user_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/chat_set_theme.rb b/lib/tdlib/types/message_content/chat_set_theme.rb new file mode 100644 index 00000000..48a597b8 --- /dev/null +++ b/lib/tdlib/types/message_content/chat_set_theme.rb @@ -0,0 +1,9 @@ +module TD::Types + # A theme in the chat has been changed. + # + # @attr theme_name [TD::Types::String] If non-empty, name of a new theme, set for the chat. + # Otherwise, chat theme was reset to the default one. + class MessageContent::ChatSetTheme < MessageContent + attribute :theme_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_content/chat_set_ttl.rb b/lib/tdlib/types/message_content/chat_set_ttl.rb deleted file mode 100644 index 2af886db..00000000 --- a/lib/tdlib/types/message_content/chat_set_ttl.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # The TTL (Time To Live) setting for messages in the chat has been changed. - # - # @attr ttl [Integer] New message TTL setting. - class MessageContent::ChatSetTtl < MessageContent - attribute :ttl, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/message_content/chat_shared.rb b/lib/tdlib/types/message_content/chat_shared.rb new file mode 100644 index 00000000..46e22189 --- /dev/null +++ b/lib/tdlib/types/message_content/chat_shared.rb @@ -0,0 +1,10 @@ +module TD::Types + # The current user shared a chat, which was requested by the bot. + # + # @attr chat [TD::Types::SharedChat] The shared chat. + # @attr button_id [Integer] Identifier of the keyboard button with the request. + class MessageContent::ChatShared < MessageContent + attribute :chat, TD::Types::SharedChat + attribute :button_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/dice.rb b/lib/tdlib/types/message_content/dice.rb index 436498b1..c540f057 100644 --- a/lib/tdlib/types/message_content/dice.rb +++ b/lib/tdlib/types/message_content/dice.rb @@ -4,10 +4,10 @@ module TD::Types # # @attr initial_state [TD::Types::DiceStickers, nil] The animated stickers with the initial dice animation; may be # null if unknown. - # {TD::Types::Update::MessageContent} will be sent when the sticker became known. + # The update {TD::Types::Update::MessageContent} will be sent when the sticker became known. # @attr final_state [TD::Types::DiceStickers, nil] The animated stickers with the final dice animation; may be null # if unknown. - # {TD::Types::Update::MessageContent} will be sent when the sticker became known. + # The update {TD::Types::Update::MessageContent} will be sent when the sticker became known. # @attr emoji [TD::Types::String] Emoji on which the dice throw animation is based. # @attr value [Integer] The dice value. # If the value is 0, the dice don't have final state yet. diff --git a/lib/tdlib/types/message_content/expired_photo.rb b/lib/tdlib/types/message_content/expired_photo.rb index 1c6c787f..375210b2 100644 --- a/lib/tdlib/types/message_content/expired_photo.rb +++ b/lib/tdlib/types/message_content/expired_photo.rb @@ -1,5 +1,5 @@ module TD::Types - # An expired photo message (self-destructed after TTL has elapsed). + # A self-destructed photo message. class MessageContent::ExpiredPhoto < MessageContent end end diff --git a/lib/tdlib/types/message_content/expired_video.rb b/lib/tdlib/types/message_content/expired_video.rb index 173946ed..8320616b 100644 --- a/lib/tdlib/types/message_content/expired_video.rb +++ b/lib/tdlib/types/message_content/expired_video.rb @@ -1,5 +1,5 @@ module TD::Types - # An expired video message (self-destructed after TTL has elapsed). + # A self-destructed video message. class MessageContent::ExpiredVideo < MessageContent end end diff --git a/lib/tdlib/types/message_content/expired_video_note.rb b/lib/tdlib/types/message_content/expired_video_note.rb new file mode 100644 index 00000000..d9c6b5b5 --- /dev/null +++ b/lib/tdlib/types/message_content/expired_video_note.rb @@ -0,0 +1,5 @@ +module TD::Types + # A self-destructed video note message. + class MessageContent::ExpiredVideoNote < MessageContent + end +end diff --git a/lib/tdlib/types/message_content/expired_voice_note.rb b/lib/tdlib/types/message_content/expired_voice_note.rb new file mode 100644 index 00000000..7cee6427 --- /dev/null +++ b/lib/tdlib/types/message_content/expired_voice_note.rb @@ -0,0 +1,5 @@ +module TD::Types + # A self-destructed voice note message. + class MessageContent::ExpiredVoiceNote < MessageContent + end +end diff --git a/lib/tdlib/types/message_content/forum_topic_created.rb b/lib/tdlib/types/message_content/forum_topic_created.rb new file mode 100644 index 00000000..b5daeb54 --- /dev/null +++ b/lib/tdlib/types/message_content/forum_topic_created.rb @@ -0,0 +1,10 @@ +module TD::Types + # A forum topic has been created. + # + # @attr name [TD::Types::String] Name of the topic. + # @attr icon [TD::Types::ForumTopicIcon] Icon of the topic. + class MessageContent::ForumTopicCreated < MessageContent + attribute :name, TD::Types::String + attribute :icon, TD::Types::ForumTopicIcon + end +end diff --git a/lib/tdlib/types/message_content/forum_topic_edited.rb b/lib/tdlib/types/message_content/forum_topic_edited.rb new file mode 100644 index 00000000..19b85d55 --- /dev/null +++ b/lib/tdlib/types/message_content/forum_topic_edited.rb @@ -0,0 +1,13 @@ +module TD::Types + # A forum topic has been edited. + # + # @attr name [TD::Types::String] If non-empty, the new name of the topic. + # @attr edit_icon_custom_emoji_id [Boolean] True, if icon's custom_emoji_id is changed. + # @attr icon_custom_emoji_id [Integer] New unique identifier of the custom emoji shown on the topic icon; 0 if none. + # Must be ignored if edit_icon_custom_emoji_id is false. + class MessageContent::ForumTopicEdited < MessageContent + attribute :name, TD::Types::String + attribute :edit_icon_custom_emoji_id, TD::Types::Bool + attribute :icon_custom_emoji_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/forum_topic_is_closed_toggled.rb b/lib/tdlib/types/message_content/forum_topic_is_closed_toggled.rb new file mode 100644 index 00000000..50943aa3 --- /dev/null +++ b/lib/tdlib/types/message_content/forum_topic_is_closed_toggled.rb @@ -0,0 +1,8 @@ +module TD::Types + # A forum topic has been closed or opened. + # + # @attr is_closed [Boolean] True, if the topic was closed; otherwise, the topic was reopened. + class MessageContent::ForumTopicIsClosedToggled < MessageContent + attribute :is_closed, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/message_content/forum_topic_is_hidden_toggled.rb b/lib/tdlib/types/message_content/forum_topic_is_hidden_toggled.rb new file mode 100644 index 00000000..3d40a289 --- /dev/null +++ b/lib/tdlib/types/message_content/forum_topic_is_hidden_toggled.rb @@ -0,0 +1,8 @@ +module TD::Types + # A General forum topic has been hidden or unhidden. + # + # @attr is_hidden [Boolean] True, if the topic was hidden; otherwise, the topic was unhidden. + class MessageContent::ForumTopicIsHiddenToggled < MessageContent + attribute :is_hidden, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/message_content/gifted_premium.rb b/lib/tdlib/types/message_content/gifted_premium.rb new file mode 100644 index 00000000..a72c3318 --- /dev/null +++ b/lib/tdlib/types/message_content/gifted_premium.rb @@ -0,0 +1,24 @@ +module TD::Types + # Telegram Premium was gifted to a user. + # + # @attr gifter_user_id [Integer] The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous + # or is outgoing. + # @attr receiver_user_id [Integer] The identifier of a user that received Telegram Premium; 0 if the gift is + # incoming. + # @attr currency [TD::Types::String] Currency for the paid amount. + # @attr amount [Integer] The paid amount, in the smallest units of the currency. + # @attr cryptocurrency [TD::Types::String, nil] Cryptocurrency used to pay for the gift; may be empty if none. + # @attr cryptocurrency_amount [Integer] The paid amount, in the smallest units of the cryptocurrency; 0 if none. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active. + # @attr sticker [TD::Types::Sticker, nil] A sticker to be shown in the message; may be null if unknown. + class MessageContent::GiftedPremium < MessageContent + attribute :gifter_user_id, TD::Types::Coercible::Integer + attribute :receiver_user_id, TD::Types::Coercible::Integer + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :cryptocurrency, TD::Types::String.optional.default(nil) + attribute :cryptocurrency_amount, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + attribute :sticker, TD::Types::Sticker.optional.default(nil) + end +end diff --git a/lib/tdlib/types/message_content/gifted_stars.rb b/lib/tdlib/types/message_content/gifted_stars.rb new file mode 100644 index 00000000..dae1703b --- /dev/null +++ b/lib/tdlib/types/message_content/gifted_stars.rb @@ -0,0 +1,26 @@ +module TD::Types + # Telegram Stars were gifted to a user. + # + # @attr gifter_user_id [Integer] The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or + # is outgoing. + # @attr receiver_user_id [Integer] The identifier of a user that received Telegram Stars; 0 if the gift is incoming. + # @attr currency [TD::Types::String] Currency for the paid amount. + # @attr amount [Integer] The paid amount, in the smallest units of the currency. + # @attr cryptocurrency [TD::Types::String, nil] Cryptocurrency used to pay for the gift; may be empty if none. + # @attr cryptocurrency_amount [Integer] The paid amount, in the smallest units of the cryptocurrency; 0 if none. + # @attr star_count [Integer] Number of Telegram Stars that were gifted. + # @attr transaction_id [TD::Types::String] Identifier of the transaction for Telegram Stars purchase; for receiver + # only. + # @attr sticker [TD::Types::Sticker, nil] A sticker to be shown in the message; may be null if unknown. + class MessageContent::GiftedStars < MessageContent + attribute :gifter_user_id, TD::Types::Coercible::Integer + attribute :receiver_user_id, TD::Types::Coercible::Integer + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :cryptocurrency, TD::Types::String.optional.default(nil) + attribute :cryptocurrency_amount, TD::Types::Coercible::Integer + attribute :star_count, TD::Types::Coercible::Integer + attribute :transaction_id, TD::Types::String + attribute :sticker, TD::Types::Sticker.optional.default(nil) + end +end diff --git a/lib/tdlib/types/message_content/invite_video_chat_participants.rb b/lib/tdlib/types/message_content/invite_video_chat_participants.rb new file mode 100644 index 00000000..9bd7f6dd --- /dev/null +++ b/lib/tdlib/types/message_content/invite_video_chat_participants.rb @@ -0,0 +1,11 @@ +module TD::Types + # A message with information about an invitation to a video chat. + # + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. + # @attr user_ids [Array] Invited user identifiers. + class MessageContent::InviteVideoChatParticipants < MessageContent + attribute :group_call_id, TD::Types::Coercible::Integer + attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/message_content/invite_voice_chat_participants.rb b/lib/tdlib/types/message_content/invite_voice_chat_participants.rb deleted file mode 100644 index 348e6e46..00000000 --- a/lib/tdlib/types/message_content/invite_voice_chat_participants.rb +++ /dev/null @@ -1,11 +0,0 @@ -module TD::Types - # A message with information about an invite to a voice chat. - # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. - # @attr user_ids [Array] Invited user identifiers. - class MessageContent::InviteVoiceChatParticipants < MessageContent - attribute :group_call_id, TD::Types::Coercible::Integer - attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) - end -end diff --git a/lib/tdlib/types/message_content/invoice.rb b/lib/tdlib/types/message_content/invoice.rb index 24032bfb..5fb4aa7b 100644 --- a/lib/tdlib/types/message_content/invoice.rb +++ b/lib/tdlib/types/message_content/invoice.rb @@ -1,26 +1,26 @@ module TD::Types # A message with an invoice from a bot. + # Use getInternalLink with internalLinkTypeBotStart to share the invoice. # - # @attr title [TD::Types::String] Product title. - # @attr description [TD::Types::String] Product description. - # @attr photo [TD::Types::Photo, nil] Product photo; may be null. + # @attr product_info [TD::Types::ProductInfo] Information about the product. # @attr currency [TD::Types::String] Currency for the product price. # @attr total_amount [Integer] Product total price in the smallest units of the currency. - # @attr start_parameter [TD::Types::String] Unique invoice bot start_parameter. - # To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter}. + # @attr start_parameter [TD::Types::String] Unique invoice bot start_parameter to be passed to getInternalLink. # @attr is_test [Boolean] True, if the invoice is a test invoice. - # @attr need_shipping_address [Boolean] True, if the shipping address should be specified. + # @attr need_shipping_address [Boolean] True, if the shipping address must be specified. # @attr receipt_message_id [Integer] The identifier of the message with the receipt, after the product has been # purchased. + # @attr paid_media [TD::Types::PaidMedia, nil] Extended media attached to the invoice; may be null if none. + # @attr paid_media_caption [TD::Types::FormattedText, nil] Extended media caption; may be null if none. class MessageContent::Invoice < MessageContent - attribute :title, TD::Types::String - attribute :description, TD::Types::String - attribute :photo, TD::Types::Photo.optional.default(nil) + attribute :product_info, TD::Types::ProductInfo attribute :currency, TD::Types::String attribute :total_amount, TD::Types::Coercible::Integer attribute :start_parameter, TD::Types::String attribute :is_test, TD::Types::Bool attribute :need_shipping_address, TD::Types::Bool attribute :receipt_message_id, TD::Types::Coercible::Integer + attribute :paid_media, TD::Types::PaidMedia.optional.default(nil) + attribute :paid_media_caption, TD::Types::FormattedText.optional.default(nil) end end diff --git a/lib/tdlib/types/message_content/location.rb b/lib/tdlib/types/message_content/location.rb index c6bd32ec..b6005337 100644 --- a/lib/tdlib/types/message_content/location.rb +++ b/lib/tdlib/types/message_content/location.rb @@ -3,15 +3,16 @@ module TD::Types # # @attr location [TD::Types::Location] The location description. # @attr live_period [Integer] Time relative to the message send date, for which the location can be updated, in - # seconds. + # seconds; if 0x7FFFFFFF, then location can be updated forever. # @attr expires_in [Integer] Left time for which the location can be updated, in seconds. - # {TD::Types::Update::MessageContent} is not sent when this field changes. + # If 0, then the location can't be updated anymore. + # The update {TD::Types::Update::MessageContent} is not sent when this field changes. # @attr heading [Integer] For live locations, a direction in which the location moves, in degrees; 1-360. # If 0 the direction is unknown. # @attr proximity_alert_radius [Integer] For live locations, a maximum distance to another chat member for proximity # alerts, in meters (0-100000). # 0 if the notification is disabled. - # Available only for the message sender. + # Available only to the message sender. class MessageContent::Location < MessageContent attribute :location, TD::Types::Location attribute :live_period, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/message_content/paid_media.rb b/lib/tdlib/types/message_content/paid_media.rb new file mode 100644 index 00000000..e40d51d0 --- /dev/null +++ b/lib/tdlib/types/message_content/paid_media.rb @@ -0,0 +1,15 @@ +module TD::Types + # A message with paid media. + # + # @attr star_count [Integer] Number of Telegram Stars needed to buy access to the media in the message. + # @attr media [Array] Information about the media. + # @attr caption [TD::Types::FormattedText] Media caption. + # @attr show_caption_above_media [Boolean] True, if the caption must be shown above the media; otherwise, the caption + # must be shown below the media. + class MessageContent::PaidMedia < MessageContent + attribute :star_count, TD::Types::Coercible::Integer + attribute :media, TD::Types::Array.of(TD::Types::PaidMedia) + attribute :caption, TD::Types::FormattedText + attribute :show_caption_above_media, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/message_content/passport_data_sent.rb b/lib/tdlib/types/message_content/passport_data_sent.rb index 9fe51f78..a99d812e 100644 --- a/lib/tdlib/types/message_content/passport_data_sent.rb +++ b/lib/tdlib/types/message_content/passport_data_sent.rb @@ -1,5 +1,5 @@ module TD::Types - # Telegram Passport data has been sent. + # Telegram Passport data has been sent to a bot. # # @attr types [Array] List of Telegram Passport element types sent. class MessageContent::PassportDataSent < MessageContent diff --git a/lib/tdlib/types/message_content/payment_refunded.rb b/lib/tdlib/types/message_content/payment_refunded.rb new file mode 100644 index 00000000..fa41ec1b --- /dev/null +++ b/lib/tdlib/types/message_content/payment_refunded.rb @@ -0,0 +1,18 @@ +module TD::Types + # A payment has been refunded. + # + # @attr owner_id [TD::Types::MessageSender] Identifier of the previous owner of the Telegram Stars that refunds them. + # @attr currency [TD::Types::String] Currency for the price of the product. + # @attr total_amount [Integer] Total price for the product, in the smallest units of the currency. + # @attr invoice_payload [String] Invoice payload; only for bots. + # @attr telegram_payment_charge_id [TD::Types::String] Telegram payment identifier. + # @attr provider_payment_charge_id [TD::Types::String] Provider payment identifier. + class MessageContent::PaymentRefunded < MessageContent + attribute :owner_id, TD::Types::MessageSender + attribute :currency, TD::Types::String + attribute :total_amount, TD::Types::Coercible::Integer + attribute :invoice_payload, TD::Types::Coercible::String + attribute :telegram_payment_charge_id, TD::Types::String + attribute :provider_payment_charge_id, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_content/payment_successful.rb b/lib/tdlib/types/message_content/payment_successful.rb index 10123127..fd340b6c 100644 --- a/lib/tdlib/types/message_content/payment_successful.rb +++ b/lib/tdlib/types/message_content/payment_successful.rb @@ -1,15 +1,21 @@ module TD::Types # A payment has been completed. # - # @attr invoice_chat_id [Integer] Identifier of the chat, containing the corresponding invoice message; 0 if unknown. - # @attr invoice_message_id [Integer] Identifier of the message with the corresponding invoice; can be an identifier - # of a deleted message. + # @attr invoice_chat_id [Integer] Identifier of the chat, containing the corresponding invoice message. + # @attr invoice_message_id [Integer] Identifier of the message with the corresponding invoice; can be 0 or an + # identifier of a deleted message. # @attr currency [TD::Types::String] Currency for the price of the product. # @attr total_amount [Integer] Total price for the product, in the smallest units of the currency. + # @attr is_recurring [Boolean] True, if this is a recurring payment. + # @attr is_first_recurring [Boolean] True, if this is the first recurring payment. + # @attr invoice_name [TD::Types::String, nil] Name of the invoice; may be empty if unknown. class MessageContent::PaymentSuccessful < MessageContent attribute :invoice_chat_id, TD::Types::Coercible::Integer attribute :invoice_message_id, TD::Types::Coercible::Integer attribute :currency, TD::Types::String attribute :total_amount, TD::Types::Coercible::Integer + attribute :is_recurring, TD::Types::Bool + attribute :is_first_recurring, TD::Types::Bool + attribute :invoice_name, TD::Types::String.optional.default(nil) end end diff --git a/lib/tdlib/types/message_content/payment_successful_bot.rb b/lib/tdlib/types/message_content/payment_successful_bot.rb index f1347435..a7ca0d50 100644 --- a/lib/tdlib/types/message_content/payment_successful_bot.rb +++ b/lib/tdlib/types/message_content/payment_successful_bot.rb @@ -3,6 +3,8 @@ module TD::Types # # @attr currency [TD::Types::String] Currency for price of the product. # @attr total_amount [Integer] Total price for the product, in the smallest units of the currency. + # @attr is_recurring [Boolean] True, if this is a recurring payment. + # @attr is_first_recurring [Boolean] True, if this is the first recurring payment. # @attr invoice_payload [String] Invoice payload. # @attr shipping_option_id [TD::Types::String, nil] Identifier of the shipping option chosen by the user; may be # empty if not applicable. @@ -12,6 +14,8 @@ module TD::Types class MessageContent::PaymentSuccessfulBot < MessageContent attribute :currency, TD::Types::String attribute :total_amount, TD::Types::Coercible::Integer + attribute :is_recurring, TD::Types::Bool + attribute :is_first_recurring, TD::Types::Bool attribute :invoice_payload, TD::Types::Coercible::String attribute :shipping_option_id, TD::Types::String.optional.default(nil) attribute :order_info, TD::Types::OrderInfo.optional.default(nil) diff --git a/lib/tdlib/types/message_content/photo.rb b/lib/tdlib/types/message_content/photo.rb index 55497d3d..5a5c0e89 100644 --- a/lib/tdlib/types/message_content/photo.rb +++ b/lib/tdlib/types/message_content/photo.rb @@ -1,12 +1,17 @@ module TD::Types # A photo message. # - # @attr photo [TD::Types::Photo] The photo description. + # @attr photo [TD::Types::Photo] The photo. # @attr caption [TD::Types::FormattedText] Photo caption. + # @attr show_caption_above_media [Boolean] True, if the caption must be shown above the photo; otherwise, the caption + # must be shown below the photo. + # @attr has_spoiler [Boolean] True, if the photo preview must be covered by a spoiler animation. # @attr is_secret [Boolean] True, if the photo must be blurred and must be shown only while tapped. class MessageContent::Photo < MessageContent attribute :photo, TD::Types::Photo attribute :caption, TD::Types::FormattedText + attribute :show_caption_above_media, TD::Types::Bool + attribute :has_spoiler, TD::Types::Bool attribute :is_secret, TD::Types::Bool end end diff --git a/lib/tdlib/types/message_content/premium_gift_code.rb b/lib/tdlib/types/message_content/premium_gift_code.rb new file mode 100644 index 00000000..e0c1f799 --- /dev/null +++ b/lib/tdlib/types/message_content/premium_gift_code.rb @@ -0,0 +1,29 @@ +module TD::Types + # A Telegram Premium gift code was created for the user. + # + # @attr creator_id [TD::Types::MessageSender, nil] Identifier of a chat or a user that created the gift code; may be + # null if unknown. + # @attr is_from_giveaway [Boolean] True, if the gift code was created for a giveaway. + # @attr is_unclaimed [Boolean] True, if the winner for the corresponding Telegram Premium subscription wasn't chosen. + # @attr currency [TD::Types::String] Currency for the paid amount; empty if unknown. + # @attr amount [Integer] The paid amount, in the smallest units of the currency; 0 if unknown. + # @attr cryptocurrency [TD::Types::String, nil] Cryptocurrency used to pay for the gift; may be empty if none or + # unknown. + # @attr cryptocurrency_amount [Integer] The paid amount, in the smallest units of the cryptocurrency; 0 if unknown. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active after code + # activation. + # @attr sticker [TD::Types::Sticker, nil] A sticker to be shown in the message; may be null if unknown. + # @attr code [TD::Types::String] The gift code. + class MessageContent::PremiumGiftCode < MessageContent + attribute :creator_id, TD::Types::MessageSender.optional.default(nil) + attribute :is_from_giveaway, TD::Types::Bool + attribute :is_unclaimed, TD::Types::Bool + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :cryptocurrency, TD::Types::String.optional.default(nil) + attribute :cryptocurrency_amount, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + attribute :sticker, TD::Types::Sticker.optional.default(nil) + attribute :code, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_content/premium_giveaway.rb b/lib/tdlib/types/message_content/premium_giveaway.rb new file mode 100644 index 00000000..004e0f52 --- /dev/null +++ b/lib/tdlib/types/message_content/premium_giveaway.rb @@ -0,0 +1,15 @@ +module TD::Types + # A Telegram Premium giveaway. + # + # @attr parameters [TD::Types::PremiumGiveawayParameters] Giveaway parameters. + # @attr winner_count [Integer] Number of users which will receive Telegram Premium subscription gift codes. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active after code + # activation. + # @attr sticker [TD::Types::Sticker, nil] A sticker to be shown in the message; may be null if unknown. + class MessageContent::PremiumGiveaway < MessageContent + attribute :parameters, TD::Types::PremiumGiveawayParameters + attribute :winner_count, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + attribute :sticker, TD::Types::Sticker.optional.default(nil) + end +end diff --git a/lib/tdlib/types/message_content/premium_giveaway_completed.rb b/lib/tdlib/types/message_content/premium_giveaway_completed.rb new file mode 100644 index 00000000..7d1fde4f --- /dev/null +++ b/lib/tdlib/types/message_content/premium_giveaway_completed.rb @@ -0,0 +1,13 @@ +module TD::Types + # A Telegram Premium giveaway without public winners has been completed for the chat. + # + # @attr giveaway_message_id [Integer] Identifier of the message with the giveaway; can be 0 if the message was + # deleted. + # @attr winner_count [Integer] Number of winners in the giveaway. + # @attr unclaimed_prize_count [Integer] Number of undistributed prizes. + class MessageContent::PremiumGiveawayCompleted < MessageContent + attribute :giveaway_message_id, TD::Types::Coercible::Integer + attribute :winner_count, TD::Types::Coercible::Integer + attribute :unclaimed_prize_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/premium_giveaway_created.rb b/lib/tdlib/types/message_content/premium_giveaway_created.rb new file mode 100644 index 00000000..586be26f --- /dev/null +++ b/lib/tdlib/types/message_content/premium_giveaway_created.rb @@ -0,0 +1,6 @@ +module TD::Types + # A Telegram Premium giveaway was created for the chat. + # Use telegramPaymentPurposePremiumGiveaway or storePaymentPurposePremiumGiveaway to create a giveaway. + class MessageContent::PremiumGiveawayCreated < MessageContent + end +end diff --git a/lib/tdlib/types/message_content/premium_giveaway_winners.rb b/lib/tdlib/types/message_content/premium_giveaway_winners.rb new file mode 100644 index 00000000..bd8d1043 --- /dev/null +++ b/lib/tdlib/types/message_content/premium_giveaway_winners.rb @@ -0,0 +1,31 @@ +module TD::Types + # A Telegram Premium giveaway with public winners has been completed for the chat. + # + # @attr boosted_chat_id [Integer] Identifier of the channel chat, which was automatically boosted by the winners of + # the giveaway for duration of the Premium subscription. + # @attr giveaway_message_id [Integer] Identifier of the message with the giveaway in the boosted chat. + # @attr additional_chat_count [Integer] Number of other chats that participated in the giveaway. + # @attr actual_winners_selection_date [Integer] Point in time (Unix timestamp) when the winners were selected. + # May be bigger than winners selection date specified in parameters of the giveaway. + # @attr only_new_members [Boolean] True, if only new members of the chats were eligible for the giveaway. + # @attr was_refunded [Boolean] True, if the giveaway was canceled and was fully refunded. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active after code + # activation. + # @attr prize_description [TD::Types::String] Additional description of the giveaway prize. + # @attr winner_count [Integer] Total number of winners in the giveaway. + # @attr winner_user_ids [Array] Up to 100 user identifiers of the winners of the giveaway. + # @attr unclaimed_prize_count [Integer] Number of undistributed prizes. + class MessageContent::PremiumGiveawayWinners < MessageContent + attribute :boosted_chat_id, TD::Types::Coercible::Integer + attribute :giveaway_message_id, TD::Types::Coercible::Integer + attribute :additional_chat_count, TD::Types::Coercible::Integer + attribute :actual_winners_selection_date, TD::Types::Coercible::Integer + attribute :only_new_members, TD::Types::Bool + attribute :was_refunded, TD::Types::Bool + attribute :month_count, TD::Types::Coercible::Integer + attribute :prize_description, TD::Types::String + attribute :winner_count, TD::Types::Coercible::Integer + attribute :winner_user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :unclaimed_prize_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/proximity_alert_triggered.rb b/lib/tdlib/types/message_content/proximity_alert_triggered.rb index 128c5502..60cb03f8 100644 --- a/lib/tdlib/types/message_content/proximity_alert_triggered.rb +++ b/lib/tdlib/types/message_content/proximity_alert_triggered.rb @@ -1,12 +1,13 @@ module TD::Types # A user in the chat came within proximity alert range. # - # @attr traveler [TD::Types::MessageSender] The user or chat, which triggered the proximity alert. - # @attr watcher [TD::Types::MessageSender] The user or chat, which subscribed for the proximity alert. + # @attr traveler_id [TD::Types::MessageSender] The identifier of a user or chat that triggered the proximity alert. + # @attr watcher_id [TD::Types::MessageSender] The identifier of a user or chat that subscribed for the proximity + # alert. # @attr distance [Integer] The distance between the users. class MessageContent::ProximityAlertTriggered < MessageContent - attribute :traveler, TD::Types::MessageSender - attribute :watcher, TD::Types::MessageSender + attribute :traveler_id, TD::Types::MessageSender + attribute :watcher_id, TD::Types::MessageSender attribute :distance, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/message_content/sticker.rb b/lib/tdlib/types/message_content/sticker.rb index 63e82fba..9d493043 100644 --- a/lib/tdlib/types/message_content/sticker.rb +++ b/lib/tdlib/types/message_content/sticker.rb @@ -2,7 +2,9 @@ module TD::Types # A sticker message. # # @attr sticker [TD::Types::Sticker] The sticker description. + # @attr is_premium [Boolean] True, if premium animation of the sticker must be played. class MessageContent::Sticker < MessageContent attribute :sticker, TD::Types::Sticker + attribute :is_premium, TD::Types::Bool end end diff --git a/lib/tdlib/types/message_content/story.rb b/lib/tdlib/types/message_content/story.rb new file mode 100644 index 00000000..df13939a --- /dev/null +++ b/lib/tdlib/types/message_content/story.rb @@ -0,0 +1,12 @@ +module TD::Types + # A message with a forwarded story. + # + # @attr story_sender_chat_id [Integer] Identifier of the chat that posted the story. + # @attr story_id [Integer] Story identifier. + # @attr via_mention [Boolean] True, if the story was automatically forwarded because of a mention of the user. + class MessageContent::Story < MessageContent + attribute :story_sender_chat_id, TD::Types::Coercible::Integer + attribute :story_id, TD::Types::Coercible::Integer + attribute :via_mention, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/message_content/suggest_profile_photo.rb b/lib/tdlib/types/message_content/suggest_profile_photo.rb new file mode 100644 index 00000000..91e2d1be --- /dev/null +++ b/lib/tdlib/types/message_content/suggest_profile_photo.rb @@ -0,0 +1,9 @@ +module TD::Types + # A profile photo was suggested to a user in a private chat. + # + # @attr photo [TD::Types::ChatPhoto] The suggested chat photo. + # Use the method setProfilePhoto with {TD::Types::InputChatPhoto::Previous} to apply the photo. + class MessageContent::SuggestProfilePhoto < MessageContent + attribute :photo, TD::Types::ChatPhoto + end +end diff --git a/lib/tdlib/types/message_content/text.rb b/lib/tdlib/types/message_content/text.rb index a4f9c6e4..21916398 100644 --- a/lib/tdlib/types/message_content/text.rb +++ b/lib/tdlib/types/message_content/text.rb @@ -2,9 +2,12 @@ module TD::Types # A text message. # # @attr text [TD::Types::FormattedText] Text of the message. - # @attr web_page [TD::Types::WebPage, nil] A preview of the web page that's mentioned in the text; may be null. + # @attr link_preview [TD::Types::LinkPreview, nil] A link preview attached to the message; may be null. + # @attr link_preview_options [TD::Types::LinkPreviewOptions, nil] Options which were used for generation of the link + # preview; may be null if default options were used. class MessageContent::Text < MessageContent attribute :text, TD::Types::FormattedText - attribute :web_page, TD::Types::WebPage.optional.default(nil) + attribute :link_preview, TD::Types::LinkPreview.optional.default(nil) + attribute :link_preview_options, TD::Types::LinkPreviewOptions.optional.default(nil) end end diff --git a/lib/tdlib/types/message_content/unsupported.rb b/lib/tdlib/types/message_content/unsupported.rb index 3536ea1a..c2943f0a 100644 --- a/lib/tdlib/types/message_content/unsupported.rb +++ b/lib/tdlib/types/message_content/unsupported.rb @@ -1,5 +1,5 @@ module TD::Types - # Message content that is not supported in the current TDLib version. + # A message content that is not supported in the current TDLib version. class MessageContent::Unsupported < MessageContent end end diff --git a/lib/tdlib/types/message_content/users_shared.rb b/lib/tdlib/types/message_content/users_shared.rb new file mode 100644 index 00000000..c492b4bd --- /dev/null +++ b/lib/tdlib/types/message_content/users_shared.rb @@ -0,0 +1,10 @@ +module TD::Types + # The current user shared users, which were requested by the bot. + # + # @attr users [Array] The shared users. + # @attr button_id [Integer] Identifier of the keyboard button with the request. + class MessageContent::UsersShared < MessageContent + attribute :users, TD::Types::Array.of(TD::Types::SharedUser) + attribute :button_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/video.rb b/lib/tdlib/types/message_content/video.rb index 183ba320..c9b06c18 100644 --- a/lib/tdlib/types/message_content/video.rb +++ b/lib/tdlib/types/message_content/video.rb @@ -3,11 +3,16 @@ module TD::Types # # @attr video [TD::Types::Video] The video description. # @attr caption [TD::Types::FormattedText] Video caption. + # @attr show_caption_above_media [Boolean] True, if the caption must be shown above the video; otherwise, the caption + # must be shown below the video. + # @attr has_spoiler [Boolean] True, if the video preview must be covered by a spoiler animation. # @attr is_secret [Boolean] True, if the video thumbnail must be blurred and the video must be shown only while # tapped. class MessageContent::Video < MessageContent attribute :video, TD::Types::Video attribute :caption, TD::Types::FormattedText + attribute :show_caption_above_media, TD::Types::Bool + attribute :has_spoiler, TD::Types::Bool attribute :is_secret, TD::Types::Bool end end diff --git a/lib/tdlib/types/message_content/video_chat_ended.rb b/lib/tdlib/types/message_content/video_chat_ended.rb new file mode 100644 index 00000000..0356dbd9 --- /dev/null +++ b/lib/tdlib/types/message_content/video_chat_ended.rb @@ -0,0 +1,8 @@ +module TD::Types + # A message with information about an ended video chat. + # + # @attr duration [Integer] Call duration, in seconds. + class MessageContent::VideoChatEnded < MessageContent + attribute :duration, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/voice_chat_scheduled.rb b/lib/tdlib/types/message_content/video_chat_scheduled.rb similarity index 56% rename from lib/tdlib/types/message_content/voice_chat_scheduled.rb rename to lib/tdlib/types/message_content/video_chat_scheduled.rb index e876918b..56bef5ef 100644 --- a/lib/tdlib/types/message_content/voice_chat_scheduled.rb +++ b/lib/tdlib/types/message_content/video_chat_scheduled.rb @@ -1,11 +1,11 @@ module TD::Types - # A new voice chat was scheduled. + # A new video chat was scheduled. # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. # @attr start_date [Integer] Point in time (Unix timestamp) when the group call is supposed to be started by an # administrator. - class MessageContent::VoiceChatScheduled < MessageContent + class MessageContent::VideoChatScheduled < MessageContent attribute :group_call_id, TD::Types::Coercible::Integer attribute :start_date, TD::Types::Coercible::Integer end diff --git a/lib/tdlib/types/message_content/video_chat_started.rb b/lib/tdlib/types/message_content/video_chat_started.rb new file mode 100644 index 00000000..9e2b18f9 --- /dev/null +++ b/lib/tdlib/types/message_content/video_chat_started.rb @@ -0,0 +1,9 @@ +module TD::Types + # A newly created video chat. + # + # @attr group_call_id [Integer] Identifier of the video chat. + # The video chat can be received through the method getGroupCall. + class MessageContent::VideoChatStarted < MessageContent + attribute :group_call_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_content/voice_chat_ended.rb b/lib/tdlib/types/message_content/voice_chat_ended.rb deleted file mode 100644 index 57193d03..00000000 --- a/lib/tdlib/types/message_content/voice_chat_ended.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # A message with information about an ended voice chat. - # - # @attr duration [Integer] Call duration. - class MessageContent::VoiceChatEnded < MessageContent - attribute :duration, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/message_content/voice_chat_started.rb b/lib/tdlib/types/message_content/voice_chat_started.rb deleted file mode 100644 index 732a2783..00000000 --- a/lib/tdlib/types/message_content/voice_chat_started.rb +++ /dev/null @@ -1,9 +0,0 @@ -module TD::Types - # A newly created voice chat. - # - # @attr group_call_id [Integer] Identifier of the voice chat. - # The voice chat can be received through the method getGroupCall. - class MessageContent::VoiceChatStarted < MessageContent - attribute :group_call_id, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/message_content/web_app_data_received.rb b/lib/tdlib/types/message_content/web_app_data_received.rb new file mode 100644 index 00000000..694ab2e8 --- /dev/null +++ b/lib/tdlib/types/message_content/web_app_data_received.rb @@ -0,0 +1,11 @@ +module TD::Types + # Data from a Web App has been received; for bots only. + # + # @attr button_text [TD::Types::String] Text of the {TD::Types::KeyboardButtonType::WebApp} button, which opened the + # Web App. + # @attr data [TD::Types::String] The data. + class MessageContent::WebAppDataReceived < MessageContent + attribute :button_text, TD::Types::String + attribute :data, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_content/web_app_data_sent.rb b/lib/tdlib/types/message_content/web_app_data_sent.rb new file mode 100644 index 00000000..dd4a1b9c --- /dev/null +++ b/lib/tdlib/types/message_content/web_app_data_sent.rb @@ -0,0 +1,9 @@ +module TD::Types + # Data from a Web App has been sent to a bot. + # + # @attr button_text [TD::Types::String] Text of the {TD::Types::KeyboardButtonType::WebApp} button, which opened the + # Web App. + class MessageContent::WebAppDataSent < MessageContent + attribute :button_text, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_content/website_connected.rb b/lib/tdlib/types/message_content/website_connected.rb deleted file mode 100644 index b42cbed5..00000000 --- a/lib/tdlib/types/message_content/website_connected.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # The current user has connected a website by logging in using Telegram Login Widget on it. - # - # @attr domain_name [TD::Types::String] Domain name of the connected website. - class MessageContent::WebsiteConnected < MessageContent - attribute :domain_name, TD::Types::String - end -end diff --git a/lib/tdlib/types/message_copy_options.rb b/lib/tdlib/types/message_copy_options.rb index 73d16222..8e3fee2b 100644 --- a/lib/tdlib/types/message_copy_options.rb +++ b/lib/tdlib/types/message_copy_options.rb @@ -1,17 +1,22 @@ module TD::Types - # Options to be used when a message content is copied without a link to the original message. - # Service messages and messageInvoice can't be copied. + # Options to be used when a message content is copied without reference to the original sender. + # Service messages, messages with messageInvoice, messagePaidMedia, messagePremiumGiveaway, or + # messagePremiumGiveawayWinners content can't be copied. # - # @attr send_copy [Boolean] True, if content of the message needs to be copied without a link to the original - # message. - # Always true if the message is forwarded to a secret chat. + # @attr send_copy [Boolean] True, if content of the message needs to be copied without reference to the original + # sender. + # Always true if the message is forwarded to a secret chat or is local. # @attr replace_caption [Boolean] True, if media caption of the message copy needs to be replaced. # Ignored if send_copy is false. - # @attr new_caption [TD::Types::FormattedText] New message caption. + # @attr new_caption [TD::Types::FormattedText] New message caption; pass null to copy message without caption. + # Ignored if replace_caption is false. + # @attr new_show_caption_above_media [Boolean] True, if new caption must be shown above the animation; otherwise, new + # caption must be shown below the animation; not supported in secret chats. # Ignored if replace_caption is false. class MessageCopyOptions < Base attribute :send_copy, TD::Types::Bool attribute :replace_caption, TD::Types::Bool attribute :new_caption, TD::Types::FormattedText + attribute :new_show_caption_above_media, TD::Types::Bool end end diff --git a/lib/tdlib/types/message_effect.rb b/lib/tdlib/types/message_effect.rb new file mode 100644 index 00000000..6ed4c078 --- /dev/null +++ b/lib/tdlib/types/message_effect.rb @@ -0,0 +1,16 @@ +module TD::Types + # Contains information about an effect added to a message. + # + # @attr id [Integer] Unique identifier of the effect. + # @attr static_icon [TD::Types::Sticker, nil] Static icon for the effect in WEBP format; may be null if none. + # @attr emoji [TD::Types::String] Emoji corresponding to the effect that can be used if static icon isn't available. + # @attr is_premium [Boolean] True, if Telegram Premium subscription is required to use the effect. + # @attr type [TD::Types::MessageEffectType] Type of the effect. + class MessageEffect < Base + attribute :id, TD::Types::Coercible::Integer + attribute :static_icon, TD::Types::Sticker.optional.default(nil) + attribute :emoji, TD::Types::String + attribute :is_premium, TD::Types::Bool + attribute :type, TD::Types::MessageEffectType + end +end diff --git a/lib/tdlib/types/message_effect_type.rb b/lib/tdlib/types/message_effect_type.rb new file mode 100644 index 00000000..f11e4b6b --- /dev/null +++ b/lib/tdlib/types/message_effect_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes type of emoji effect. + class MessageEffectType < Base + %w[ + emoji_reaction + premium_sticker + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/message_effect_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/message_effect_type/emoji_reaction.rb b/lib/tdlib/types/message_effect_type/emoji_reaction.rb new file mode 100644 index 00000000..a6be041d --- /dev/null +++ b/lib/tdlib/types/message_effect_type/emoji_reaction.rb @@ -0,0 +1,10 @@ +module TD::Types + # An effect from an emoji reaction. + # + # @attr select_animation [TD::Types::Sticker] Select animation for the effect in TGS format. + # @attr effect_animation [TD::Types::Sticker] Effect animation for the effect in TGS format. + class MessageEffectType::EmojiReaction < MessageEffectType + attribute :select_animation, TD::Types::Sticker + attribute :effect_animation, TD::Types::Sticker + end +end diff --git a/lib/tdlib/types/message_effect_type/premium_sticker.rb b/lib/tdlib/types/message_effect_type/premium_sticker.rb new file mode 100644 index 00000000..1df048a9 --- /dev/null +++ b/lib/tdlib/types/message_effect_type/premium_sticker.rb @@ -0,0 +1,9 @@ +module TD::Types + # An effect from a premium sticker. + # + # @attr sticker [TD::Types::Sticker] The premium sticker. + # The effect can be found at sticker.full_type.premium_animation. + class MessageEffectType::PremiumSticker < MessageEffectType + attribute :sticker, TD::Types::Sticker + end +end diff --git a/lib/tdlib/types/message_file_type/group.rb b/lib/tdlib/types/message_file_type/group.rb index 425c9539..5f001860 100644 --- a/lib/tdlib/types/message_file_type/group.rb +++ b/lib/tdlib/types/message_file_type/group.rb @@ -1,5 +1,5 @@ module TD::Types - # The messages was exported from a group chat. + # The messages were exported from a group chat. # # @attr title [TD::Types::String, nil] Title of the group chat; may be empty if unrecognized. class MessageFileType::Group < MessageFileType diff --git a/lib/tdlib/types/message_file_type/private.rb b/lib/tdlib/types/message_file_type/private.rb index 4070935f..be1fa194 100644 --- a/lib/tdlib/types/message_file_type/private.rb +++ b/lib/tdlib/types/message_file_type/private.rb @@ -1,5 +1,5 @@ module TD::Types - # The messages was exported from a private chat. + # The messages were exported from a private chat. # # @attr name [TD::Types::String, nil] Name of the other party; may be empty if unrecognized. class MessageFileType::Private < MessageFileType diff --git a/lib/tdlib/types/message_file_type/unknown.rb b/lib/tdlib/types/message_file_type/unknown.rb index 83f7870e..8daf2717 100644 --- a/lib/tdlib/types/message_file_type/unknown.rb +++ b/lib/tdlib/types/message_file_type/unknown.rb @@ -1,5 +1,5 @@ module TD::Types - # The messages was exported from a chat of unknown type. + # The messages were exported from a chat of unknown type. class MessageFileType::Unknown < MessageFileType end end diff --git a/lib/tdlib/types/message_forward_info.rb b/lib/tdlib/types/message_forward_info.rb index 6d0a8dc9..20eed06d 100644 --- a/lib/tdlib/types/message_forward_info.rb +++ b/lib/tdlib/types/message_forward_info.rb @@ -1,21 +1,17 @@ module TD::Types # Contains information about a forwarded message. # - # @attr origin [TD::Types::MessageForwardOrigin] Origin of a forwarded message. + # @attr origin [TD::Types::MessageOrigin] Origin of the forwarded message. # @attr date [Integer] Point in time (Unix timestamp) when the message was originally sent. - # @attr public_service_announcement_type [TD::Types::String] The type of a public service announcement for the + # @attr source [TD::Types::ForwardSource, nil] For messages forwarded to the chat with the current user (Saved + # Messages), to the Replies bot chat, or to the channel's discussion group, information about the source message from + # which the message was forwarded last time; may be null for other forwards or if unknown. + # @attr public_service_announcement_type [TD::Types::String] The type of public service announcement for the # forwarded message. - # @attr from_chat_id [Integer] For messages forwarded to the chat with the current user (Saved Messages), to the - # Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded - # last time; 0 if unknown. - # @attr from_message_id [Integer] For messages forwarded to the chat with the current user (Saved Messages), to the - # Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new - # message was forwarded last time; 0 if unknown. class MessageForwardInfo < Base - attribute :origin, TD::Types::MessageForwardOrigin + attribute :origin, TD::Types::MessageOrigin attribute :date, TD::Types::Coercible::Integer + attribute :source, TD::Types::ForwardSource.optional.default(nil) attribute :public_service_announcement_type, TD::Types::String - attribute :from_chat_id, TD::Types::Coercible::Integer - attribute :from_message_id, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/message_forward_origin.rb b/lib/tdlib/types/message_forward_origin.rb deleted file mode 100644 index 47f70def..00000000 --- a/lib/tdlib/types/message_forward_origin.rb +++ /dev/null @@ -1,14 +0,0 @@ -module TD::Types - # Contains information about the origin of a forwarded message. - class MessageForwardOrigin < Base - %w[ - user - chat - hidden_user - channel - message_import - ].each do |type| - autoload TD::Types.camelize(type), "tdlib/types/message_forward_origin/#{type}" - end - end -end diff --git a/lib/tdlib/types/message_forward_origin/chat.rb b/lib/tdlib/types/message_forward_origin/chat.rb deleted file mode 100644 index 9e102ec7..00000000 --- a/lib/tdlib/types/message_forward_origin/chat.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # The message was originally sent by an anonymous chat administrator on behalf of the chat. - # - # @attr sender_chat_id [Integer] Identifier of the chat that originally sent the message. - # @attr author_signature [TD::Types::String] Original message author signature. - class MessageForwardOrigin::Chat < MessageForwardOrigin - attribute :sender_chat_id, TD::Types::Coercible::Integer - attribute :author_signature, TD::Types::String - end -end diff --git a/lib/tdlib/types/message_forward_origin/message_import.rb b/lib/tdlib/types/message_forward_origin/message_import.rb deleted file mode 100644 index a43c3e9d..00000000 --- a/lib/tdlib/types/message_forward_origin/message_import.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # The message was imported from an exported message history. - # - # @attr sender_name [TD::Types::String] Name of the sender. - class MessageForwardOrigin::MessageImport < MessageForwardOrigin - attribute :sender_name, TD::Types::String - end -end diff --git a/lib/tdlib/types/message_import_info.rb b/lib/tdlib/types/message_import_info.rb new file mode 100644 index 00000000..c146b0de --- /dev/null +++ b/lib/tdlib/types/message_import_info.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about a message created with importMessages. + # + # @attr sender_name [TD::Types::String] Name of the original sender. + # @attr date [Integer] Point in time (Unix timestamp) when the message was originally sent. + class MessageImportInfo < Base + attribute :sender_name, TD::Types::String + attribute :date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_interaction_info.rb b/lib/tdlib/types/message_interaction_info.rb index 3a2691d4..8a92eee2 100644 --- a/lib/tdlib/types/message_interaction_info.rb +++ b/lib/tdlib/types/message_interaction_info.rb @@ -3,13 +3,15 @@ module TD::Types # # @attr view_count [Integer] Number of times the message was viewed. # @attr forward_count [Integer] Number of times the message was forwarded. - # @attr reply_info [TD::Types::MessageReplyInfo, nil] Contains information about direct or indirect replies to the - # message; may be null. + # @attr reply_info [TD::Types::MessageReplyInfo, nil] Information about direct or indirect replies to the message; + # may be null. # Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which # are not replies itself. + # @attr reactions [TD::Types::MessageReactions, nil] The list of reactions or tags added to the message; may be null. class MessageInteractionInfo < Base attribute :view_count, TD::Types::Coercible::Integer attribute :forward_count, TD::Types::Coercible::Integer attribute :reply_info, TD::Types::MessageReplyInfo.optional.default(nil) + attribute :reactions, TD::Types::MessageReactions.optional.default(nil) end end diff --git a/lib/tdlib/types/message_link.rb b/lib/tdlib/types/message_link.rb index da3b0381..e8b77544 100644 --- a/lib/tdlib/types/message_link.rb +++ b/lib/tdlib/types/message_link.rb @@ -1,7 +1,7 @@ module TD::Types - # Contains an HTTPS link to a message in a supergroup or channel. + # Contains an HTTPS link to a message in a supergroup or channel, or a forum topic. # - # @attr link [TD::Types::String] Message link. + # @attr link [TD::Types::String] The link. # @attr is_public [Boolean] True, if the link will work for non-members of the chat. class MessageLink < Base attribute :link, TD::Types::String diff --git a/lib/tdlib/types/message_link_info.rb b/lib/tdlib/types/message_link_info.rb index 839932d9..c0210482 100644 --- a/lib/tdlib/types/message_link_info.rb +++ b/lib/tdlib/types/message_link_info.rb @@ -1,16 +1,21 @@ module TD::Types - # Contains information about a link to a message in a chat. + # Contains information about a link to a message or a forum topic in a chat. # - # @attr is_public [Boolean] True, if the link is a public link for a message in a chat. - # @attr chat_id [Integer] If found, identifier of the chat to which the message belongs, 0 otherwise. + # @attr is_public [Boolean] True, if the link is a public link for a message or a forum topic in a chat. + # @attr chat_id [Integer] If found, identifier of the chat to which the link points, 0 otherwise. + # @attr message_thread_id [Integer] If found, identifier of the message thread in which to open the message, or a + # forum topic to open if the message is missing. # @attr message [TD::Types::Message, nil] If found, the linked message; may be null. + # @attr media_timestamp [Integer] Timestamp from which the video/audio/video note/voice note/story playing must + # start, in seconds; 0 if not specified. + # The media can be in the message content or in its link preview. # @attr for_album [Boolean] True, if the whole media album to which the message belongs is linked. - # @attr for_comment [Boolean] True, if the message is linked as a channel post comment or from a message thread. class MessageLinkInfo < Base attribute :is_public, TD::Types::Bool attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_thread_id, TD::Types::Coercible::Integer attribute :message, TD::Types::Message.optional.default(nil) + attribute :media_timestamp, TD::Types::Coercible::Integer attribute :for_album, TD::Types::Bool - attribute :for_comment, TD::Types::Bool end end diff --git a/lib/tdlib/types/message_origin.rb b/lib/tdlib/types/message_origin.rb new file mode 100644 index 00000000..4118afde --- /dev/null +++ b/lib/tdlib/types/message_origin.rb @@ -0,0 +1,13 @@ +module TD::Types + # Contains information about the origin of a message. + class MessageOrigin < Base + %w[ + user + hidden_user + chat + channel + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/message_origin/#{type}" + end + end +end diff --git a/lib/tdlib/types/message_forward_origin/channel.rb b/lib/tdlib/types/message_origin/channel.rb similarity index 71% rename from lib/tdlib/types/message_forward_origin/channel.rb rename to lib/tdlib/types/message_origin/channel.rb index 4dd4732a..b5d36cb1 100644 --- a/lib/tdlib/types/message_forward_origin/channel.rb +++ b/lib/tdlib/types/message_origin/channel.rb @@ -1,10 +1,10 @@ module TD::Types # The message was originally a post in a channel. # - # @attr chat_id [Integer] Identifier of the chat from which the message was originally forwarded. + # @attr chat_id [Integer] Identifier of the channel chat to which the message was originally sent. # @attr message_id [Integer] Message identifier of the original message. # @attr author_signature [TD::Types::String] Original post author signature. - class MessageForwardOrigin::Channel < MessageForwardOrigin + class MessageOrigin::Channel < MessageOrigin attribute :chat_id, TD::Types::Coercible::Integer attribute :message_id, TD::Types::Coercible::Integer attribute :author_signature, TD::Types::String diff --git a/lib/tdlib/types/message_origin/chat.rb b/lib/tdlib/types/message_origin/chat.rb new file mode 100644 index 00000000..4882fed8 --- /dev/null +++ b/lib/tdlib/types/message_origin/chat.rb @@ -0,0 +1,11 @@ +module TD::Types + # The message was originally sent on behalf of a chat. + # + # @attr sender_chat_id [Integer] Identifier of the chat that originally sent the message. + # @attr author_signature [TD::Types::String] For messages originally sent by an anonymous chat administrator, + # original message author signature. + class MessageOrigin::Chat < MessageOrigin + attribute :sender_chat_id, TD::Types::Coercible::Integer + attribute :author_signature, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_forward_origin/hidden_user.rb b/lib/tdlib/types/message_origin/hidden_user.rb similarity index 78% rename from lib/tdlib/types/message_forward_origin/hidden_user.rb rename to lib/tdlib/types/message_origin/hidden_user.rb index a7864ca5..4be15637 100644 --- a/lib/tdlib/types/message_forward_origin/hidden_user.rb +++ b/lib/tdlib/types/message_origin/hidden_user.rb @@ -2,7 +2,7 @@ module TD::Types # The message was originally sent by a user, which is hidden by their privacy settings. # # @attr sender_name [TD::Types::String] Name of the sender. - class MessageForwardOrigin::HiddenUser < MessageForwardOrigin + class MessageOrigin::HiddenUser < MessageOrigin attribute :sender_name, TD::Types::String end end diff --git a/lib/tdlib/types/message_forward_origin/user.rb b/lib/tdlib/types/message_origin/user.rb similarity index 80% rename from lib/tdlib/types/message_forward_origin/user.rb rename to lib/tdlib/types/message_origin/user.rb index 4393485d..046e1845 100644 --- a/lib/tdlib/types/message_forward_origin/user.rb +++ b/lib/tdlib/types/message_origin/user.rb @@ -2,7 +2,7 @@ module TD::Types # The message was originally sent by a known user. # # @attr sender_user_id [Integer] Identifier of the user that originally sent the message. - class MessageForwardOrigin::User < MessageForwardOrigin + class MessageOrigin::User < MessageOrigin attribute :sender_user_id, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/message_position.rb b/lib/tdlib/types/message_position.rb new file mode 100644 index 00000000..c4e96283 --- /dev/null +++ b/lib/tdlib/types/message_position.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains information about a message in a specific position. + # + # @attr position [Integer] 0-based message position in the full list of suitable messages. + # @attr message_id [Integer] Message identifier. + # @attr date [Integer] Point in time (Unix timestamp) when the message was sent. + class MessagePosition < Base + attribute :position, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_positions.rb b/lib/tdlib/types/message_positions.rb new file mode 100644 index 00000000..7da175b4 --- /dev/null +++ b/lib/tdlib/types/message_positions.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains a list of message positions. + # + # @attr total_count [Integer] Total number of messages found. + # @attr positions [Array] List of message positions. + class MessagePositions < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :positions, TD::Types::Array.of(TD::Types::MessagePosition) + end +end diff --git a/lib/tdlib/types/message_properties.rb b/lib/tdlib/types/message_properties.rb new file mode 100644 index 00000000..e0f1f4a7 --- /dev/null +++ b/lib/tdlib/types/message_properties.rb @@ -0,0 +1,72 @@ +module TD::Types + # Contains properties of a message and describes actions that can be done with the message right now. + # + # @attr can_be_deleted_only_for_self [Boolean] True, if the message can be deleted only for the current user while + # other users will continue to see it using the method deleteMessages with revoke == false. + # @attr can_be_deleted_for_all_users [Boolean] True, if the message can be deleted for all users using the method + # deleteMessages with revoke == true. + # @attr can_be_edited [Boolean] True, if the message can be edited using the methods editMessageText, + # editMessageMedia, editMessageCaption, or editMessageReplyMarkup. + # For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used + # with this message. + # @attr can_be_forwarded [Boolean] True, if the message can be forwarded using + # {TD::Types::InputMessageContent::Forwarded} or forwardMessages. + # @attr can_be_paid [Boolean] True, if the message can be paid using inputInvoiceMessage. + # @attr can_be_pinned [Boolean] True, if the message can be pinned or unpinned in the chat using pinChatMessage or + # unpinChatMessage. + # @attr can_be_replied [Boolean] True, if the message can be replied in the same chat and forum topic using + # inputMessageReplyToMessage. + # @attr can_be_replied_in_another_chat [Boolean] True, if the message can be replied in another chat or forum topic + # using inputMessageReplyToExternalMessage. + # @attr can_be_saved [Boolean] True, if content of the message can be saved locally or copied using + # {TD::Types::InputMessageContent::Forwarded} or forwardMessages with copy options. + # @attr can_be_shared_in_story [Boolean] True, if the message can be shared in a story using + # inputStoryAreaTypeMessage. + # @attr can_edit_scheduling_state [Boolean] True, if scheduling state of the message can be edited. + # @attr can_get_embedding_code [Boolean] True, if code for message embedding can be received using + # getMessageEmbeddingCode. + # @attr can_get_link [Boolean] True, if a link can be generated for the message using getMessageLink. + # @attr can_get_media_timestamp_links [Boolean] True, if media timestamp links can be generated for media timestamp + # entities in the message text, caption or link preview description using getMessageLink. + # @attr can_get_message_thread [Boolean] True, if information about the message thread is available through + # getMessageThread and getMessageThreadHistory. + # @attr can_get_read_date [Boolean] True, if read date of the message can be received through getMessageReadDate. + # @attr can_get_statistics [Boolean] True, if message statistics are available through getMessageStatistics and + # message forwards can be received using getMessagePublicForwards. + # @attr can_get_viewers [Boolean] True, if chat members already viewed the message can be received through + # getMessageViewers. + # @attr can_recognize_speech [Boolean] True, if speech can be recognized for the message through recognizeSpeech. + # @attr can_report_chat [Boolean] True, if the message can be reported using reportChat. + # @attr can_report_reactions [Boolean] True, if reactions on the message can be reported through + # reportMessageReactions. + # @attr can_report_supergroup_spam [Boolean] True, if the message can be reported using reportSupergroupSpam. + # @attr can_set_fact_check [Boolean] True, if fact check for the message can be changed through setMessageFactCheck. + # @attr need_show_statistics [Boolean] True, if message statistics must be available from context menu of the + # message. + class MessageProperties < Base + attribute :can_be_deleted_only_for_self, TD::Types::Bool + attribute :can_be_deleted_for_all_users, TD::Types::Bool + attribute :can_be_edited, TD::Types::Bool + attribute :can_be_forwarded, TD::Types::Bool + attribute :can_be_paid, TD::Types::Bool + attribute :can_be_pinned, TD::Types::Bool + attribute :can_be_replied, TD::Types::Bool + attribute :can_be_replied_in_another_chat, TD::Types::Bool + attribute :can_be_saved, TD::Types::Bool + attribute :can_be_shared_in_story, TD::Types::Bool + attribute :can_edit_scheduling_state, TD::Types::Bool + attribute :can_get_embedding_code, TD::Types::Bool + attribute :can_get_link, TD::Types::Bool + attribute :can_get_media_timestamp_links, TD::Types::Bool + attribute :can_get_message_thread, TD::Types::Bool + attribute :can_get_read_date, TD::Types::Bool + attribute :can_get_statistics, TD::Types::Bool + attribute :can_get_viewers, TD::Types::Bool + attribute :can_recognize_speech, TD::Types::Bool + attribute :can_report_chat, TD::Types::Bool + attribute :can_report_reactions, TD::Types::Bool + attribute :can_report_supergroup_spam, TD::Types::Bool + attribute :can_set_fact_check, TD::Types::Bool + attribute :need_show_statistics, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/message_reaction.rb b/lib/tdlib/types/message_reaction.rb new file mode 100644 index 00000000..5895ed36 --- /dev/null +++ b/lib/tdlib/types/message_reaction.rb @@ -0,0 +1,18 @@ +module TD::Types + # Contains information about a reaction to a message. + # + # @attr type [TD::Types::ReactionType] Type of the reaction. + # @attr total_count [Integer] Number of times the reaction was added. + # @attr is_chosen [Boolean] True, if the reaction is chosen by the current user. + # @attr used_sender_id [TD::Types::MessageSender, nil] Identifier of the message sender used by the current user to + # add the reaction; may be null if unknown or the reaction isn't chosen. + # @attr recent_sender_ids [Array] Identifiers of at most 3 recent message senders, added + # the reaction; available in private, basic group and supergroup chats. + class MessageReaction < Base + attribute :type, TD::Types::ReactionType + attribute :total_count, TD::Types::Coercible::Integer + attribute :is_chosen, TD::Types::Bool + attribute :used_sender_id, TD::Types::MessageSender.optional.default(nil) + attribute :recent_sender_ids, TD::Types::Array.of(TD::Types::MessageSender) + end +end diff --git a/lib/tdlib/types/message_reactions.rb b/lib/tdlib/types/message_reactions.rb new file mode 100644 index 00000000..c2ad8938 --- /dev/null +++ b/lib/tdlib/types/message_reactions.rb @@ -0,0 +1,15 @@ +module TD::Types + # Contains a list of reactions added to a message. + # + # @attr reactions [Array] List of added reactions. + # @attr are_tags [Boolean] True, if the reactions are tags and Telegram Premium users can filter messages by them. + # @attr paid_reactors [Array] Information about top users that added the paid reaction. + # @attr can_get_added_reactions [Boolean] True, if the list of added reactions is available using + # getMessageAddedReactions. + class MessageReactions < Base + attribute :reactions, TD::Types::Array.of(TD::Types::MessageReaction) + attribute :are_tags, TD::Types::Bool + attribute :paid_reactors, TD::Types::Array.of(TD::Types::PaidReactor) + attribute :can_get_added_reactions, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/message_read_date.rb b/lib/tdlib/types/message_read_date.rb new file mode 100644 index 00000000..83cc6c6c --- /dev/null +++ b/lib/tdlib/types/message_read_date.rb @@ -0,0 +1,14 @@ +module TD::Types + # Describes read date of a recent outgoing message in a private chat. + class MessageReadDate < Base + %w[ + read + unread + too_old + user_privacy_restricted + my_privacy_restricted + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/message_read_date/#{type}" + end + end +end diff --git a/lib/tdlib/types/message_read_date/my_privacy_restricted.rb b/lib/tdlib/types/message_read_date/my_privacy_restricted.rb new file mode 100644 index 00000000..8733db8f --- /dev/null +++ b/lib/tdlib/types/message_read_date/my_privacy_restricted.rb @@ -0,0 +1,6 @@ +module TD::Types + # The read date is unknown due to privacy settings of the current user, but will be known if the user subscribes to + # Telegram Premium. + class MessageReadDate::MyPrivacyRestricted < MessageReadDate + end +end diff --git a/lib/tdlib/types/message_read_date/read.rb b/lib/tdlib/types/message_read_date/read.rb new file mode 100644 index 00000000..0b919928 --- /dev/null +++ b/lib/tdlib/types/message_read_date/read.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains read date of the message. + # + # @attr read_date [Integer] Point in time (Unix timestamp) when the message was read by the other user. + class MessageReadDate::Read < MessageReadDate + attribute :read_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_read_date/too_old.rb b/lib/tdlib/types/message_read_date/too_old.rb new file mode 100644 index 00000000..013f7fdf --- /dev/null +++ b/lib/tdlib/types/message_read_date/too_old.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is too old to get read date. + class MessageReadDate::TooOld < MessageReadDate + end +end diff --git a/lib/tdlib/types/message_read_date/unread.rb b/lib/tdlib/types/message_read_date/unread.rb new file mode 100644 index 00000000..61c08acf --- /dev/null +++ b/lib/tdlib/types/message_read_date/unread.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is unread yet. + class MessageReadDate::Unread < MessageReadDate + end +end diff --git a/lib/tdlib/types/message_read_date/user_privacy_restricted.rb b/lib/tdlib/types/message_read_date/user_privacy_restricted.rb new file mode 100644 index 00000000..53f12a48 --- /dev/null +++ b/lib/tdlib/types/message_read_date/user_privacy_restricted.rb @@ -0,0 +1,5 @@ +module TD::Types + # The read date is unknown due to privacy settings of the other user. + class MessageReadDate::UserPrivacyRestricted < MessageReadDate + end +end diff --git a/lib/tdlib/types/message_reply_info.rb b/lib/tdlib/types/message_reply_info.rb index 3e10fd0f..95eb2c3a 100644 --- a/lib/tdlib/types/message_reply_info.rb +++ b/lib/tdlib/types/message_reply_info.rb @@ -2,14 +2,15 @@ module TD::Types # Contains information about replies to a message. # # @attr reply_count [Integer] Number of times the message was directly or indirectly replied. - # @attr recent_repliers [Array] Recent repliers to the message; available in channels with - # a discussion supergroup. + # @attr recent_replier_ids [Array] Identifiers of at most 3 recent repliers to the message; + # available in channels with a discussion supergroup. + # The users and chats are expected to be inaccessible: only their photo and name will be available. # @attr last_read_inbox_message_id [Integer] Identifier of the last read incoming reply to the message. # @attr last_read_outbox_message_id [Integer] Identifier of the last read outgoing reply to the message. # @attr last_message_id [Integer] Identifier of the last reply to the message. class MessageReplyInfo < Base attribute :reply_count, TD::Types::Coercible::Integer - attribute :recent_repliers, TD::Types::Array.of(TD::Types::MessageSender) + attribute :recent_replier_ids, TD::Types::Array.of(TD::Types::MessageSender) attribute :last_read_inbox_message_id, TD::Types::Coercible::Integer attribute :last_read_outbox_message_id, TD::Types::Coercible::Integer attribute :last_message_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/message_reply_to.rb b/lib/tdlib/types/message_reply_to.rb new file mode 100644 index 00000000..40bbad8e --- /dev/null +++ b/lib/tdlib/types/message_reply_to.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains information about the message or the story a message is replying to. + class MessageReplyTo < Base + %w[ + message + story + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/message_reply_to/#{type}" + end + end +end diff --git a/lib/tdlib/types/message_reply_to/message.rb b/lib/tdlib/types/message_reply_to/message.rb new file mode 100644 index 00000000..54afcfa9 --- /dev/null +++ b/lib/tdlib/types/message_reply_to/message.rb @@ -0,0 +1,26 @@ +module TD::Types + # Describes a message replied by a given message. + # + # @attr chat_id [Integer] The identifier of the chat to which the message belongs; may be 0 if the replied message is + # in unknown chat. + # @attr message_id [Integer] The identifier of the message; may be 0 if the replied message is in unknown chat. + # @attr quote [TD::Types::TextQuote, nil] Chosen quote from the replied message; may be null if none. + # @attr origin [TD::Types::MessageOrigin, nil] Information about origin of the message if the message was from + # another chat or topic; may be null for messages from the same chat. + # @attr origin_send_date [Integer] Point in time (Unix timestamp) when the message was sent if the message was from + # another chat or topic; 0 for messages from the same chat. + # @attr content [TD::Types::MessageContent, nil] Media content of the message if the message was from another chat or + # topic; may be null for messages from the same chat and messages without media. + # Can be only one of the following types: messageAnimation, messageAudio, messageContact, messageDice, + # messageDocument, messageGame, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, + # messagePremiumGiveaway, messagePremiumGiveawayWinners, messageSticker, messageStory, {TD::Types::MessageContent::Text} + # (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote. + class MessageReplyTo::Message < MessageReplyTo + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :quote, TD::Types::TextQuote.optional.default(nil) + attribute :origin, TD::Types::MessageOrigin.optional.default(nil) + attribute :origin_send_date, TD::Types::Coercible::Integer + attribute :content, TD::Types::MessageContent.optional.default(nil) + end +end diff --git a/lib/tdlib/types/message_reply_to/story.rb b/lib/tdlib/types/message_reply_to/story.rb new file mode 100644 index 00000000..45f1f545 --- /dev/null +++ b/lib/tdlib/types/message_reply_to/story.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a story replied by a given message. + # + # @attr story_sender_chat_id [Integer] The identifier of the sender of the story. + # @attr story_id [Integer] The identifier of the story. + class MessageReplyTo::Story < MessageReplyTo + attribute :story_sender_chat_id, TD::Types::Coercible::Integer + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_scheduling_state/send_at_date.rb b/lib/tdlib/types/message_scheduling_state/send_at_date.rb index d41aa294..4af0611e 100644 --- a/lib/tdlib/types/message_scheduling_state/send_at_date.rb +++ b/lib/tdlib/types/message_scheduling_state/send_at_date.rb @@ -1,7 +1,7 @@ module TD::Types # The message will be sent at the specified date. # - # @attr send_date [Integer] Date the message will be sent. + # @attr send_date [Integer] Point in time (Unix timestamp) when the message will be sent. # The date must be within 367 days in the future. class MessageSchedulingState::SendAtDate < MessageSchedulingState attribute :send_date, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/message_scheduling_state/send_when_online.rb b/lib/tdlib/types/message_scheduling_state/send_when_online.rb index d5d9b588..be188732 100644 --- a/lib/tdlib/types/message_scheduling_state/send_when_online.rb +++ b/lib/tdlib/types/message_scheduling_state/send_when_online.rb @@ -1,6 +1,6 @@ module TD::Types - # The message will be sent when the peer will be online. - # Applicable to private chats only and when the exact online status of the peer is known. + # The message will be sent when the other user is online. + # Applicable to private chats only and when the exact online status of the other user is known. class MessageSchedulingState::SendWhenOnline < MessageSchedulingState end end diff --git a/lib/tdlib/types/message_self_destruct_type.rb b/lib/tdlib/types/message_self_destruct_type.rb new file mode 100644 index 00000000..33045e1a --- /dev/null +++ b/lib/tdlib/types/message_self_destruct_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes when a message will be self-destructed. + class MessageSelfDestructType < Base + %w[ + timer + immediately + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/message_self_destruct_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/message_self_destruct_type/immediately.rb b/lib/tdlib/types/message_self_destruct_type/immediately.rb new file mode 100644 index 00000000..1b98cca8 --- /dev/null +++ b/lib/tdlib/types/message_self_destruct_type/immediately.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message can be opened only once and will be self-destructed once closed. + class MessageSelfDestructType::Immediately < MessageSelfDestructType + end +end diff --git a/lib/tdlib/types/message_self_destruct_type/timer.rb b/lib/tdlib/types/message_self_destruct_type/timer.rb new file mode 100644 index 00000000..931e934b --- /dev/null +++ b/lib/tdlib/types/message_self_destruct_type/timer.rb @@ -0,0 +1,9 @@ +module TD::Types + # The message will be self-destructed in the specified time after its content was opened. + # + # @attr self_destruct_time [Integer] The message's self-destruct time, in seconds; must be between 0 and 60 in + # private chats. + class MessageSelfDestructType::Timer < MessageSelfDestructType + attribute :self_destruct_time, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_send_options.rb b/lib/tdlib/types/message_send_options.rb index 21b56893..5ea30388 100644 --- a/lib/tdlib/types/message_send_options.rb +++ b/lib/tdlib/types/message_send_options.rb @@ -3,11 +3,27 @@ module TD::Types # # @attr disable_notification [Boolean] Pass true to disable notification for the message. # @attr from_background [Boolean] Pass true if the message is sent from the background. - # @attr scheduling_state [TD::Types::MessageSchedulingState] Message scheduling state. + # @attr protect_content [Boolean] Pass true if the content of the message must be protected from forwarding and + # saving; for bots only. + # @attr update_order_of_installed_sticker_sets [Boolean] Pass true if the user explicitly chosen a sticker or a + # custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum. + # @attr scheduling_state [TD::Types::MessageSchedulingState] Message scheduling state; pass null to send message + # immediately. # Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled. + # @attr effect_id [Integer] Identifier of the effect to apply to the message; pass 0 if none; applicable only to + # sendMessage and sendMessageAlbum in private chats. + # @attr sending_id [Integer] Non-persistent identifier, which will be returned back in + # {TD::Types::MessageSendingState::Pending} object and can be used to match sent messages and corresponding + # {TD::Types::Update::NewMessage} updates. + # @attr only_preview [Boolean] Pass true to get a fake message instead of actually sending them. class MessageSendOptions < Base attribute :disable_notification, TD::Types::Bool attribute :from_background, TD::Types::Bool + attribute :protect_content, TD::Types::Bool + attribute :update_order_of_installed_sticker_sets, TD::Types::Bool attribute :scheduling_state, TD::Types::MessageSchedulingState + attribute :effect_id, TD::Types::Coercible::Integer + attribute :sending_id, TD::Types::Coercible::Integer + attribute :only_preview, TD::Types::Bool end end diff --git a/lib/tdlib/types/message_senders.rb b/lib/tdlib/types/message_senders.rb index 159339bb..d9fbd7d1 100644 --- a/lib/tdlib/types/message_senders.rb +++ b/lib/tdlib/types/message_senders.rb @@ -1,7 +1,7 @@ module TD::Types # Represents a list of message senders. # - # @attr total_count [Integer] Approximate total count of messages senders found. + # @attr total_count [Integer] Approximate total number of messages senders found. # @attr senders [Array] List of message senders. class MessageSenders < Base attribute :total_count, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/message_sending_state/failed.rb b/lib/tdlib/types/message_sending_state/failed.rb index 22a0e94e..6b7a713f 100644 --- a/lib/tdlib/types/message_sending_state/failed.rb +++ b/lib/tdlib/types/message_sending_state/failed.rb @@ -1,15 +1,22 @@ module TD::Types # The message failed to be sent. # - # @attr error_code [Integer] An error code; 0 if unknown. - # @attr error_message [TD::Types::String] Error message. - # @attr can_retry [Boolean] True, if the message can be re-sent. + # @attr error [TD::Types::Error] The cause of the message sending failure. + # @attr can_retry [Boolean] True, if the message can be re-sent using resendMessages or + # readdQuickReplyShortcutMessages. + # @attr need_another_sender [Boolean] True, if the message can be re-sent only on behalf of a different sender. + # @attr need_another_reply_quote [Boolean] True, if the message can be re-sent only if another quote is chosen in the + # message that is replied by the given message. + # @attr need_drop_reply [Boolean] True, if the message can be re-sent only if the message to be replied is removed. + # This will be done automatically by resendMessages. # @attr retry_after [Float] Time left before the message can be re-sent, in seconds. # No update is sent when this field changes. class MessageSendingState::Failed < MessageSendingState - attribute :error_code, TD::Types::Coercible::Integer - attribute :error_message, TD::Types::String + attribute :error, TD::Types::Error attribute :can_retry, TD::Types::Bool + attribute :need_another_sender, TD::Types::Bool + attribute :need_another_reply_quote, TD::Types::Bool + attribute :need_drop_reply, TD::Types::Bool attribute :retry_after, TD::Types::Coercible::Float end end diff --git a/lib/tdlib/types/message_sending_state/pending.rb b/lib/tdlib/types/message_sending_state/pending.rb index f21a1203..3963f831 100644 --- a/lib/tdlib/types/message_sending_state/pending.rb +++ b/lib/tdlib/types/message_sending_state/pending.rb @@ -1,5 +1,8 @@ module TD::Types # The message is being sent now, but has not yet been delivered to the server. + # + # @attr sending_id [Integer] Non-persistent message sending identifier, specified by the application. class MessageSendingState::Pending < MessageSendingState + attribute :sending_id, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/message_source.rb b/lib/tdlib/types/message_source.rb new file mode 100644 index 00000000..8798848d --- /dev/null +++ b/lib/tdlib/types/message_source.rb @@ -0,0 +1,19 @@ +module TD::Types + # Describes source of a message. + class MessageSource < Base + %w[ + chat_history + message_thread_history + forum_topic_history + history_preview + chat_list + search + chat_event_log + notification + screenshot + other + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/message_source/#{type}" + end + end +end diff --git a/lib/tdlib/types/message_source/chat_event_log.rb b/lib/tdlib/types/message_source/chat_event_log.rb new file mode 100644 index 00000000..e3d07a8f --- /dev/null +++ b/lib/tdlib/types/message_source/chat_event_log.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is from a chat event log. + class MessageSource::ChatEventLog < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/chat_history.rb b/lib/tdlib/types/message_source/chat_history.rb new file mode 100644 index 00000000..53390ae2 --- /dev/null +++ b/lib/tdlib/types/message_source/chat_history.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is from a chat history. + class MessageSource::ChatHistory < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/chat_list.rb b/lib/tdlib/types/message_source/chat_list.rb new file mode 100644 index 00000000..a18793fc --- /dev/null +++ b/lib/tdlib/types/message_source/chat_list.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is from a chat list or a forum topic list. + class MessageSource::ChatList < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/forum_topic_history.rb b/lib/tdlib/types/message_source/forum_topic_history.rb new file mode 100644 index 00000000..95200420 --- /dev/null +++ b/lib/tdlib/types/message_source/forum_topic_history.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is from a forum topic history. + class MessageSource::ForumTopicHistory < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/history_preview.rb b/lib/tdlib/types/message_source/history_preview.rb new file mode 100644 index 00000000..3da91052 --- /dev/null +++ b/lib/tdlib/types/message_source/history_preview.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is from chat, message thread or forum topic history preview. + class MessageSource::HistoryPreview < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/message_thread_history.rb b/lib/tdlib/types/message_source/message_thread_history.rb new file mode 100644 index 00000000..e4d67724 --- /dev/null +++ b/lib/tdlib/types/message_source/message_thread_history.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is from a message thread history. + class MessageSource::MessageThreadHistory < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/notification.rb b/lib/tdlib/types/message_source/notification.rb new file mode 100644 index 00000000..24149009 --- /dev/null +++ b/lib/tdlib/types/message_source/notification.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is from a notification. + class MessageSource::Notification < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/other.rb b/lib/tdlib/types/message_source/other.rb new file mode 100644 index 00000000..b09a932e --- /dev/null +++ b/lib/tdlib/types/message_source/other.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message is from some other source. + class MessageSource::Other < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/screenshot.rb b/lib/tdlib/types/message_source/screenshot.rb new file mode 100644 index 00000000..ebe80714 --- /dev/null +++ b/lib/tdlib/types/message_source/screenshot.rb @@ -0,0 +1,6 @@ +module TD::Types + # The message was screenshotted; the source must be used only if the message content was visible during the + # screenshot. + class MessageSource::Screenshot < MessageSource + end +end diff --git a/lib/tdlib/types/message_source/search.rb b/lib/tdlib/types/message_source/search.rb new file mode 100644 index 00000000..829c1951 --- /dev/null +++ b/lib/tdlib/types/message_source/search.rb @@ -0,0 +1,6 @@ +module TD::Types + # The message is from search results, including file downloads, local file list, outgoing document messages, + # calendar. + class MessageSource::Search < MessageSource + end +end diff --git a/lib/tdlib/types/message_sponsor.rb b/lib/tdlib/types/message_sponsor.rb new file mode 100644 index 00000000..c3a966d6 --- /dev/null +++ b/lib/tdlib/types/message_sponsor.rb @@ -0,0 +1,13 @@ +module TD::Types + # Information about the sponsor of a message. + # + # @attr url [TD::Types::String] URL of the sponsor to be opened when the message is clicked. + # @attr photo [TD::Types::Photo, nil] Photo of the sponsor; may be null if must not be shown. + # @attr info [TD::Types::String] Additional optional information about the sponsor to be shown along with the + # message. + class MessageSponsor < Base + attribute :url, TD::Types::String + attribute :photo, TD::Types::Photo.optional.default(nil) + attribute :info, TD::Types::String + end +end diff --git a/lib/tdlib/types/message_statistics.rb b/lib/tdlib/types/message_statistics.rb index e23e1aaa..855dfcc5 100644 --- a/lib/tdlib/types/message_statistics.rb +++ b/lib/tdlib/types/message_statistics.rb @@ -3,7 +3,9 @@ module TD::Types # # @attr message_interaction_graph [TD::Types::StatisticalGraph] A graph containing number of message views and # shares. + # @attr message_reaction_graph [TD::Types::StatisticalGraph] A graph containing number of message reactions. class MessageStatistics < Base attribute :message_interaction_graph, TD::Types::StatisticalGraph + attribute :message_reaction_graph, TD::Types::StatisticalGraph end end diff --git a/lib/tdlib/types/message_thread_info.rb b/lib/tdlib/types/message_thread_info.rb index b70b9fe1..a6576544 100644 --- a/lib/tdlib/types/message_thread_info.rb +++ b/lib/tdlib/types/message_thread_info.rb @@ -3,14 +3,17 @@ module TD::Types # # @attr chat_id [Integer] Identifier of the chat to which the message thread belongs. # @attr message_thread_id [Integer] Message thread identifier, unique within the chat. - # @attr reply_info [TD::Types::MessageReplyInfo] Contains information about the message thread. + # @attr reply_info [TD::Types::MessageReplyInfo, nil] Information about the message thread; may be null for forum + # topic threads. + # @attr unread_message_count [Integer] Approximate number of unread messages in the message thread. # @attr messages [Array] The messages from which the thread starts. - # The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). - # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the message thread; may be null. + # The messages are returned in reverse chronological order (i.e., in order of decreasing message_id). + # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the message thread; may be null if none. class MessageThreadInfo < Base attribute :chat_id, TD::Types::Coercible::Integer attribute :message_thread_id, TD::Types::Coercible::Integer - attribute :reply_info, TD::Types::MessageReplyInfo + attribute :reply_info, TD::Types::MessageReplyInfo.optional.default(nil) + attribute :unread_message_count, TD::Types::Coercible::Integer attribute :messages, TD::Types::Array.of(TD::Types::Message) attribute :draft_message, TD::Types::DraftMessage.optional.default(nil) end diff --git a/lib/tdlib/types/message_viewer.rb b/lib/tdlib/types/message_viewer.rb new file mode 100644 index 00000000..d434c444 --- /dev/null +++ b/lib/tdlib/types/message_viewer.rb @@ -0,0 +1,10 @@ +module TD::Types + # Represents a viewer of a message. + # + # @attr user_id [Integer] User identifier of the viewer. + # @attr view_date [Integer] Approximate point in time (Unix timestamp) when the message was viewed. + class MessageViewer < Base + attribute :user_id, TD::Types::Coercible::Integer + attribute :view_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/message_viewers.rb b/lib/tdlib/types/message_viewers.rb new file mode 100644 index 00000000..d6c72a9b --- /dev/null +++ b/lib/tdlib/types/message_viewers.rb @@ -0,0 +1,8 @@ +module TD::Types + # Represents a list of message viewers. + # + # @attr viewers [Array] List of message viewers. + class MessageViewers < Base + attribute :viewers, TD::Types::Array.of(TD::Types::MessageViewer) + end +end diff --git a/lib/tdlib/types/messages.rb b/lib/tdlib/types/messages.rb index 4d63f718..9759e442 100644 --- a/lib/tdlib/types/messages.rb +++ b/lib/tdlib/types/messages.rb @@ -1,7 +1,7 @@ module TD::Types # Contains a list of messages. # - # @attr total_count [Integer] Approximate total count of messages found. + # @attr total_count [Integer] Approximate total number of messages found. # @attr messages [Array, nil] List of messages; messages may be null. class Messages < Base attribute :total_count, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/network_statistics_entry/file.rb b/lib/tdlib/types/network_statistics_entry/file.rb index 479cacef..8502b14b 100644 --- a/lib/tdlib/types/network_statistics_entry/file.rb +++ b/lib/tdlib/types/network_statistics_entry/file.rb @@ -1,7 +1,8 @@ module TD::Types # Contains information about the total amount of data that was used to send and receive files. # - # @attr file_type [TD::Types::FileType] Type of the file the data is part of. + # @attr file_type [TD::Types::FileType] Type of the file the data is part of; pass null if the data isn't related to + # files. # @attr network_type [TD::Types::NetworkType] Type of the network the data was sent through. # Call setNetworkType to maintain the actual network type. # @attr sent_bytes [Integer] Total number of bytes sent. diff --git a/lib/tdlib/types/network_type.rb b/lib/tdlib/types/network_type.rb index 244d3ac5..2635695e 100644 --- a/lib/tdlib/types/network_type.rb +++ b/lib/tdlib/types/network_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Represents the type of a network. + # Represents the type of network. class NetworkType < Base %w[ none diff --git a/lib/tdlib/types/new_chat_privacy_settings.rb b/lib/tdlib/types/new_chat_privacy_settings.rb new file mode 100644 index 00000000..2f507eb1 --- /dev/null +++ b/lib/tdlib/types/new_chat_privacy_settings.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains privacy settings for new chats with non-contacts. + # + # @attr allow_new_chats_from_unknown_users [Boolean] True, if non-contacts users are able to write first to the + # current user. + # Telegram Premium subscribers are able to write first regardless of this setting. + class NewChatPrivacySettings < Base + attribute :allow_new_chats_from_unknown_users, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/notification.rb b/lib/tdlib/types/notification.rb index 1b24c6b1..396fae39 100644 --- a/lib/tdlib/types/notification.rb +++ b/lib/tdlib/types/notification.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr id [Integer] Unique persistent identifier of this notification. # @attr date [Integer] Notification date. - # @attr is_silent [Boolean] True, if the notification was initially silent. + # @attr is_silent [Boolean] True, if the notification was explicitly sent without sound. # @attr type [TD::Types::NotificationType] Notification type. class Notification < Base attribute :id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/notification_settings_scope.rb b/lib/tdlib/types/notification_settings_scope.rb index 6b0f98e7..09e34746 100644 --- a/lib/tdlib/types/notification_settings_scope.rb +++ b/lib/tdlib/types/notification_settings_scope.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the types of chats to which notification settings are applied. + # Describes the types of chats to which notification settings are relevant. class NotificationSettingsScope < Base %w[ private_chats diff --git a/lib/tdlib/types/notification_settings_scope/channel_chats.rb b/lib/tdlib/types/notification_settings_scope/channel_chats.rb index 31ae655a..33e3418a 100644 --- a/lib/tdlib/types/notification_settings_scope/channel_chats.rb +++ b/lib/tdlib/types/notification_settings_scope/channel_chats.rb @@ -1,5 +1,5 @@ module TD::Types - # Notification settings applied to all channels when the corresponding chat setting has a default value. + # Notification settings applied to all channel chats when the corresponding chat setting has a default value. class NotificationSettingsScope::ChannelChats < NotificationSettingsScope end end diff --git a/lib/tdlib/types/notification_settings_scope/group_chats.rb b/lib/tdlib/types/notification_settings_scope/group_chats.rb index c64f8cc2..eb6917ab 100644 --- a/lib/tdlib/types/notification_settings_scope/group_chats.rb +++ b/lib/tdlib/types/notification_settings_scope/group_chats.rb @@ -1,6 +1,6 @@ module TD::Types - # Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default - # value. + # Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a + # default value. class NotificationSettingsScope::GroupChats < NotificationSettingsScope end end diff --git a/lib/tdlib/types/notification_sound.rb b/lib/tdlib/types/notification_sound.rb new file mode 100644 index 00000000..193dec06 --- /dev/null +++ b/lib/tdlib/types/notification_sound.rb @@ -0,0 +1,18 @@ +module TD::Types + # Describes a notification sound in MP3 format. + # + # @attr id [Integer] Unique identifier of the notification sound. + # @attr duration [Integer] Duration of the sound, in seconds. + # @attr date [Integer] Point in time (Unix timestamp) when the sound was created. + # @attr title [TD::Types::String] Title of the notification sound. + # @attr data [TD::Types::String] Arbitrary data, defined while the sound was uploaded. + # @attr sound [TD::Types::File] File containing the sound. + class NotificationSound < Base + attribute :id, TD::Types::Coercible::Integer + attribute :duration, TD::Types::Coercible::Integer + attribute :date, TD::Types::Coercible::Integer + attribute :title, TD::Types::String + attribute :data, TD::Types::String + attribute :sound, TD::Types::File + end +end diff --git a/lib/tdlib/types/notification_sounds.rb b/lib/tdlib/types/notification_sounds.rb new file mode 100644 index 00000000..148a3410 --- /dev/null +++ b/lib/tdlib/types/notification_sounds.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of notification sounds. + # + # @attr notification_sounds [Array] A list of notification sounds. + class NotificationSounds < Base + attribute :notification_sounds, TD::Types::Array.of(TD::Types::NotificationSound) + end +end diff --git a/lib/tdlib/types/notification_type/new_message.rb b/lib/tdlib/types/notification_type/new_message.rb index 849a52f4..2768d593 100644 --- a/lib/tdlib/types/notification_type/new_message.rb +++ b/lib/tdlib/types/notification_type/new_message.rb @@ -2,7 +2,9 @@ module TD::Types # New message was received. # # @attr message [TD::Types::Message] The message. + # @attr show_preview [Boolean] True, if message content must be displayed in notifications. class NotificationType::NewMessage < NotificationType attribute :message, TD::Types::Message + attribute :show_preview, TD::Types::Bool end end diff --git a/lib/tdlib/types/notification_type/new_push_message.rb b/lib/tdlib/types/notification_type/new_push_message.rb index 46802c9f..bd2b3c10 100644 --- a/lib/tdlib/types/notification_type/new_push_message.rb +++ b/lib/tdlib/types/notification_type/new_push_message.rb @@ -2,16 +2,16 @@ module TD::Types # New message was received through a push notification. # # @attr message_id [Integer] The message identifier. - # The message will not be available in the chat history, but the ID can be used in viewMessages, or as - # reply_to_message_id. - # @attr sender [TD::Types::MessageSender] The sender of the message. + # The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a + # message to be replied in the same chat. + # @attr sender_id [TD::Types::MessageSender] Identifier of the sender of the message. # Corresponding user or chat may be inaccessible. # @attr sender_name [TD::Types::String] Name of the sender. # @attr is_outgoing [Boolean] True, if the message is outgoing. # @attr content [TD::Types::PushMessageContent] Push message content. class NotificationType::NewPushMessage < NotificationType attribute :message_id, TD::Types::Coercible::Integer - attribute :sender, TD::Types::MessageSender + attribute :sender_id, TD::Types::MessageSender attribute :sender_name, TD::Types::String attribute :is_outgoing, TD::Types::Bool attribute :content, TD::Types::PushMessageContent diff --git a/lib/tdlib/types/page_block.rb b/lib/tdlib/types/page_block.rb index cf37c80e..bf5ee705 100644 --- a/lib/tdlib/types/page_block.rb +++ b/lib/tdlib/types/page_block.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes a block of an instant view web page. + # Describes a block of an instant view for a web page. class PageBlock < Base %w[ title diff --git a/lib/tdlib/types/page_block/animation.rb b/lib/tdlib/types/page_block/animation.rb index ed0b0b21..57513050 100644 --- a/lib/tdlib/types/page_block/animation.rb +++ b/lib/tdlib/types/page_block/animation.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr animation [TD::Types::Animation, nil] Animation file; may be null. # @attr caption [TD::Types::PageBlockCaption] Animation caption. - # @attr need_autoplay [Boolean] True, if the animation should be played automatically. + # @attr need_autoplay [Boolean] True, if the animation must be played automatically. class PageBlock::Animation < PageBlock attribute :animation, TD::Types::Animation.optional.default(nil) attribute :caption, TD::Types::PageBlockCaption diff --git a/lib/tdlib/types/page_block/chat_link.rb b/lib/tdlib/types/page_block/chat_link.rb index 1d0e7fdc..684b180e 100644 --- a/lib/tdlib/types/page_block/chat_link.rb +++ b/lib/tdlib/types/page_block/chat_link.rb @@ -3,10 +3,12 @@ module TD::Types # # @attr title [TD::Types::String] Chat title. # @attr photo [TD::Types::ChatPhotoInfo, nil] Chat photo; may be null. - # @attr username [TD::Types::String] Chat username, by which all other information about the chat should be resolved. + # @attr accent_color_id [Integer] Identifier of the accent color for chat title and background of chat photo. + # @attr username [TD::Types::String] Chat username by which all other information about the chat can be resolved. class PageBlock::ChatLink < PageBlock attribute :title, TD::Types::String attribute :photo, TD::Types::ChatPhotoInfo.optional.default(nil) + attribute :accent_color_id, TD::Types::Coercible::Integer attribute :username, TD::Types::String end end diff --git a/lib/tdlib/types/page_block/embedded.rb b/lib/tdlib/types/page_block/embedded.rb index e1e8e1f2..2974e891 100644 --- a/lib/tdlib/types/page_block/embedded.rb +++ b/lib/tdlib/types/page_block/embedded.rb @@ -1,14 +1,14 @@ module TD::Types # An embedded web page. # - # @attr url [TD::Types::String, nil] Web page URL, if available. + # @attr url [TD::Types::String, nil] URL of the embedded page, if available. # @attr html [TD::Types::String] HTML-markup of the embedded page. # @attr poster_photo [TD::Types::Photo, nil] Poster photo, if available; may be null. # @attr width [Integer] Block width; 0 if unknown. # @attr height [Integer] Block height; 0 if unknown. # @attr caption [TD::Types::PageBlockCaption] Block caption. - # @attr is_full_width [Boolean] True, if the block should be full width. - # @attr allow_scrolling [Boolean] True, if scrolling should be allowed. + # @attr is_full_width [Boolean] True, if the block must be full width. + # @attr allow_scrolling [Boolean] True, if scrolling needs to be allowed. class PageBlock::Embedded < PageBlock attribute :url, TD::Types::String.optional.default(nil) attribute :html, TD::Types::String diff --git a/lib/tdlib/types/page_block/embedded_post.rb b/lib/tdlib/types/page_block/embedded_post.rb index 075684a4..e2620121 100644 --- a/lib/tdlib/types/page_block/embedded_post.rb +++ b/lib/tdlib/types/page_block/embedded_post.rb @@ -1,7 +1,7 @@ module TD::Types # An embedded post. # - # @attr url [TD::Types::String] Web page URL. + # @attr url [TD::Types::String] URL of the embedded post. # @attr author [TD::Types::String] Post author. # @attr author_photo [TD::Types::Photo, nil] Post author photo; may be null. # @attr date [Integer] Point in time (Unix timestamp) when the post was created; 0 if unknown. diff --git a/lib/tdlib/types/page_block/preformatted.rb b/lib/tdlib/types/page_block/preformatted.rb index 8901a09d..ce9ff6aa 100644 --- a/lib/tdlib/types/page_block/preformatted.rb +++ b/lib/tdlib/types/page_block/preformatted.rb @@ -2,7 +2,7 @@ module TD::Types # A preformatted text paragraph. # # @attr text [TD::Types::RichText] Paragraph text. - # @attr language [TD::Types::String] Programming language for which the text should be formatted. + # @attr language [TD::Types::String] Programming language for which the text needs to be formatted. class PageBlock::Preformatted < PageBlock attribute :text, TD::Types::RichText attribute :language, TD::Types::String diff --git a/lib/tdlib/types/page_block/video.rb b/lib/tdlib/types/page_block/video.rb index a0f26134..cced2f2d 100644 --- a/lib/tdlib/types/page_block/video.rb +++ b/lib/tdlib/types/page_block/video.rb @@ -3,8 +3,8 @@ module TD::Types # # @attr video [TD::Types::Video, nil] Video file; may be null. # @attr caption [TD::Types::PageBlockCaption] Video caption. - # @attr need_autoplay [Boolean] True, if the video should be played automatically. - # @attr is_looped [Boolean] True, if the video should be looped. + # @attr need_autoplay [Boolean] True, if the video must be played automatically. + # @attr is_looped [Boolean] True, if the video must be looped. class PageBlock::Video < PageBlock attribute :video, TD::Types::Video.optional.default(nil) attribute :caption, TD::Types::PageBlockCaption diff --git a/lib/tdlib/types/page_block_caption.rb b/lib/tdlib/types/page_block_caption.rb index f7e12528..85b2aba0 100644 --- a/lib/tdlib/types/page_block_caption.rb +++ b/lib/tdlib/types/page_block_caption.rb @@ -1,5 +1,5 @@ module TD::Types - # Contains a caption of an instant view web page block, consisting of a text and a trailing credit. + # Contains a caption of another block. # # @attr text [TD::Types::RichText] Content of the caption. # @attr credit [TD::Types::RichText] Block credit (like HTML tag ). diff --git a/lib/tdlib/types/page_block_horizontal_alignment/center.rb b/lib/tdlib/types/page_block_horizontal_alignment/center.rb index 46daf4e4..abbf0a78 100644 --- a/lib/tdlib/types/page_block_horizontal_alignment/center.rb +++ b/lib/tdlib/types/page_block_horizontal_alignment/center.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be center-aligned. + # The content must be center-aligned. class PageBlockHorizontalAlignment::Center < PageBlockHorizontalAlignment end end diff --git a/lib/tdlib/types/page_block_horizontal_alignment/left.rb b/lib/tdlib/types/page_block_horizontal_alignment/left.rb index 6d51f052..be0a6bed 100644 --- a/lib/tdlib/types/page_block_horizontal_alignment/left.rb +++ b/lib/tdlib/types/page_block_horizontal_alignment/left.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be left-aligned. + # The content must be left-aligned. class PageBlockHorizontalAlignment::Left < PageBlockHorizontalAlignment end end diff --git a/lib/tdlib/types/page_block_horizontal_alignment/right.rb b/lib/tdlib/types/page_block_horizontal_alignment/right.rb index 542bc55c..53c46dee 100644 --- a/lib/tdlib/types/page_block_horizontal_alignment/right.rb +++ b/lib/tdlib/types/page_block_horizontal_alignment/right.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be right-aligned. + # The content must be right-aligned. class PageBlockHorizontalAlignment::Right < PageBlockHorizontalAlignment end end diff --git a/lib/tdlib/types/page_block_table_cell.rb b/lib/tdlib/types/page_block_table_cell.rb index 442a23b7..19fa78bb 100644 --- a/lib/tdlib/types/page_block_table_cell.rb +++ b/lib/tdlib/types/page_block_table_cell.rb @@ -2,10 +2,10 @@ module TD::Types # Represents a cell of a table. # # @attr text [TD::Types::RichText, nil] Cell text; may be null. - # If the text is null, then the cell should be invisible. + # If the text is null, then the cell must be invisible. # @attr is_header [Boolean] True, if it is a header cell. - # @attr colspan [Integer] The number of columns the cell should span. - # @attr rowspan [Integer] The number of rows the cell should span. + # @attr colspan [Integer] The number of columns the cell spans. + # @attr rowspan [Integer] The number of rows the cell spans. # @attr align [TD::Types::PageBlockHorizontalAlignment] Horizontal cell content alignment. # @attr valign [TD::Types::PageBlockVerticalAlignment] Vertical cell content alignment. class PageBlockTableCell < Base diff --git a/lib/tdlib/types/page_block_vertical_alignment/bottom.rb b/lib/tdlib/types/page_block_vertical_alignment/bottom.rb index 6a0b6952..110873ba 100644 --- a/lib/tdlib/types/page_block_vertical_alignment/bottom.rb +++ b/lib/tdlib/types/page_block_vertical_alignment/bottom.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be bottom-aligned. + # The content must be bottom-aligned. class PageBlockVerticalAlignment::Bottom < PageBlockVerticalAlignment end end diff --git a/lib/tdlib/types/page_block_vertical_alignment/middle.rb b/lib/tdlib/types/page_block_vertical_alignment/middle.rb index 13b9a5dd..8361eb95 100644 --- a/lib/tdlib/types/page_block_vertical_alignment/middle.rb +++ b/lib/tdlib/types/page_block_vertical_alignment/middle.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be middle-aligned. + # The content must be middle-aligned. class PageBlockVerticalAlignment::Middle < PageBlockVerticalAlignment end end diff --git a/lib/tdlib/types/page_block_vertical_alignment/top.rb b/lib/tdlib/types/page_block_vertical_alignment/top.rb index 5a662b75..118d938c 100644 --- a/lib/tdlib/types/page_block_vertical_alignment/top.rb +++ b/lib/tdlib/types/page_block_vertical_alignment/top.rb @@ -1,5 +1,5 @@ module TD::Types - # The content should be top-aligned. + # The content must be top-aligned. class PageBlockVerticalAlignment::Top < PageBlockVerticalAlignment end end diff --git a/lib/tdlib/types/paid_media.rb b/lib/tdlib/types/paid_media.rb new file mode 100644 index 00000000..3948373d --- /dev/null +++ b/lib/tdlib/types/paid_media.rb @@ -0,0 +1,13 @@ +module TD::Types + # Describes a paid media. + class PaidMedia < Base + %w[ + preview + photo + video + unsupported + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/paid_media/#{type}" + end + end +end diff --git a/lib/tdlib/types/paid_media/photo.rb b/lib/tdlib/types/paid_media/photo.rb new file mode 100644 index 00000000..5bc387e8 --- /dev/null +++ b/lib/tdlib/types/paid_media/photo.rb @@ -0,0 +1,8 @@ +module TD::Types + # The media is a photo. + # + # @attr photo [TD::Types::Photo] The photo. + class PaidMedia::Photo < PaidMedia + attribute :photo, TD::Types::Photo + end +end diff --git a/lib/tdlib/types/paid_media/preview.rb b/lib/tdlib/types/paid_media/preview.rb new file mode 100644 index 00000000..e686d397 --- /dev/null +++ b/lib/tdlib/types/paid_media/preview.rb @@ -0,0 +1,14 @@ +module TD::Types + # The media is hidden until the invoice is paid. + # + # @attr width [Integer] Media width; 0 if unknown. + # @attr height [Integer] Media height; 0 if unknown. + # @attr duration [Integer] Media duration, in seconds; 0 if unknown. + # @attr minithumbnail [TD::Types::Minithumbnail, nil] Media minithumbnail; may be null. + class PaidMedia::Preview < PaidMedia + attribute :width, TD::Types::Coercible::Integer + attribute :height, TD::Types::Coercible::Integer + attribute :duration, TD::Types::Coercible::Integer + attribute :minithumbnail, TD::Types::Minithumbnail.optional.default(nil) + end +end diff --git a/lib/tdlib/types/paid_media/unsupported.rb b/lib/tdlib/types/paid_media/unsupported.rb new file mode 100644 index 00000000..34801e39 --- /dev/null +++ b/lib/tdlib/types/paid_media/unsupported.rb @@ -0,0 +1,5 @@ +module TD::Types + # The media is unsupported. + class PaidMedia::Unsupported < PaidMedia + end +end diff --git a/lib/tdlib/types/paid_media/video.rb b/lib/tdlib/types/paid_media/video.rb new file mode 100644 index 00000000..06637f93 --- /dev/null +++ b/lib/tdlib/types/paid_media/video.rb @@ -0,0 +1,8 @@ +module TD::Types + # The media is a video. + # + # @attr video [TD::Types::Video] The video. + class PaidMedia::Video < PaidMedia + attribute :video, TD::Types::Video + end +end diff --git a/lib/tdlib/types/paid_reactor.rb b/lib/tdlib/types/paid_reactor.rb new file mode 100644 index 00000000..ab970a5c --- /dev/null +++ b/lib/tdlib/types/paid_reactor.rb @@ -0,0 +1,18 @@ +module TD::Types + # Contains information about a user that added paid reactions. + # + # @attr sender_id [TD::Types::MessageSender, nil] Identifier of the user or chat that added the reactions; may be + # null for anonymous reactors that aren't the current user. + # @attr star_count [Integer] Number of Telegram Stars added. + # @attr is_top [Boolean] True, if the reactor is one of the most active reactors; can be false if the reactor is the + # current user. + # @attr is_me [Boolean] True, if the paid reaction was added by the current user. + # @attr is_anonymous [Boolean] True, if the reactor is anonymous. + class PaidReactor < Base + attribute :sender_id, TD::Types::MessageSender.optional.default(nil) + attribute :star_count, TD::Types::Coercible::Integer + attribute :is_top, TD::Types::Bool + attribute :is_me, TD::Types::Bool + attribute :is_anonymous, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/passport_authorization_form.rb b/lib/tdlib/types/passport_authorization_form.rb index b880128b..0c1fb627 100644 --- a/lib/tdlib/types/passport_authorization_form.rb +++ b/lib/tdlib/types/passport_authorization_form.rb @@ -2,8 +2,8 @@ module TD::Types # Contains information about a Telegram Passport authorization form that was requested. # # @attr id [Integer] Unique identifier of the authorization form. - # @attr required_elements [Array] Information about the Telegram Passport - # elements that must be provided to complete the form. + # @attr required_elements [Array] Telegram Passport elements that must be + # provided to complete the form. # @attr privacy_policy_url [TD::Types::String, nil] URL for the privacy policy of the service; may be empty. class PassportAuthorizationForm < Base attribute :id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/passport_element_type.rb b/lib/tdlib/types/passport_element_type.rb index 75e051ab..31263cb2 100644 --- a/lib/tdlib/types/passport_element_type.rb +++ b/lib/tdlib/types/passport_element_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Contains the type of a Telegram Passport element. + # Contains the type of Telegram Passport element. class PassportElementType < Base %w[ personal_details diff --git a/lib/tdlib/types/password_state.rb b/lib/tdlib/types/password_state.rb index 6e975f1f..7154860c 100644 --- a/lib/tdlib/types/password_state.rb +++ b/lib/tdlib/types/password_state.rb @@ -7,11 +7,16 @@ module TD::Types # @attr has_passport_data [Boolean] True, if some Telegram Passport elements were saved. # @attr recovery_email_address_code_info [TD::Types::EmailAddressAuthenticationCodeInfo, nil] Information about the # recovery email address to which the confirmation email was sent; may be null. + # @attr login_email_address_pattern [TD::Types::String] Pattern of the email address set up for logging in. + # @attr pending_reset_date [Integer] If not 0, point in time (Unix timestamp) after which the 2-step verification + # password can be reset immediately using resetPassword. class PasswordState < Base attribute :has_password, TD::Types::Bool attribute :password_hint, TD::Types::String.optional.default(nil) attribute :has_recovery_email_address, TD::Types::Bool attribute :has_passport_data, TD::Types::Bool attribute :recovery_email_address_code_info, TD::Types::EmailAddressAuthenticationCodeInfo.optional.default(nil) + attribute :login_email_address_pattern, TD::Types::String + attribute :pending_reset_date, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/payment_form.rb b/lib/tdlib/types/payment_form.rb index 486fb86e..76cd735b 100644 --- a/lib/tdlib/types/payment_form.rb +++ b/lib/tdlib/types/payment_form.rb @@ -2,28 +2,13 @@ module TD::Types # Contains information about an invoice payment form. # # @attr id [Integer] The payment form identifier. - # @attr invoice [TD::Types::Invoice] Full information of the invoice. - # @attr url [TD::Types::String] Payment form URL. + # @attr type [TD::Types::PaymentFormType] Type of the payment form. # @attr seller_bot_user_id [Integer] User identifier of the seller bot. - # @attr payments_provider_user_id [Integer] User identifier of the payment provider bot. - # @attr payments_provider [TD::Types::PaymentsProviderStripe, nil] Contains information about the payment provider, - # if available, to support it natively without the need for opening the URL; may be null. - # @attr saved_order_info [TD::Types::OrderInfo, nil] Saved server-side order information; may be null. - # @attr saved_credentials [TD::Types::SavedCredentials, nil] Contains information about saved card credentials; may - # be null. - # @attr can_save_credentials [Boolean] True, if the user can choose to save credentials. - # @attr need_password [Boolean] True, if the user will be able to save credentials protected by a password they set - # up. + # @attr product_info [TD::Types::ProductInfo] Information about the product. class PaymentForm < Base attribute :id, TD::Types::Coercible::Integer - attribute :invoice, TD::Types::Invoice - attribute :url, TD::Types::String + attribute :type, TD::Types::PaymentFormType attribute :seller_bot_user_id, TD::Types::Coercible::Integer - attribute :payments_provider_user_id, TD::Types::Coercible::Integer - attribute :payments_provider, TD::Types::PaymentsProviderStripe.optional.default(nil) - attribute :saved_order_info, TD::Types::OrderInfo.optional.default(nil) - attribute :saved_credentials, TD::Types::SavedCredentials.optional.default(nil) - attribute :can_save_credentials, TD::Types::Bool - attribute :need_password, TD::Types::Bool + attribute :product_info, TD::Types::ProductInfo end end diff --git a/lib/tdlib/types/payment_form_theme.rb b/lib/tdlib/types/payment_form_theme.rb deleted file mode 100644 index 0fc53d3a..00000000 --- a/lib/tdlib/types/payment_form_theme.rb +++ /dev/null @@ -1,18 +0,0 @@ -module TD::Types - # Theme colors for a payment form. - # - # @attr background_color [Integer] A color of the payment form background in the RGB24 format. - # @attr text_color [Integer] A color of text in the RGB24 format. - # @attr hint_color [Integer] A color of hints in the RGB24 format. - # @attr link_color [Integer] A color of links in the RGB24 format. - # @attr button_color [Integer] A color of thebuttons in the RGB24 format. - # @attr button_text_color [Integer] A color of text on the buttons in the RGB24 format. - class PaymentFormTheme < Base - attribute :background_color, TD::Types::Coercible::Integer - attribute :text_color, TD::Types::Coercible::Integer - attribute :hint_color, TD::Types::Coercible::Integer - attribute :link_color, TD::Types::Coercible::Integer - attribute :button_color, TD::Types::Coercible::Integer - attribute :button_text_color, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/payment_form_type.rb b/lib/tdlib/types/payment_form_type.rb new file mode 100644 index 00000000..006da5d7 --- /dev/null +++ b/lib/tdlib/types/payment_form_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes type of payment form. + class PaymentFormType < Base + %w[ + regular + stars + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/payment_form_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/payment_form_type/regular.rb b/lib/tdlib/types/payment_form_type/regular.rb new file mode 100644 index 00000000..9dcd0c25 --- /dev/null +++ b/lib/tdlib/types/payment_form_type/regular.rb @@ -0,0 +1,23 @@ +module TD::Types + # The payment form is for a regular payment. + # + # @attr invoice [TD::Types::Invoice] Full information about the invoice. + # @attr payment_provider_user_id [Integer] User identifier of the payment provider bot. + # @attr payment_provider [TD::Types::PaymentProvider] Information about the payment provider. + # @attr additional_payment_options [Array] The list of additional payment options. + # @attr saved_order_info [TD::Types::OrderInfo, nil] Saved server-side order information; may be null. + # @attr saved_credentials [Array] The list of saved payment credentials. + # @attr can_save_credentials [Boolean] True, if the user can choose to save credentials. + # @attr need_password [Boolean] True, if the user will be able to save credentials, if sets up a 2-step verification + # password. + class PaymentFormType::Regular < PaymentFormType + attribute :invoice, TD::Types::Invoice + attribute :payment_provider_user_id, TD::Types::Coercible::Integer + attribute :payment_provider, TD::Types::PaymentProvider + attribute :additional_payment_options, TD::Types::Array.of(TD::Types::PaymentOption) + attribute :saved_order_info, TD::Types::OrderInfo.optional.default(nil) + attribute :saved_credentials, TD::Types::Array.of(TD::Types::SavedCredentials) + attribute :can_save_credentials, TD::Types::Bool + attribute :need_password, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/payment_form_type/stars.rb b/lib/tdlib/types/payment_form_type/stars.rb new file mode 100644 index 00000000..3b986332 --- /dev/null +++ b/lib/tdlib/types/payment_form_type/stars.rb @@ -0,0 +1,8 @@ +module TD::Types + # The payment form is for a payment in Telegram Stars. + # + # @attr star_count [Integer] Number of Telegram Stars that will be paid. + class PaymentFormType::Stars < PaymentFormType + attribute :star_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/payment_option.rb b/lib/tdlib/types/payment_option.rb new file mode 100644 index 00000000..0a127821 --- /dev/null +++ b/lib/tdlib/types/payment_option.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes an additional payment option. + # + # @attr title [TD::Types::String] Title for the payment option. + # @attr url [TD::Types::String] Payment form URL to be opened in a web view. + class PaymentOption < Base + attribute :title, TD::Types::String + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/payment_provider.rb b/lib/tdlib/types/payment_provider.rb new file mode 100644 index 00000000..6bf6d1b2 --- /dev/null +++ b/lib/tdlib/types/payment_provider.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains information about a payment provider. + class PaymentProvider < Base + %w[ + smart_glocal + stripe + other + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/payment_provider/#{type}" + end + end +end diff --git a/lib/tdlib/types/payment_provider/other.rb b/lib/tdlib/types/payment_provider/other.rb new file mode 100644 index 00000000..66145f14 --- /dev/null +++ b/lib/tdlib/types/payment_provider/other.rb @@ -0,0 +1,8 @@ +module TD::Types + # Some other payment provider, for which a web payment form must be shown. + # + # @attr url [TD::Types::String] Payment form URL. + class PaymentProvider::Other < PaymentProvider + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/payment_provider/smart_glocal.rb b/lib/tdlib/types/payment_provider/smart_glocal.rb new file mode 100644 index 00000000..658cd8de --- /dev/null +++ b/lib/tdlib/types/payment_provider/smart_glocal.rb @@ -0,0 +1,10 @@ +module TD::Types + # Smart Glocal payment provider. + # + # @attr public_token [TD::Types::String] Public payment token. + # @attr tokenize_url [TD::Types::String] URL for sending card tokenization requests. + class PaymentProvider::SmartGlocal < PaymentProvider + attribute :public_token, TD::Types::String + attribute :tokenize_url, TD::Types::String + end +end diff --git a/lib/tdlib/types/payments_provider_stripe.rb b/lib/tdlib/types/payment_provider/stripe.rb similarity index 92% rename from lib/tdlib/types/payments_provider_stripe.rb rename to lib/tdlib/types/payment_provider/stripe.rb index 31ceb1b4..0e8fe963 100644 --- a/lib/tdlib/types/payments_provider_stripe.rb +++ b/lib/tdlib/types/payment_provider/stripe.rb @@ -5,7 +5,7 @@ module TD::Types # @attr need_country [Boolean] True, if the user country must be provided. # @attr need_postal_code [Boolean] True, if the user ZIP/postal code must be provided. # @attr need_cardholder_name [Boolean] True, if the cardholder name must be provided. - class PaymentsProviderStripe < Base + class PaymentProvider::Stripe < PaymentProvider attribute :publishable_key, TD::Types::String attribute :need_country, TD::Types::Bool attribute :need_postal_code, TD::Types::Bool diff --git a/lib/tdlib/types/payment_receipt.rb b/lib/tdlib/types/payment_receipt.rb index 128c6f26..91160c5c 100644 --- a/lib/tdlib/types/payment_receipt.rb +++ b/lib/tdlib/types/payment_receipt.rb @@ -1,28 +1,14 @@ module TD::Types # Contains information about a successful payment. # - # @attr title [TD::Types::String] Product title. - # @attr description [TD::Types::String] Product description. - # @attr photo [TD::Types::Photo, nil] Product photo; may be null. + # @attr product_info [TD::Types::ProductInfo] Information about the product. # @attr date [Integer] Point in time (Unix timestamp) when the payment was made. # @attr seller_bot_user_id [Integer] User identifier of the seller bot. - # @attr payments_provider_user_id [Integer] User identifier of the payment provider bot. - # @attr invoice [TD::Types::Invoice] Contains information about the invoice. - # @attr order_info [TD::Types::OrderInfo, nil] Order information; may be null. - # @attr shipping_option [TD::Types::ShippingOption, nil] Chosen shipping option; may be null. - # @attr credentials_title [TD::Types::String] Title of the saved credentials chosen by the buyer. - # @attr tip_amount [Integer] The amount of tip chosen by the buyer in the smallest units of the currency. + # @attr type [TD::Types::PaymentReceiptType] Type of the payment receipt. class PaymentReceipt < Base - attribute :title, TD::Types::String - attribute :description, TD::Types::String - attribute :photo, TD::Types::Photo.optional.default(nil) + attribute :product_info, TD::Types::ProductInfo attribute :date, TD::Types::Coercible::Integer attribute :seller_bot_user_id, TD::Types::Coercible::Integer - attribute :payments_provider_user_id, TD::Types::Coercible::Integer - attribute :invoice, TD::Types::Invoice - attribute :order_info, TD::Types::OrderInfo.optional.default(nil) - attribute :shipping_option, TD::Types::ShippingOption.optional.default(nil) - attribute :credentials_title, TD::Types::String - attribute :tip_amount, TD::Types::Coercible::Integer + attribute :type, TD::Types::PaymentReceiptType end end diff --git a/lib/tdlib/types/payment_receipt_type.rb b/lib/tdlib/types/payment_receipt_type.rb new file mode 100644 index 00000000..89d7dfcf --- /dev/null +++ b/lib/tdlib/types/payment_receipt_type.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes type of successful payment. + class PaymentReceiptType < Base + %w[ + regular + stars + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/payment_receipt_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/payment_receipt_type/regular.rb b/lib/tdlib/types/payment_receipt_type/regular.rb new file mode 100644 index 00000000..b719f83c --- /dev/null +++ b/lib/tdlib/types/payment_receipt_type/regular.rb @@ -0,0 +1,18 @@ +module TD::Types + # The payment was done using a third-party payment provider. + # + # @attr payment_provider_user_id [Integer] User identifier of the payment provider bot. + # @attr invoice [TD::Types::Invoice] Information about the invoice. + # @attr order_info [TD::Types::OrderInfo, nil] Order information; may be null. + # @attr shipping_option [TD::Types::ShippingOption, nil] Chosen shipping option; may be null. + # @attr credentials_title [TD::Types::String] Title of the saved credentials chosen by the buyer. + # @attr tip_amount [Integer] The amount of tip chosen by the buyer in the smallest units of the currency. + class PaymentReceiptType::Regular < PaymentReceiptType + attribute :payment_provider_user_id, TD::Types::Coercible::Integer + attribute :invoice, TD::Types::Invoice + attribute :order_info, TD::Types::OrderInfo.optional.default(nil) + attribute :shipping_option, TD::Types::ShippingOption.optional.default(nil) + attribute :credentials_title, TD::Types::String + attribute :tip_amount, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/payment_receipt_type/stars.rb b/lib/tdlib/types/payment_receipt_type/stars.rb new file mode 100644 index 00000000..049e25e6 --- /dev/null +++ b/lib/tdlib/types/payment_receipt_type/stars.rb @@ -0,0 +1,10 @@ +module TD::Types + # The payment was done using Telegram Stars. + # + # @attr star_count [Integer] Number of Telegram Stars that were paid. + # @attr transaction_id [TD::Types::String] Unique identifier of the transaction that can be used to dispute it. + class PaymentReceiptType::Stars < PaymentReceiptType + attribute :star_count, TD::Types::Coercible::Integer + attribute :transaction_id, TD::Types::String + end +end diff --git a/lib/tdlib/types/payment_result.rb b/lib/tdlib/types/payment_result.rb index 48556488..ccd3fee1 100644 --- a/lib/tdlib/types/payment_result.rb +++ b/lib/tdlib/types/payment_result.rb @@ -1,8 +1,8 @@ module TD::Types # Contains the result of a payment request. # - # @attr success [Boolean] True, if the payment request was successful; otherwise the verification_url will be not - # empty. + # @attr success [Boolean] True, if the payment request was successful; otherwise, the verification_url will be + # non-empty. # @attr verification_url [TD::Types::String] URL for additional payment credentials verification. class PaymentResult < Base attribute :success, TD::Types::Bool diff --git a/lib/tdlib/types/phone_number_authentication_settings.rb b/lib/tdlib/types/phone_number_authentication_settings.rb index dd58d2dd..2387a5fb 100644 --- a/lib/tdlib/types/phone_number_authentication_settings.rb +++ b/lib/tdlib/types/phone_number_authentication_settings.rb @@ -1,16 +1,29 @@ module TD::Types # Contains settings for the authentication of the user's phone number. # - # @attr allow_flash_call [Boolean] Pass true if the authentication code may be sent via flash call to the specified + # @attr allow_flash_call [Boolean] Pass true if the authentication code may be sent via a flash call to the specified # phone number. + # @attr allow_missed_call [Boolean] Pass true if the authentication code may be sent via a missed call to the + # specified phone number. # @attr is_current_phone_number [Boolean] Pass true if the authenticated phone number is used on the current device. + # @attr has_unknown_phone_number [Boolean] Pass true if there is a SIM card in the current device, but it is not + # possible to check whether phone number matches. # @attr allow_sms_retriever_api [Boolean] For official applications only. # True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to # automatically receive the authentication code from the SMS. # See https://developers.google.com/identity/sms-retriever/ for more details. + # @attr firebase_authentication_settings [TD::Types::FirebaseAuthenticationSettings] For official Android and iOS + # applications only; pass null otherwise. + # Settings for Firebase Authentication. + # @attr authentication_tokens [Array] List of up to 20 authentication tokens, recently received in + # updateOption("authentication_token") in previously logged out sessions. class PhoneNumberAuthenticationSettings < Base attribute :allow_flash_call, TD::Types::Bool + attribute :allow_missed_call, TD::Types::Bool attribute :is_current_phone_number, TD::Types::Bool + attribute :has_unknown_phone_number, TD::Types::Bool attribute :allow_sms_retriever_api, TD::Types::Bool + attribute :firebase_authentication_settings, TD::Types::FirebaseAuthenticationSettings + attribute :authentication_tokens, TD::Types::Array.of(TD::Types::String) end end diff --git a/lib/tdlib/types/phone_number_code_type.rb b/lib/tdlib/types/phone_number_code_type.rb new file mode 100644 index 00000000..da0c952a --- /dev/null +++ b/lib/tdlib/types/phone_number_code_type.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes type of the request for which a code is sent to a phone number. + class PhoneNumberCodeType < Base + %w[ + change + verify + confirm_ownership + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/phone_number_code_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/phone_number_code_type/change.rb b/lib/tdlib/types/phone_number_code_type/change.rb new file mode 100644 index 00000000..7dde48a8 --- /dev/null +++ b/lib/tdlib/types/phone_number_code_type/change.rb @@ -0,0 +1,6 @@ +module TD::Types + # Checks ownership of a new phone number to change the user's authentication phone number; for official Android and + # iOS applications only. + class PhoneNumberCodeType::Change < PhoneNumberCodeType + end +end diff --git a/lib/tdlib/types/phone_number_code_type/confirm_ownership.rb b/lib/tdlib/types/phone_number_code_type/confirm_ownership.rb new file mode 100644 index 00000000..b5f1d844 --- /dev/null +++ b/lib/tdlib/types/phone_number_code_type/confirm_ownership.rb @@ -0,0 +1,9 @@ +module TD::Types + # Confirms ownership of a phone number to prevent account deletion while handling links of the type + # internalLinkTypePhoneNumberConfirmation. + # + # @attr hash [TD::Types::String] Hash value from the link. + class PhoneNumberCodeType::ConfirmOwnership < PhoneNumberCodeType + attribute :hash, TD::Types::String + end +end diff --git a/lib/tdlib/types/phone_number_code_type/verify.rb b/lib/tdlib/types/phone_number_code_type/verify.rb new file mode 100644 index 00000000..a1e3a71a --- /dev/null +++ b/lib/tdlib/types/phone_number_code_type/verify.rb @@ -0,0 +1,5 @@ +module TD::Types + # Verifies ownership of a phone number to be added to the user's Telegram Passport. + class PhoneNumberCodeType::Verify < PhoneNumberCodeType + end +end diff --git a/lib/tdlib/types/phone_number_info.rb b/lib/tdlib/types/phone_number_info.rb index 12bd84fa..ab184b3f 100644 --- a/lib/tdlib/types/phone_number_info.rb +++ b/lib/tdlib/types/phone_number_info.rb @@ -7,9 +7,14 @@ module TD::Types # part. # @attr formatted_phone_number [TD::Types::String] The phone number without country calling code formatted # accordingly to local rules. + # Expected digits are returned as '-', but even more digits might be entered by the user. + # @attr is_anonymous [Boolean] True, if the phone number was bought at https://fragment.com and isn't tied to a SIM + # card. + # Information about the phone number can be received using getCollectibleItemInfo. class PhoneNumberInfo < Base attribute :country, TD::Types::CountryInfo.optional.default(nil) attribute :country_calling_code, TD::Types::String attribute :formatted_phone_number, TD::Types::String + attribute :is_anonymous, TD::Types::Bool end end diff --git a/lib/tdlib/types/photo_size.rb b/lib/tdlib/types/photo_size.rb index c9e3bdac..c5332ee4 100644 --- a/lib/tdlib/types/photo_size.rb +++ b/lib/tdlib/types/photo_size.rb @@ -6,7 +6,7 @@ module TD::Types # @attr width [Integer] Image width. # @attr height [Integer] Image height. # @attr progressive_sizes [Array] Sizes of progressive JPEG file prefixes, which can be used to - # preliminarily show the image. + # preliminarily show the image; in bytes. class PhotoSize < Base attribute :type, TD::Types::String attribute :photo, TD::Types::File diff --git a/lib/tdlib/types/poll.rb b/lib/tdlib/types/poll.rb index b87fa92d..f7c66204 100644 --- a/lib/tdlib/types/poll.rb +++ b/lib/tdlib/types/poll.rb @@ -2,21 +2,23 @@ module TD::Types # Describes a poll. # # @attr id [Integer] Unique poll identifier. - # @attr question [TD::Types::String] Poll question; 1-300 characters. + # @attr question [TD::Types::FormattedText] Poll question; 1-300 characters. + # Only custom emoji entities are allowed. # @attr options [Array] List of poll answer options. # @attr total_voter_count [Integer] Total number of voters, participating in the poll. - # @attr recent_voter_user_ids [Array] User identifiers of recent voters, if the poll is non-anonymous. + # @attr recent_voter_ids [Array] Identifiers of recent voters, if the poll is + # non-anonymous. # @attr is_anonymous [Boolean] True, if the poll is anonymous. # @attr type [TD::Types::PollType] Type of the poll. # @attr open_period [Integer] Amount of time the poll will be active after creation, in seconds. - # @attr close_date [Integer] Point in time (Unix timestamp) when the poll will be automatically closed. + # @attr close_date [Integer] Point in time (Unix timestamp) when the poll will automatically be closed. # @attr is_closed [Boolean] True, if the poll is closed. class Poll < Base attribute :id, TD::Types::Coercible::Integer - attribute :question, TD::Types::String + attribute :question, TD::Types::FormattedText attribute :options, TD::Types::Array.of(TD::Types::PollOption) attribute :total_voter_count, TD::Types::Coercible::Integer - attribute :recent_voter_user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :recent_voter_ids, TD::Types::Array.of(TD::Types::MessageSender) attribute :is_anonymous, TD::Types::Bool attribute :type, TD::Types::PollType attribute :open_period, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/poll_option.rb b/lib/tdlib/types/poll_option.rb index 20f196a5..66c41864 100644 --- a/lib/tdlib/types/poll_option.rb +++ b/lib/tdlib/types/poll_option.rb @@ -1,13 +1,14 @@ module TD::Types # Describes one answer option of a poll. # - # @attr text [TD::Types::String] Option text; 1-100 characters. + # @attr text [TD::Types::FormattedText] Option text; 1-100 characters. + # Only custom emoji entities are allowed. # @attr voter_count [Integer] Number of voters for this option, available only for closed or voted polls. # @attr vote_percentage [Integer] The percentage of votes for this option; 0-100. # @attr is_chosen [Boolean] True, if the option was chosen by the user. # @attr is_being_chosen [Boolean] True, if the option is being chosen by a pending setPollAnswer request. class PollOption < Base - attribute :text, TD::Types::String + attribute :text, TD::Types::FormattedText attribute :voter_count, TD::Types::Coercible::Integer attribute :vote_percentage, TD::Types::Coercible::Integer attribute :is_chosen, TD::Types::Bool diff --git a/lib/tdlib/types/poll_type.rb b/lib/tdlib/types/poll_type.rb index 3270e9ff..2c99d17b 100644 --- a/lib/tdlib/types/poll_type.rb +++ b/lib/tdlib/types/poll_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the type of a poll. + # Describes the type of poll. class PollType < Base %w[ regular diff --git a/lib/tdlib/types/premium_feature.rb b/lib/tdlib/types/premium_feature.rb new file mode 100644 index 00000000..c94cb9e4 --- /dev/null +++ b/lib/tdlib/types/premium_feature.rb @@ -0,0 +1,33 @@ +module TD::Types + # Describes a feature available to Premium users. + class PremiumFeature < Base + %w[ + increased_limits + increased_upload_file_size + improved_download_speed + voice_recognition + disabled_ads + unique_reactions + unique_stickers + custom_emoji + advanced_chat_management + profile_badge + emoji_status + animated_profile_photo + forum_topic_icon + app_icons + real_time_chat_translation + upgraded_stories + chat_boost + accent_color + background_for_both + saved_messages_tags + message_privacy + last_seen_times + business + message_effects + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/premium_feature/#{type}" + end + end +end diff --git a/lib/tdlib/types/premium_feature/accent_color.rb b/lib/tdlib/types/premium_feature/accent_color.rb new file mode 100644 index 00000000..833dd4cb --- /dev/null +++ b/lib/tdlib/types/premium_feature/accent_color.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to choose accent color for replies and user profile. + class PremiumFeature::AccentColor < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/advanced_chat_management.rb b/lib/tdlib/types/premium_feature/advanced_chat_management.rb new file mode 100644 index 00000000..37684633 --- /dev/null +++ b/lib/tdlib/types/premium_feature/advanced_chat_management.rb @@ -0,0 +1,6 @@ +module TD::Types + # Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely + # disable notifications about the user's contacts joined Telegram. + class PremiumFeature::AdvancedChatManagement < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/animated_profile_photo.rb b/lib/tdlib/types/premium_feature/animated_profile_photo.rb new file mode 100644 index 00000000..5c0b5910 --- /dev/null +++ b/lib/tdlib/types/premium_feature/animated_profile_photo.rb @@ -0,0 +1,5 @@ +module TD::Types + # Profile photo animation on message and chat screens. + class PremiumFeature::AnimatedProfilePhoto < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/app_icons.rb b/lib/tdlib/types/premium_feature/app_icons.rb new file mode 100644 index 00000000..99886914 --- /dev/null +++ b/lib/tdlib/types/premium_feature/app_icons.rb @@ -0,0 +1,5 @@ +module TD::Types + # Allowed to set a premium application icons. + class PremiumFeature::AppIcons < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/background_for_both.rb b/lib/tdlib/types/premium_feature/background_for_both.rb new file mode 100644 index 00000000..38282274 --- /dev/null +++ b/lib/tdlib/types/premium_feature/background_for_both.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to set private chat background for both users. + class PremiumFeature::BackgroundForBoth < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/business.rb b/lib/tdlib/types/premium_feature/business.rb new file mode 100644 index 00000000..b94f12ed --- /dev/null +++ b/lib/tdlib/types/premium_feature/business.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to use Business features. + class PremiumFeature::Business < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/chat_boost.rb b/lib/tdlib/types/premium_feature/chat_boost.rb new file mode 100644 index 00000000..2f291407 --- /dev/null +++ b/lib/tdlib/types/premium_feature/chat_boost.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to boost chats. + class PremiumFeature::ChatBoost < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/custom_emoji.rb b/lib/tdlib/types/premium_feature/custom_emoji.rb new file mode 100644 index 00000000..9e5a4b1f --- /dev/null +++ b/lib/tdlib/types/premium_feature/custom_emoji.rb @@ -0,0 +1,5 @@ +module TD::Types + # Allowed to use custom emoji stickers in message texts and captions. + class PremiumFeature::CustomEmoji < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/disabled_ads.rb b/lib/tdlib/types/premium_feature/disabled_ads.rb new file mode 100644 index 00000000..c1feb824 --- /dev/null +++ b/lib/tdlib/types/premium_feature/disabled_ads.rb @@ -0,0 +1,5 @@ +module TD::Types + # Disabled ads. + class PremiumFeature::DisabledAds < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/emoji_status.rb b/lib/tdlib/types/premium_feature/emoji_status.rb new file mode 100644 index 00000000..3584802f --- /dev/null +++ b/lib/tdlib/types/premium_feature/emoji_status.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to show an emoji status along with the user's name. + class PremiumFeature::EmojiStatus < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/forum_topic_icon.rb b/lib/tdlib/types/premium_feature/forum_topic_icon.rb new file mode 100644 index 00000000..65623ffa --- /dev/null +++ b/lib/tdlib/types/premium_feature/forum_topic_icon.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to set a custom emoji as a forum topic icon. + class PremiumFeature::ForumTopicIcon < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/improved_download_speed.rb b/lib/tdlib/types/premium_feature/improved_download_speed.rb new file mode 100644 index 00000000..8562dc8d --- /dev/null +++ b/lib/tdlib/types/premium_feature/improved_download_speed.rb @@ -0,0 +1,5 @@ +module TD::Types + # Improved download speed. + class PremiumFeature::ImprovedDownloadSpeed < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/increased_limits.rb b/lib/tdlib/types/premium_feature/increased_limits.rb new file mode 100644 index 00000000..b4e24fef --- /dev/null +++ b/lib/tdlib/types/premium_feature/increased_limits.rb @@ -0,0 +1,5 @@ +module TD::Types + # Increased limits. + class PremiumFeature::IncreasedLimits < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/increased_upload_file_size.rb b/lib/tdlib/types/premium_feature/increased_upload_file_size.rb new file mode 100644 index 00000000..0f4442d9 --- /dev/null +++ b/lib/tdlib/types/premium_feature/increased_upload_file_size.rb @@ -0,0 +1,5 @@ +module TD::Types + # Increased maximum upload file size. + class PremiumFeature::IncreasedUploadFileSize < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/last_seen_times.rb b/lib/tdlib/types/premium_feature/last_seen_times.rb new file mode 100644 index 00000000..94eed25a --- /dev/null +++ b/lib/tdlib/types/premium_feature/last_seen_times.rb @@ -0,0 +1,6 @@ +module TD::Types + # The ability to view last seen and read times of other users even they can't view last seen or read time for the + # current user. + class PremiumFeature::LastSeenTimes < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/message_effects.rb b/lib/tdlib/types/premium_feature/message_effects.rb new file mode 100644 index 00000000..25376265 --- /dev/null +++ b/lib/tdlib/types/premium_feature/message_effects.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to use all available message effects. + class PremiumFeature::MessageEffects < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/message_privacy.rb b/lib/tdlib/types/premium_feature/message_privacy.rb new file mode 100644 index 00000000..e6ae76f8 --- /dev/null +++ b/lib/tdlib/types/premium_feature/message_privacy.rb @@ -0,0 +1,7 @@ +module TD::Types + # The ability to disallow incoming voice and video note messages in private chats using setUserPrivacySettingRules + # with userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages and to restrict incoming messages from non-contacts using + # setNewChatPrivacySettings. + class PremiumFeature::MessagePrivacy < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/profile_badge.rb b/lib/tdlib/types/premium_feature/profile_badge.rb new file mode 100644 index 00000000..a49a15e1 --- /dev/null +++ b/lib/tdlib/types/premium_feature/profile_badge.rb @@ -0,0 +1,5 @@ +module TD::Types + # A badge in the user's profile. + class PremiumFeature::ProfileBadge < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/real_time_chat_translation.rb b/lib/tdlib/types/premium_feature/real_time_chat_translation.rb new file mode 100644 index 00000000..9e4bd090 --- /dev/null +++ b/lib/tdlib/types/premium_feature/real_time_chat_translation.rb @@ -0,0 +1,5 @@ +module TD::Types + # Allowed to translate chat messages real-time. + class PremiumFeature::RealTimeChatTranslation < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/saved_messages_tags.rb b/lib/tdlib/types/premium_feature/saved_messages_tags.rb new file mode 100644 index 00000000..2030b5f4 --- /dev/null +++ b/lib/tdlib/types/premium_feature/saved_messages_tags.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to use tags in Saved Messages. + class PremiumFeature::SavedMessagesTags < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/unique_reactions.rb b/lib/tdlib/types/premium_feature/unique_reactions.rb new file mode 100644 index 00000000..d0b8b411 --- /dev/null +++ b/lib/tdlib/types/premium_feature/unique_reactions.rb @@ -0,0 +1,5 @@ +module TD::Types + # Allowed to use more reactions. + class PremiumFeature::UniqueReactions < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/unique_stickers.rb b/lib/tdlib/types/premium_feature/unique_stickers.rb new file mode 100644 index 00000000..f4b44adb --- /dev/null +++ b/lib/tdlib/types/premium_feature/unique_stickers.rb @@ -0,0 +1,5 @@ +module TD::Types + # Allowed to use premium stickers with unique effects. + class PremiumFeature::UniqueStickers < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/upgraded_stories.rb b/lib/tdlib/types/premium_feature/upgraded_stories.rb new file mode 100644 index 00000000..0b552895 --- /dev/null +++ b/lib/tdlib/types/premium_feature/upgraded_stories.rb @@ -0,0 +1,5 @@ +module TD::Types + # Allowed to use many additional features for stories. + class PremiumFeature::UpgradedStories < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature/voice_recognition.rb b/lib/tdlib/types/premium_feature/voice_recognition.rb new file mode 100644 index 00000000..35f388fc --- /dev/null +++ b/lib/tdlib/types/premium_feature/voice_recognition.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to convert voice notes to text. + class PremiumFeature::VoiceRecognition < PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_feature_promotion_animation.rb b/lib/tdlib/types/premium_feature_promotion_animation.rb new file mode 100644 index 00000000..bb1a80e0 --- /dev/null +++ b/lib/tdlib/types/premium_feature_promotion_animation.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a promotion animation for a Premium feature. + # + # @attr feature [TD::Types::PremiumFeature] Premium feature. + # @attr animation [TD::Types::Animation] Promotion animation for the feature. + class PremiumFeaturePromotionAnimation < Base + attribute :feature, TD::Types::PremiumFeature + attribute :animation, TD::Types::Animation + end +end diff --git a/lib/tdlib/types/premium_features.rb b/lib/tdlib/types/premium_features.rb new file mode 100644 index 00000000..d47aa028 --- /dev/null +++ b/lib/tdlib/types/premium_features.rb @@ -0,0 +1,13 @@ +module TD::Types + # Contains information about features, available to Premium users. + # + # @attr features [Array] The list of available features. + # @attr limits [Array] The list of limits, increased for Premium users. + # @attr payment_link [TD::Types::InternalLinkType, nil] An internal link to be opened to pay for Telegram Premium if + # store payment isn't possible; may be null if direct payment isn't available. + class PremiumFeatures < Base + attribute :features, TD::Types::Array.of(TD::Types::PremiumFeature) + attribute :limits, TD::Types::Array.of(TD::Types::PremiumLimit) + attribute :payment_link, TD::Types::InternalLinkType.optional.default(nil) + end +end diff --git a/lib/tdlib/types/premium_gift_code_info.rb b/lib/tdlib/types/premium_gift_code_info.rb new file mode 100644 index 00000000..0ecaec13 --- /dev/null +++ b/lib/tdlib/types/premium_gift_code_info.rb @@ -0,0 +1,25 @@ +module TD::Types + # Contains information about a Telegram Premium gift code. + # + # @attr creator_id [TD::Types::MessageSender, nil] Identifier of a chat or a user that created the gift code; may be + # null if unknown. + # If null and the code is from {TD::Types::MessageContent::PremiumGiftCode} message, then creator_id from the + # message can be used. + # @attr creation_date [Integer] Point in time (Unix timestamp) when the code was created. + # @attr is_from_giveaway [Boolean] True, if the gift code was created for a giveaway. + # @attr giveaway_message_id [Integer] Identifier of the corresponding giveaway message in the creator_id chat; can be + # 0 or an identifier of a deleted message. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active after code + # activation. + # @attr user_id [Integer] Identifier of a user for which the code was created; 0 if none. + # @attr use_date [Integer] Point in time (Unix timestamp) when the code was activated; 0 if none. + class PremiumGiftCodeInfo < Base + attribute :creator_id, TD::Types::MessageSender.optional.default(nil) + attribute :creation_date, TD::Types::Coercible::Integer + attribute :is_from_giveaway, TD::Types::Bool + attribute :giveaway_message_id, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + attribute :user_id, TD::Types::Coercible::Integer + attribute :use_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/premium_gift_code_payment_option.rb b/lib/tdlib/types/premium_gift_code_payment_option.rb new file mode 100644 index 00000000..922b312f --- /dev/null +++ b/lib/tdlib/types/premium_gift_code_payment_option.rb @@ -0,0 +1,20 @@ +module TD::Types + # Describes an option for creating Telegram Premium gift codes. + # Use telegramPaymentPurposePremiumGiftCodes for out-of-store payments. + # + # @attr currency [TD::Types::String] ISO 4217 currency code for Telegram Premium gift code payment. + # @attr amount [Integer] The amount to pay, in the smallest units of the currency. + # @attr user_count [Integer] Number of users which will be able to activate the gift codes. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active. + # @attr store_product_id [TD::Types::String, nil] Identifier of the store product associated with the option; may be + # empty if none. + # @attr store_product_quantity [Integer] Number of times the store product must be paid. + class PremiumGiftCodePaymentOption < Base + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :user_count, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + attribute :store_product_id, TD::Types::String.optional.default(nil) + attribute :store_product_quantity, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/premium_gift_code_payment_options.rb b/lib/tdlib/types/premium_gift_code_payment_options.rb new file mode 100644 index 00000000..59349fb6 --- /dev/null +++ b/lib/tdlib/types/premium_gift_code_payment_options.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of options for creating Telegram Premium gift codes. + # + # @attr options [Array] The list of options. + class PremiumGiftCodePaymentOptions < Base + attribute :options, TD::Types::Array.of(TD::Types::PremiumGiftCodePaymentOption) + end +end diff --git a/lib/tdlib/types/premium_giveaway_info.rb b/lib/tdlib/types/premium_giveaway_info.rb new file mode 100644 index 00000000..82d2223a --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_info.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains information about Telegram Premium giveaway. + class PremiumGiveawayInfo < Base + %w[ + ongoing + completed + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/premium_giveaway_info/#{type}" + end + end +end diff --git a/lib/tdlib/types/premium_giveaway_info/completed.rb b/lib/tdlib/types/premium_giveaway_info/completed.rb new file mode 100644 index 00000000..090dc5df --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_info/completed.rb @@ -0,0 +1,20 @@ +module TD::Types + # Describes a completed giveaway. + # + # @attr creation_date [Integer] Point in time (Unix timestamp) when the giveaway was created. + # @attr actual_winners_selection_date [Integer] Point in time (Unix timestamp) when the winners were selected. + # May be bigger than winners selection date specified in parameters of the giveaway. + # @attr was_refunded [Boolean] True, if the giveaway was canceled and was fully refunded. + # @attr winner_count [Integer] Number of winners in the giveaway. + # @attr activation_count [Integer] Number of winners, which activated their gift codes. + # @attr gift_code [TD::Types::String] Telegram Premium gift code that was received by the current user; empty if the + # user isn't a winner in the giveaway. + class PremiumGiveawayInfo::Completed < PremiumGiveawayInfo + attribute :creation_date, TD::Types::Coercible::Integer + attribute :actual_winners_selection_date, TD::Types::Coercible::Integer + attribute :was_refunded, TD::Types::Bool + attribute :winner_count, TD::Types::Coercible::Integer + attribute :activation_count, TD::Types::Coercible::Integer + attribute :gift_code, TD::Types::String + end +end diff --git a/lib/tdlib/types/premium_giveaway_info/ongoing.rb b/lib/tdlib/types/premium_giveaway_info/ongoing.rb new file mode 100644 index 00000000..fd33a98f --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_info/ongoing.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes an ongoing giveaway. + # + # @attr creation_date [Integer] Point in time (Unix timestamp) when the giveaway was created. + # @attr status [TD::Types::PremiumGiveawayParticipantStatus] Status of the current user in the giveaway. + # @attr is_ended [Boolean] True, if the giveaway has ended and results are being prepared. + class PremiumGiveawayInfo::Ongoing < PremiumGiveawayInfo + attribute :creation_date, TD::Types::Coercible::Integer + attribute :status, TD::Types::PremiumGiveawayParticipantStatus + attribute :is_ended, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/premium_giveaway_parameters.rb b/lib/tdlib/types/premium_giveaway_parameters.rb new file mode 100644 index 00000000..4e0d78c3 --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_parameters.rb @@ -0,0 +1,31 @@ +module TD::Types + # Describes parameters of a Telegram Premium giveaway. + # + # @attr boosted_chat_id [Integer] Identifier of the supergroup or channel chat, which will be automatically boosted + # by the winners of the giveaway for duration of the Premium subscription. + # If the chat is a channel, then can_post_messages right is required in the channel, otherwise, the user must be an + # administrator in the supergroup. + # @attr additional_chat_ids [Array] Identifiers of other supergroup or channel chats that must be subscribed + # by the users to be eligible for the giveaway. + # There can be up to getOption("giveaway_additional_chat_count_max") additional chats. + # @attr winners_selection_date [Integer] Point in time (Unix timestamp) when the giveaway is expected to be + # performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways. + # @attr only_new_members [Boolean] True, if only new members of the chats will be eligible for the giveaway. + # @attr has_public_winners [Boolean] True, if the list of winners of the giveaway will be available to everyone. + # @attr country_codes [Array, nil] The list of two-letter ISO 3166-1 alpha-2 codes of countries, + # users from which will be eligible for the giveaway. + # If empty, then all users can participate in the giveaway. + # There can be up to getOption("giveaway_country_count_max") chosen countries. + # Users with phone number that was bought at https://fragment.com can participate in any giveaway and the country + # code "FT" must not be specified in the list. + # @attr prize_description [TD::Types::String] Additional description of the giveaway prize; 0-128 characters. + class PremiumGiveawayParameters < Base + attribute :boosted_chat_id, TD::Types::Coercible::Integer + attribute :additional_chat_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :winners_selection_date, TD::Types::Coercible::Integer + attribute :only_new_members, TD::Types::Bool + attribute :has_public_winners, TD::Types::Bool + attribute :country_codes, TD::Types::Array.of(TD::Types::String).optional.default(nil) + attribute :prize_description, TD::Types::String + end +end diff --git a/lib/tdlib/types/premium_giveaway_participant_status.rb b/lib/tdlib/types/premium_giveaway_participant_status.rb new file mode 100644 index 00000000..e4fd0cb3 --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_participant_status.rb @@ -0,0 +1,14 @@ +module TD::Types + # Contains information about status of a user in a Telegram Premium giveaway. + class PremiumGiveawayParticipantStatus < Base + %w[ + eligible + participating + already_was_member + administrator + disallowed_country + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/premium_giveaway_participant_status/#{type}" + end + end +end diff --git a/lib/tdlib/types/premium_giveaway_participant_status/administrator.rb b/lib/tdlib/types/premium_giveaway_participant_status/administrator.rb new file mode 100644 index 00000000..3107dc2d --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_participant_status/administrator.rb @@ -0,0 +1,9 @@ +module TD::Types + # The user can't participate in the giveaway, because they are an administrator in one of the chats that created the + # giveaway. + # + # @attr chat_id [Integer] Identifier of the chat administered by the user. + class PremiumGiveawayParticipantStatus::Administrator < PremiumGiveawayParticipantStatus + attribute :chat_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/premium_giveaway_participant_status/already_was_member.rb b/lib/tdlib/types/premium_giveaway_participant_status/already_was_member.rb new file mode 100644 index 00000000..5df36a1c --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_participant_status/already_was_member.rb @@ -0,0 +1,8 @@ +module TD::Types + # The user can't participate in the giveaway, because they have already been member of the chat. + # + # @attr joined_chat_date [Integer] Point in time (Unix timestamp) when the user joined the chat. + class PremiumGiveawayParticipantStatus::AlreadyWasMember < PremiumGiveawayParticipantStatus + attribute :joined_chat_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/premium_giveaway_participant_status/disallowed_country.rb b/lib/tdlib/types/premium_giveaway_participant_status/disallowed_country.rb new file mode 100644 index 00000000..786a9931 --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_participant_status/disallowed_country.rb @@ -0,0 +1,8 @@ +module TD::Types + # The user can't participate in the giveaway, because they phone number is from a disallowed country. + # + # @attr user_country_code [TD::Types::String] A two-letter ISO 3166-1 alpha-2 country code of the user's country. + class PremiumGiveawayParticipantStatus::DisallowedCountry < PremiumGiveawayParticipantStatus + attribute :user_country_code, TD::Types::String + end +end diff --git a/lib/tdlib/types/premium_giveaway_participant_status/eligible.rb b/lib/tdlib/types/premium_giveaway_participant_status/eligible.rb new file mode 100644 index 00000000..42864b5a --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_participant_status/eligible.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user is eligible for the giveaway. + class PremiumGiveawayParticipantStatus::Eligible < PremiumGiveawayParticipantStatus + end +end diff --git a/lib/tdlib/types/premium_giveaway_participant_status/participating.rb b/lib/tdlib/types/premium_giveaway_participant_status/participating.rb new file mode 100644 index 00000000..00117560 --- /dev/null +++ b/lib/tdlib/types/premium_giveaway_participant_status/participating.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user participates in the giveaway. + class PremiumGiveawayParticipantStatus::Participating < PremiumGiveawayParticipantStatus + end +end diff --git a/lib/tdlib/types/premium_limit.rb b/lib/tdlib/types/premium_limit.rb new file mode 100644 index 00000000..bd1f5415 --- /dev/null +++ b/lib/tdlib/types/premium_limit.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains information about a limit, increased for Premium users. + # + # @attr type [TD::Types::PremiumLimitType] The type of the limit. + # @attr default_value [Integer] Default value of the limit. + # @attr premium_value [Integer] Value of the limit for Premium users. + class PremiumLimit < Base + attribute :type, TD::Types::PremiumLimitType + attribute :default_value, TD::Types::Coercible::Integer + attribute :premium_value, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/premium_limit_type.rb b/lib/tdlib/types/premium_limit_type.rb new file mode 100644 index 00000000..a1f03ce6 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type.rb @@ -0,0 +1,28 @@ +module TD::Types + # Describes type of limit, increased for Premium users. + class PremiumLimitType < Base + %w[ + supergroup_count + pinned_chat_count + created_public_chat_count + saved_animation_count + favorite_sticker_count + chat_folder_count + chat_folder_chosen_chat_count + pinned_archived_chat_count + pinned_saved_messages_topic_count + caption_length + bio_length + chat_folder_invite_link_count + shareable_chat_folder_count + active_story_count + weekly_sent_story_count + monthly_sent_story_count + story_caption_length + story_suggested_reaction_area_count + similar_chat_count + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/premium_limit_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/premium_limit_type/active_story_count.rb b/lib/tdlib/types/premium_limit_type/active_story_count.rb new file mode 100644 index 00000000..0bdea640 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/active_story_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of active stories. + class PremiumLimitType::ActiveStoryCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/bio_length.rb b/lib/tdlib/types/premium_limit_type/bio_length.rb new file mode 100644 index 00000000..56dcac41 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/bio_length.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum length of the user's bio. + class PremiumLimitType::BioLength < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/caption_length.rb b/lib/tdlib/types/premium_limit_type/caption_length.rb new file mode 100644 index 00000000..f4e782cc --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/caption_length.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum length of sent media caption. + class PremiumLimitType::CaptionLength < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/chat_folder_chosen_chat_count.rb b/lib/tdlib/types/premium_limit_type/chat_folder_chosen_chat_count.rb new file mode 100644 index 00000000..6d12008c --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/chat_folder_chosen_chat_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of pinned and always included, or always excluded chats in a chat folder. + class PremiumLimitType::ChatFolderChosenChatCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/chat_folder_count.rb b/lib/tdlib/types/premium_limit_type/chat_folder_count.rb new file mode 100644 index 00000000..a63c2bb5 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/chat_folder_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of chat folders. + class PremiumLimitType::ChatFolderCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/chat_folder_invite_link_count.rb b/lib/tdlib/types/premium_limit_type/chat_folder_invite_link_count.rb new file mode 100644 index 00000000..3523ada4 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/chat_folder_invite_link_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of invite links for a chat folder. + class PremiumLimitType::ChatFolderInviteLinkCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/created_public_chat_count.rb b/lib/tdlib/types/premium_limit_type/created_public_chat_count.rb new file mode 100644 index 00000000..78c944c9 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/created_public_chat_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of created public chats. + class PremiumLimitType::CreatedPublicChatCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/favorite_sticker_count.rb b/lib/tdlib/types/premium_limit_type/favorite_sticker_count.rb new file mode 100644 index 00000000..bb1f454d --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/favorite_sticker_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of favorite stickers. + class PremiumLimitType::FavoriteStickerCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/monthly_sent_story_count.rb b/lib/tdlib/types/premium_limit_type/monthly_sent_story_count.rb new file mode 100644 index 00000000..b26be86e --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/monthly_sent_story_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of stories sent per month. + class PremiumLimitType::MonthlySentStoryCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/pinned_archived_chat_count.rb b/lib/tdlib/types/premium_limit_type/pinned_archived_chat_count.rb new file mode 100644 index 00000000..45355c3f --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/pinned_archived_chat_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of pinned chats in the archive chat list. + class PremiumLimitType::PinnedArchivedChatCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/pinned_chat_count.rb b/lib/tdlib/types/premium_limit_type/pinned_chat_count.rb new file mode 100644 index 00000000..0a8424d1 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/pinned_chat_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of pinned chats in the main chat list. + class PremiumLimitType::PinnedChatCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/pinned_saved_messages_topic_count.rb b/lib/tdlib/types/premium_limit_type/pinned_saved_messages_topic_count.rb new file mode 100644 index 00000000..b7ea00bb --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/pinned_saved_messages_topic_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of pinned Saved Messages topics. + class PremiumLimitType::PinnedSavedMessagesTopicCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/saved_animation_count.rb b/lib/tdlib/types/premium_limit_type/saved_animation_count.rb new file mode 100644 index 00000000..43521232 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/saved_animation_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of saved animations. + class PremiumLimitType::SavedAnimationCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/shareable_chat_folder_count.rb b/lib/tdlib/types/premium_limit_type/shareable_chat_folder_count.rb new file mode 100644 index 00000000..95e19104 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/shareable_chat_folder_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of added shareable chat folders. + class PremiumLimitType::ShareableChatFolderCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/similar_chat_count.rb b/lib/tdlib/types/premium_limit_type/similar_chat_count.rb new file mode 100644 index 00000000..2963f4ad --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/similar_chat_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of received similar chats. + class PremiumLimitType::SimilarChatCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/story_caption_length.rb b/lib/tdlib/types/premium_limit_type/story_caption_length.rb new file mode 100644 index 00000000..d3cb8170 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/story_caption_length.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum length of captions of sent stories. + class PremiumLimitType::StoryCaptionLength < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/story_suggested_reaction_area_count.rb b/lib/tdlib/types/premium_limit_type/story_suggested_reaction_area_count.rb new file mode 100644 index 00000000..1447abf8 --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/story_suggested_reaction_area_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of suggested reaction areas on a story. + class PremiumLimitType::StorySuggestedReactionAreaCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/supergroup_count.rb b/lib/tdlib/types/premium_limit_type/supergroup_count.rb new file mode 100644 index 00000000..ba1002bc --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/supergroup_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of joined supergroups and channels. + class PremiumLimitType::SupergroupCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_limit_type/weekly_sent_story_count.rb b/lib/tdlib/types/premium_limit_type/weekly_sent_story_count.rb new file mode 100644 index 00000000..1d1497de --- /dev/null +++ b/lib/tdlib/types/premium_limit_type/weekly_sent_story_count.rb @@ -0,0 +1,5 @@ +module TD::Types + # The maximum number of stories sent per week. + class PremiumLimitType::WeeklySentStoryCount < PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_payment_option.rb b/lib/tdlib/types/premium_payment_option.rb new file mode 100644 index 00000000..c337c4f7 --- /dev/null +++ b/lib/tdlib/types/premium_payment_option.rb @@ -0,0 +1,19 @@ +module TD::Types + # Describes an option for buying Telegram Premium to a user. + # + # @attr currency [TD::Types::String] ISO 4217 currency code for Telegram Premium subscription payment. + # @attr amount [Integer] The amount to pay, in the smallest units of the currency. + # @attr discount_percentage [Integer] The discount associated with this option, as a percentage. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active. + # @attr store_product_id [TD::Types::String] Identifier of the store product associated with the option. + # @attr payment_link [TD::Types::InternalLinkType, nil] An internal link to be opened for buying Telegram Premium to + # the user if store payment isn't possible; may be null if direct payment isn't available. + class PremiumPaymentOption < Base + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :discount_percentage, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + attribute :store_product_id, TD::Types::String + attribute :payment_link, TD::Types::InternalLinkType.optional.default(nil) + end +end diff --git a/lib/tdlib/types/premium_source.rb b/lib/tdlib/types/premium_source.rb new file mode 100644 index 00000000..a0baef0c --- /dev/null +++ b/lib/tdlib/types/premium_source.rb @@ -0,0 +1,15 @@ +module TD::Types + # Describes a source from which the Premium features screen is opened. + class PremiumSource < Base + %w[ + limit_exceeded + feature + business_feature + story_feature + link + settings + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/premium_source/#{type}" + end + end +end diff --git a/lib/tdlib/types/premium_source/business_feature.rb b/lib/tdlib/types/premium_source/business_feature.rb new file mode 100644 index 00000000..668ebad4 --- /dev/null +++ b/lib/tdlib/types/premium_source/business_feature.rb @@ -0,0 +1,8 @@ +module TD::Types + # A user tried to use a Business feature. + # + # @attr feature [TD::Types::BusinessFeature] The used feature; pass null if none specific feature was used. + class PremiumSource::BusinessFeature < PremiumSource + attribute :feature, TD::Types::BusinessFeature + end +end diff --git a/lib/tdlib/types/premium_source/feature.rb b/lib/tdlib/types/premium_source/feature.rb new file mode 100644 index 00000000..0898baf4 --- /dev/null +++ b/lib/tdlib/types/premium_source/feature.rb @@ -0,0 +1,8 @@ +module TD::Types + # A user tried to use a Premium feature. + # + # @attr feature [TD::Types::PremiumFeature] The used feature. + class PremiumSource::Feature < PremiumSource + attribute :feature, TD::Types::PremiumFeature + end +end diff --git a/lib/tdlib/types/premium_source/limit_exceeded.rb b/lib/tdlib/types/premium_source/limit_exceeded.rb new file mode 100644 index 00000000..6db9bf21 --- /dev/null +++ b/lib/tdlib/types/premium_source/limit_exceeded.rb @@ -0,0 +1,8 @@ +module TD::Types + # A limit was exceeded. + # + # @attr limit_type [TD::Types::PremiumLimitType] Type of the exceeded limit. + class PremiumSource::LimitExceeded < PremiumSource + attribute :limit_type, TD::Types::PremiumLimitType + end +end diff --git a/lib/tdlib/types/premium_source/link.rb b/lib/tdlib/types/premium_source/link.rb new file mode 100644 index 00000000..8e91a703 --- /dev/null +++ b/lib/tdlib/types/premium_source/link.rb @@ -0,0 +1,8 @@ +module TD::Types + # A user opened an internal link of the type internalLinkTypePremiumFeatures. + # + # @attr referrer [TD::Types::String] The referrer from the link. + class PremiumSource::Link < PremiumSource + attribute :referrer, TD::Types::String + end +end diff --git a/lib/tdlib/types/premium_source/settings.rb b/lib/tdlib/types/premium_source/settings.rb new file mode 100644 index 00000000..aa55e171 --- /dev/null +++ b/lib/tdlib/types/premium_source/settings.rb @@ -0,0 +1,5 @@ +module TD::Types + # A user opened the Premium features screen from settings. + class PremiumSource::Settings < PremiumSource + end +end diff --git a/lib/tdlib/types/premium_source/story_feature.rb b/lib/tdlib/types/premium_source/story_feature.rb new file mode 100644 index 00000000..3868e4d2 --- /dev/null +++ b/lib/tdlib/types/premium_source/story_feature.rb @@ -0,0 +1,8 @@ +module TD::Types + # A user tried to use a Premium story feature. + # + # @attr feature [TD::Types::PremiumStoryFeature] The used feature. + class PremiumSource::StoryFeature < PremiumSource + attribute :feature, TD::Types::PremiumStoryFeature + end +end diff --git a/lib/tdlib/types/premium_state.rb b/lib/tdlib/types/premium_state.rb new file mode 100644 index 00000000..df8d4a9f --- /dev/null +++ b/lib/tdlib/types/premium_state.rb @@ -0,0 +1,18 @@ +module TD::Types + # Contains state of Telegram Premium subscription and promotion videos for Premium features. + # + # @attr state [TD::Types::FormattedText, nil] Text description of the state of the current Premium subscription; may + # be empty if the current user has no Telegram Premium subscription. + # @attr payment_options [Array] The list of available options for buying + # Telegram Premium. + # @attr animations [Array] The list of available promotion animations + # for Premium features. + # @attr business_animations [Array] The list of available promotion + # animations for Business features. + class PremiumState < Base + attribute :state, TD::Types::FormattedText.optional.default(nil) + attribute :payment_options, TD::Types::Array.of(TD::Types::PremiumStatePaymentOption) + attribute :animations, TD::Types::Array.of(TD::Types::PremiumFeaturePromotionAnimation) + attribute :business_animations, TD::Types::Array.of(TD::Types::BusinessFeaturePromotionAnimation) + end +end diff --git a/lib/tdlib/types/premium_state_payment_option.rb b/lib/tdlib/types/premium_state_payment_option.rb new file mode 100644 index 00000000..488a7e33 --- /dev/null +++ b/lib/tdlib/types/premium_state_payment_option.rb @@ -0,0 +1,16 @@ +module TD::Types + # Describes an option for buying or upgrading Telegram Premium for self. + # + # @attr payment_option [TD::Types::PremiumPaymentOption] Information about the payment option. + # @attr is_current [Boolean] True, if this is the currently used Telegram Premium subscription option. + # @attr is_upgrade [Boolean] True, if the payment option can be used to upgrade the existing Telegram Premium + # subscription. + # @attr last_transaction_id [TD::Types::String] Identifier of the last in-store transaction for the currently used + # option. + class PremiumStatePaymentOption < Base + attribute :payment_option, TD::Types::PremiumPaymentOption + attribute :is_current, TD::Types::Bool + attribute :is_upgrade, TD::Types::Bool + attribute :last_transaction_id, TD::Types::String + end +end diff --git a/lib/tdlib/types/premium_story_feature.rb b/lib/tdlib/types/premium_story_feature.rb new file mode 100644 index 00000000..3ec5a55c --- /dev/null +++ b/lib/tdlib/types/premium_story_feature.rb @@ -0,0 +1,16 @@ +module TD::Types + # Describes a story feature available to Premium users. + class PremiumStoryFeature < Base + %w[ + priority_order + stealth_mode + permanent_views_history + custom_expiration_duration + save_stories + links_and_formatting + video_quality + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/premium_story_feature/#{type}" + end + end +end diff --git a/lib/tdlib/types/premium_story_feature/custom_expiration_duration.rb b/lib/tdlib/types/premium_story_feature/custom_expiration_duration.rb new file mode 100644 index 00000000..1518aa5b --- /dev/null +++ b/lib/tdlib/types/premium_story_feature/custom_expiration_duration.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to set custom expiration duration for stories. + class PremiumStoryFeature::CustomExpirationDuration < PremiumStoryFeature + end +end diff --git a/lib/tdlib/types/premium_story_feature/links_and_formatting.rb b/lib/tdlib/types/premium_story_feature/links_and_formatting.rb new file mode 100644 index 00000000..e7f82a5e --- /dev/null +++ b/lib/tdlib/types/premium_story_feature/links_and_formatting.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to use links and formatting in story caption, and use inputStoryAreaTypeLink areas. + class PremiumStoryFeature::LinksAndFormatting < PremiumStoryFeature + end +end diff --git a/lib/tdlib/types/premium_story_feature/permanent_views_history.rb b/lib/tdlib/types/premium_story_feature/permanent_views_history.rb new file mode 100644 index 00000000..e480537c --- /dev/null +++ b/lib/tdlib/types/premium_story_feature/permanent_views_history.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to check who opened the current user's stories after they expire. + class PremiumStoryFeature::PermanentViewsHistory < PremiumStoryFeature + end +end diff --git a/lib/tdlib/types/premium_story_feature/priority_order.rb b/lib/tdlib/types/premium_story_feature/priority_order.rb new file mode 100644 index 00000000..d093b8e4 --- /dev/null +++ b/lib/tdlib/types/premium_story_feature/priority_order.rb @@ -0,0 +1,5 @@ +module TD::Types + # Stories of the current user are displayed before stories of non-Premium contacts, supergroups, and channels. + class PremiumStoryFeature::PriorityOrder < PremiumStoryFeature + end +end diff --git a/lib/tdlib/types/premium_story_feature/save_stories.rb b/lib/tdlib/types/premium_story_feature/save_stories.rb new file mode 100644 index 00000000..40c3c608 --- /dev/null +++ b/lib/tdlib/types/premium_story_feature/save_stories.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to save other's unprotected stories. + class PremiumStoryFeature::SaveStories < PremiumStoryFeature + end +end diff --git a/lib/tdlib/types/premium_story_feature/stealth_mode.rb b/lib/tdlib/types/premium_story_feature/stealth_mode.rb new file mode 100644 index 00000000..046afbc2 --- /dev/null +++ b/lib/tdlib/types/premium_story_feature/stealth_mode.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to hide the fact that the user viewed other's stories. + class PremiumStoryFeature::StealthMode < PremiumStoryFeature + end +end diff --git a/lib/tdlib/types/premium_story_feature/video_quality.rb b/lib/tdlib/types/premium_story_feature/video_quality.rb new file mode 100644 index 00000000..f1dee6c0 --- /dev/null +++ b/lib/tdlib/types/premium_story_feature/video_quality.rb @@ -0,0 +1,5 @@ +module TD::Types + # The ability to choose better quality for viewed stories. + class PremiumStoryFeature::VideoQuality < PremiumStoryFeature + end +end diff --git a/lib/tdlib/types/prepaid_premium_giveaway.rb b/lib/tdlib/types/prepaid_premium_giveaway.rb new file mode 100644 index 00000000..e1da9b16 --- /dev/null +++ b/lib/tdlib/types/prepaid_premium_giveaway.rb @@ -0,0 +1,15 @@ +module TD::Types + # Describes a prepaid Telegram Premium giveaway. + # + # @attr id [Integer] Unique identifier of the prepaid giveaway. + # @attr winner_count [Integer] Number of users which will receive Telegram Premium subscription gift codes. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active after code + # activation. + # @attr payment_date [Integer] Point in time (Unix timestamp) when the giveaway was paid. + class PrepaidPremiumGiveaway < Base + attribute :id, TD::Types::Coercible::Integer + attribute :winner_count, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + attribute :payment_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/product_info.rb b/lib/tdlib/types/product_info.rb new file mode 100644 index 00000000..fd590e48 --- /dev/null +++ b/lib/tdlib/types/product_info.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains information about a product that can be paid with invoice. + # + # @attr title [TD::Types::String] Product title. + # @attr description [TD::Types::FormattedText] Product description. + # @attr photo [TD::Types::Photo, nil] Product photo; may be null. + class ProductInfo < Base + attribute :title, TD::Types::String + attribute :description, TD::Types::FormattedText + attribute :photo, TD::Types::Photo.optional.default(nil) + end +end diff --git a/lib/tdlib/types/profile_accent_color.rb b/lib/tdlib/types/profile_accent_color.rb new file mode 100644 index 00000000..23948723 --- /dev/null +++ b/lib/tdlib/types/profile_accent_color.rb @@ -0,0 +1,18 @@ +module TD::Types + # Contains information about supported accent color for user profile photo background. + # + # @attr id [Integer] Profile accent color identifier. + # @attr light_theme_colors [TD::Types::ProfileAccentColors] Accent colors expected to be used in light themes. + # @attr dark_theme_colors [TD::Types::ProfileAccentColors] Accent colors expected to be used in dark themes. + # @attr min_supergroup_chat_boost_level [Integer] The minimum chat boost level required to use the color in a + # supergroup chat. + # @attr min_channel_chat_boost_level [Integer] The minimum chat boost level required to use the color in a channel + # chat. + class ProfileAccentColor < Base + attribute :id, TD::Types::Coercible::Integer + attribute :light_theme_colors, TD::Types::ProfileAccentColors + attribute :dark_theme_colors, TD::Types::ProfileAccentColors + attribute :min_supergroup_chat_boost_level, TD::Types::Coercible::Integer + attribute :min_channel_chat_boost_level, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/profile_accent_colors.rb b/lib/tdlib/types/profile_accent_colors.rb new file mode 100644 index 00000000..92754d92 --- /dev/null +++ b/lib/tdlib/types/profile_accent_colors.rb @@ -0,0 +1,15 @@ +module TD::Types + # Contains information about supported accent colors for user profile photo background in RGB format. + # + # @attr palette_colors [Array] The list of 1-2 colors in RGB format, describing the colors, as expected to + # be shown in the color palette settings. + # @attr background_colors [Array] The list of 1-2 colors in RGB format, describing the colors, as expected + # to be used for the profile photo background. + # @attr story_colors [Array] The list of 2 colors in RGB format, describing the colors of the gradient to be + # used for the unread active story indicator around profile photo. + class ProfileAccentColors < Base + attribute :palette_colors, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :background_colors, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :story_colors, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/profile_photo.rb b/lib/tdlib/types/profile_photo.rb index fa46f29a..5bd14c39 100644 --- a/lib/tdlib/types/profile_photo.rb +++ b/lib/tdlib/types/profile_photo.rb @@ -9,11 +9,13 @@ module TD::Types # The file can be downloaded only before the photo is changed. # @attr minithumbnail [TD::Types::Minithumbnail, nil] User profile photo minithumbnail; may be null. # @attr has_animation [Boolean] True, if the photo has animated variant. + # @attr is_personal [Boolean] True, if the photo is visible only for the current user. class ProfilePhoto < Base attribute :id, TD::Types::Coercible::Integer attribute :small, TD::Types::File attribute :big, TD::Types::File attribute :minithumbnail, TD::Types::Minithumbnail.optional.default(nil) attribute :has_animation, TD::Types::Bool + attribute :is_personal, TD::Types::Bool end end diff --git a/lib/tdlib/types/proxy.rb b/lib/tdlib/types/proxy.rb index 7a985b3e..752161fb 100644 --- a/lib/tdlib/types/proxy.rb +++ b/lib/tdlib/types/proxy.rb @@ -2,7 +2,7 @@ module TD::Types # Contains information about a proxy server. # # @attr id [Integer] Unique identifier of the proxy. - # @attr server [TD::Types::String] Proxy server IP address. + # @attr server [TD::Types::String] Proxy server domain or IP address. # @attr port [Integer] Proxy server port. # @attr last_used_date [Integer] Point in time (Unix timestamp) when the proxy was last used; 0 if never. # @attr is_enabled [Boolean] True, if the proxy is enabled now. diff --git a/lib/tdlib/types/proxy_type.rb b/lib/tdlib/types/proxy_type.rb index fc497ead..bddcccef 100644 --- a/lib/tdlib/types/proxy_type.rb +++ b/lib/tdlib/types/proxy_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the type of a proxy server. + # Describes the type of proxy server. class ProxyType < Base %w[ socks5 diff --git a/lib/tdlib/types/public_chat_type.rb b/lib/tdlib/types/public_chat_type.rb index a6d0b3f2..8a6c9536 100644 --- a/lib/tdlib/types/public_chat_type.rb +++ b/lib/tdlib/types/public_chat_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes a type of public chats. + # Describes type of public chat. class PublicChatType < Base %w[ has_username diff --git a/lib/tdlib/types/public_chat_type/has_username.rb b/lib/tdlib/types/public_chat_type/has_username.rb index 8c6bb75a..0559a897 100644 --- a/lib/tdlib/types/public_chat_type/has_username.rb +++ b/lib/tdlib/types/public_chat_type/has_username.rb @@ -1,5 +1,5 @@ module TD::Types - # The chat is public, because it has username. + # The chat is public, because it has an active username. class PublicChatType::HasUsername < PublicChatType end end diff --git a/lib/tdlib/types/public_forward.rb b/lib/tdlib/types/public_forward.rb new file mode 100644 index 00000000..bad47e79 --- /dev/null +++ b/lib/tdlib/types/public_forward.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes a public forward or repost of a story. + class PublicForward < Base + %w[ + message + story + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/public_forward/#{type}" + end + end +end diff --git a/lib/tdlib/types/public_forward/message.rb b/lib/tdlib/types/public_forward/message.rb new file mode 100644 index 00000000..ba0b51bf --- /dev/null +++ b/lib/tdlib/types/public_forward/message.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a public forward as a message. + # + # @attr message [TD::Types::Message] Information about the message. + class PublicForward::Message < PublicForward + attribute :message, TD::Types::Message + end +end diff --git a/lib/tdlib/types/public_forward/story.rb b/lib/tdlib/types/public_forward/story.rb new file mode 100644 index 00000000..5d3fdef6 --- /dev/null +++ b/lib/tdlib/types/public_forward/story.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a public repost to a story. + # + # @attr story [TD::Types::Story] Information about the story. + class PublicForward::Story < PublicForward + attribute :story, TD::Types::Story + end +end diff --git a/lib/tdlib/types/public_forwards.rb b/lib/tdlib/types/public_forwards.rb new file mode 100644 index 00000000..3dc5ae18 --- /dev/null +++ b/lib/tdlib/types/public_forwards.rb @@ -0,0 +1,13 @@ +module TD::Types + # Represents a list of public forwards and reposts as a story of a message or a story. + # + # @attr total_count [Integer] Approximate total number of messages and stories found. + # @attr forwards [Array] List of found public forwards and reposts. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. + class PublicForwards < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :forwards, TD::Types::Array.of(TD::Types::PublicForward) + attribute :next_offset, TD::Types::String + end +end diff --git a/lib/tdlib/types/push_message_content.rb b/lib/tdlib/types/push_message_content.rb index d2e5dd29..fb2453a3 100644 --- a/lib/tdlib/types/push_message_content.rb +++ b/lib/tdlib/types/push_message_content.rb @@ -12,10 +12,14 @@ class PushMessageContent < Base game_score invoice location + paid_media photo poll + premium_gift_code + premium_giveaway screenshot_taken sticker + story text video video_note @@ -24,8 +28,13 @@ class PushMessageContent < Base chat_add_members chat_change_photo chat_change_title + chat_set_background + chat_set_theme chat_delete_member chat_join_by_link + chat_join_by_request + recurring_payment + suggest_profile_photo message_forwards media_album ].each do |type| diff --git a/lib/tdlib/types/push_message_content/chat_add_members.rb b/lib/tdlib/types/push_message_content/chat_add_members.rb index 6de8218e..cc9a2496 100644 --- a/lib/tdlib/types/push_message_content/chat_add_members.rb +++ b/lib/tdlib/types/push_message_content/chat_add_members.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr member_name [TD::Types::String] Name of the added member. # @attr is_current_user [Boolean] True, if the current user was added to the group. - # @attr is_returned [Boolean] True, if the user has returned to the group themself. + # @attr is_returned [Boolean] True, if the user has returned to the group themselves. class PushMessageContent::ChatAddMembers < PushMessageContent attribute :member_name, TD::Types::String attribute :is_current_user, TD::Types::Bool diff --git a/lib/tdlib/types/push_message_content/chat_delete_member.rb b/lib/tdlib/types/push_message_content/chat_delete_member.rb index 28e01d98..ee9272e7 100644 --- a/lib/tdlib/types/push_message_content/chat_delete_member.rb +++ b/lib/tdlib/types/push_message_content/chat_delete_member.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr member_name [TD::Types::String] Name of the deleted member. # @attr is_current_user [Boolean] True, if the current user was deleted from the group. - # @attr is_left [Boolean] True, if the user has left the group themself. + # @attr is_left [Boolean] True, if the user has left the group themselves. class PushMessageContent::ChatDeleteMember < PushMessageContent attribute :member_name, TD::Types::String attribute :is_current_user, TD::Types::Bool diff --git a/lib/tdlib/types/push_message_content/chat_join_by_link.rb b/lib/tdlib/types/push_message_content/chat_join_by_link.rb index 97a3c626..b30ac2fe 100644 --- a/lib/tdlib/types/push_message_content/chat_join_by_link.rb +++ b/lib/tdlib/types/push_message_content/chat_join_by_link.rb @@ -1,5 +1,5 @@ module TD::Types - # A new member joined the chat by invite link. + # A new member joined the chat via an invite link. class PushMessageContent::ChatJoinByLink < PushMessageContent end end diff --git a/lib/tdlib/types/push_message_content/chat_join_by_request.rb b/lib/tdlib/types/push_message_content/chat_join_by_request.rb new file mode 100644 index 00000000..f4555dd3 --- /dev/null +++ b/lib/tdlib/types/push_message_content/chat_join_by_request.rb @@ -0,0 +1,5 @@ +module TD::Types + # A new member was accepted to the chat by an administrator. + class PushMessageContent::ChatJoinByRequest < PushMessageContent + end +end diff --git a/lib/tdlib/types/push_message_content/chat_set_background.rb b/lib/tdlib/types/push_message_content/chat_set_background.rb new file mode 100644 index 00000000..950de7f1 --- /dev/null +++ b/lib/tdlib/types/push_message_content/chat_set_background.rb @@ -0,0 +1,8 @@ +module TD::Types + # A chat background was edited. + # + # @attr is_same [Boolean] True, if the set background is the same as the background of the current user. + class PushMessageContent::ChatSetBackground < PushMessageContent + attribute :is_same, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/push_message_content/chat_set_theme.rb b/lib/tdlib/types/push_message_content/chat_set_theme.rb new file mode 100644 index 00000000..3e73c073 --- /dev/null +++ b/lib/tdlib/types/push_message_content/chat_set_theme.rb @@ -0,0 +1,9 @@ +module TD::Types + # A chat theme was edited. + # + # @attr theme_name [TD::Types::String] If non-empty, name of a new theme, set for the chat. + # Otherwise, the chat theme was reset to the default one. + class PushMessageContent::ChatSetTheme < PushMessageContent + attribute :theme_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/push_message_content/media_album.rb b/lib/tdlib/types/push_message_content/media_album.rb index af8e1dfc..e70d0831 100644 --- a/lib/tdlib/types/push_message_content/media_album.rb +++ b/lib/tdlib/types/push_message_content/media_album.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr total_count [Integer] Number of messages in the album. # @attr has_photos [Boolean] True, if the album has at least one photo. - # @attr has_videos [Boolean] True, if the album has at least one video. + # @attr has_videos [Boolean] True, if the album has at least one video file. # @attr has_audios [Boolean] True, if the album has at least one audio file. # @attr has_documents [Boolean] True, if the album has at least one document. class PushMessageContent::MediaAlbum < PushMessageContent diff --git a/lib/tdlib/types/push_message_content/paid_media.rb b/lib/tdlib/types/push_message_content/paid_media.rb new file mode 100644 index 00000000..8a9f0dc6 --- /dev/null +++ b/lib/tdlib/types/push_message_content/paid_media.rb @@ -0,0 +1,11 @@ +module TD::Types + # A message with paid media. + # + # @attr star_count [Integer] Number of Telegram Stars needed to buy access to the media in the message; 0 for pinned + # message. + # @attr is_pinned [Boolean] True, if the message is a pinned message with the specified content. + class PushMessageContent::PaidMedia < PushMessageContent + attribute :star_count, TD::Types::Coercible::Integer + attribute :is_pinned, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/push_message_content/premium_gift_code.rb b/lib/tdlib/types/push_message_content/premium_gift_code.rb new file mode 100644 index 00000000..77b9760d --- /dev/null +++ b/lib/tdlib/types/push_message_content/premium_gift_code.rb @@ -0,0 +1,9 @@ +module TD::Types + # A message with a Telegram Premium gift code created for the user. + # + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active after code + # activation. + class PushMessageContent::PremiumGiftCode < PushMessageContent + attribute :month_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/push_message_content/premium_giveaway.rb b/lib/tdlib/types/push_message_content/premium_giveaway.rb new file mode 100644 index 00000000..ca4aca4c --- /dev/null +++ b/lib/tdlib/types/push_message_content/premium_giveaway.rb @@ -0,0 +1,14 @@ +module TD::Types + # A message with a Telegram Premium giveaway. + # + # @attr winner_count [Integer] Number of users which will receive Telegram Premium subscription gift codes; 0 for + # pinned message. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active after code + # activation; 0 for pinned message. + # @attr is_pinned [Boolean] True, if the message is a pinned message with the specified content. + class PushMessageContent::PremiumGiveaway < PushMessageContent + attribute :winner_count, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + attribute :is_pinned, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/push_message_content/recurring_payment.rb b/lib/tdlib/types/push_message_content/recurring_payment.rb new file mode 100644 index 00000000..8840e252 --- /dev/null +++ b/lib/tdlib/types/push_message_content/recurring_payment.rb @@ -0,0 +1,8 @@ +module TD::Types + # A new recurring payment was made by the current user. + # + # @attr amount [TD::Types::String] The paid amount. + class PushMessageContent::RecurringPayment < PushMessageContent + attribute :amount, TD::Types::String + end +end diff --git a/lib/tdlib/types/push_message_content/story.rb b/lib/tdlib/types/push_message_content/story.rb new file mode 100644 index 00000000..31684269 --- /dev/null +++ b/lib/tdlib/types/push_message_content/story.rb @@ -0,0 +1,8 @@ +module TD::Types + # A message with a story. + # + # @attr is_pinned [Boolean] True, if the message is a pinned message with the specified content. + class PushMessageContent::Story < PushMessageContent + attribute :is_pinned, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/push_message_content/suggest_profile_photo.rb b/lib/tdlib/types/push_message_content/suggest_profile_photo.rb new file mode 100644 index 00000000..ddaacdae --- /dev/null +++ b/lib/tdlib/types/push_message_content/suggest_profile_photo.rb @@ -0,0 +1,5 @@ +module TD::Types + # A profile photo was suggested to the user. + class PushMessageContent::SuggestProfilePhoto < PushMessageContent + end +end diff --git a/lib/tdlib/types/quick_reply_message.rb b/lib/tdlib/types/quick_reply_message.rb new file mode 100644 index 00000000..7ecd234a --- /dev/null +++ b/lib/tdlib/types/quick_reply_message.rb @@ -0,0 +1,25 @@ +module TD::Types + # Describes a message that can be used for quick reply. + # + # @attr id [Integer] Unique message identifier among all quick replies. + # @attr sending_state [TD::Types::MessageSendingState, nil] The sending state of the message; may be null if the + # message isn't being sent and didn't fail to be sent. + # @attr can_be_edited [Boolean] True, if the message can be edited. + # @attr reply_to_message_id [Integer] The identifier of the quick reply message to which the message replies; 0 if + # none. + # @attr via_bot_user_id [Integer] If non-zero, the user identifier of the bot through which this message was sent. + # @attr media_album_id [Integer] Unique identifier of an album this message belongs to; 0 if none. + # Only audios, documents, photos and videos can be grouped together in albums. + # @attr content [TD::Types::MessageContent] Content of the message. + # @attr reply_markup [TD::Types::ReplyMarkup, nil] Inline keyboard reply markup for the message; may be null if none. + class QuickReplyMessage < Base + attribute :id, TD::Types::Coercible::Integer + attribute :sending_state, TD::Types::MessageSendingState.optional.default(nil) + attribute :can_be_edited, TD::Types::Bool + attribute :reply_to_message_id, TD::Types::Coercible::Integer + attribute :via_bot_user_id, TD::Types::Coercible::Integer + attribute :media_album_id, TD::Types::Coercible::Integer + attribute :content, TD::Types::MessageContent + attribute :reply_markup, TD::Types::ReplyMarkup.optional.default(nil) + end +end diff --git a/lib/tdlib/types/quick_reply_messages.rb b/lib/tdlib/types/quick_reply_messages.rb new file mode 100644 index 00000000..cda0f67f --- /dev/null +++ b/lib/tdlib/types/quick_reply_messages.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of quick reply messages. + # + # @attr messages [Array, nil] List of quick reply messages; messages may be null. + class QuickReplyMessages < Base + attribute :messages, TD::Types::Array.of(TD::Types::QuickReplyMessage).optional.default(nil) + end +end diff --git a/lib/tdlib/types/quick_reply_shortcut.rb b/lib/tdlib/types/quick_reply_shortcut.rb new file mode 100644 index 00000000..d75ab42d --- /dev/null +++ b/lib/tdlib/types/quick_reply_shortcut.rb @@ -0,0 +1,14 @@ +module TD::Types + # Describes a shortcut that can be used for a quick reply. + # + # @attr id [Integer] Unique shortcut identifier. + # @attr name [TD::Types::String] The name of the shortcut that can be used to use the shortcut. + # @attr first_message [TD::Types::QuickReplyMessage] The first shortcut message. + # @attr message_count [Integer] The total number of messages in the shortcut. + class QuickReplyShortcut < Base + attribute :id, TD::Types::Coercible::Integer + attribute :name, TD::Types::String + attribute :first_message, TD::Types::QuickReplyMessage + attribute :message_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/reaction_notification_settings.rb b/lib/tdlib/types/reaction_notification_settings.rb new file mode 100644 index 00000000..5ee63736 --- /dev/null +++ b/lib/tdlib/types/reaction_notification_settings.rb @@ -0,0 +1,16 @@ +module TD::Types + # Contains information about notification settings for reactions. + # + # @attr message_reaction_source [TD::Types::ReactionNotificationSource] Source of message reactions for which + # notifications are shown. + # @attr story_reaction_source [TD::Types::ReactionNotificationSource] Source of story reactions for which + # notifications are shown. + # @attr sound_id [Integer] Identifier of the notification sound to be played; 0 if sound is disabled. + # @attr show_preview [Boolean] True, if reaction sender and emoji must be displayed in notifications. + class ReactionNotificationSettings < Base + attribute :message_reaction_source, TD::Types::ReactionNotificationSource + attribute :story_reaction_source, TD::Types::ReactionNotificationSource + attribute :sound_id, TD::Types::Coercible::Integer + attribute :show_preview, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/reaction_notification_source.rb b/lib/tdlib/types/reaction_notification_source.rb new file mode 100644 index 00000000..22aa1850 --- /dev/null +++ b/lib/tdlib/types/reaction_notification_source.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes sources of reactions for which notifications will be shown. + class ReactionNotificationSource < Base + %w[ + none + contacts + all + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/reaction_notification_source/#{type}" + end + end +end diff --git a/lib/tdlib/types/reaction_notification_source/all.rb b/lib/tdlib/types/reaction_notification_source/all.rb new file mode 100644 index 00000000..bf7eff56 --- /dev/null +++ b/lib/tdlib/types/reaction_notification_source/all.rb @@ -0,0 +1,5 @@ +module TD::Types + # Notifications for reactions are shown for all reactions. + class ReactionNotificationSource::All < ReactionNotificationSource + end +end diff --git a/lib/tdlib/types/reaction_notification_source/contacts.rb b/lib/tdlib/types/reaction_notification_source/contacts.rb new file mode 100644 index 00000000..dd02c923 --- /dev/null +++ b/lib/tdlib/types/reaction_notification_source/contacts.rb @@ -0,0 +1,5 @@ +module TD::Types + # Notifications for reactions are shown only for reactions from contacts. + class ReactionNotificationSource::Contacts < ReactionNotificationSource + end +end diff --git a/lib/tdlib/types/reaction_notification_source/none.rb b/lib/tdlib/types/reaction_notification_source/none.rb new file mode 100644 index 00000000..c2d7d2c6 --- /dev/null +++ b/lib/tdlib/types/reaction_notification_source/none.rb @@ -0,0 +1,5 @@ +module TD::Types + # Notifications for reactions are disabled. + class ReactionNotificationSource::None < ReactionNotificationSource + end +end diff --git a/lib/tdlib/types/reaction_type.rb b/lib/tdlib/types/reaction_type.rb new file mode 100644 index 00000000..303f5f44 --- /dev/null +++ b/lib/tdlib/types/reaction_type.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes type of message reaction. + class ReactionType < Base + %w[ + emoji + custom_emoji + paid + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/reaction_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/reaction_type/custom_emoji.rb b/lib/tdlib/types/reaction_type/custom_emoji.rb new file mode 100644 index 00000000..6bcd0716 --- /dev/null +++ b/lib/tdlib/types/reaction_type/custom_emoji.rb @@ -0,0 +1,8 @@ +module TD::Types + # A reaction with a custom emoji. + # + # @attr custom_emoji_id [Integer] Unique identifier of the custom emoji. + class ReactionType::CustomEmoji < ReactionType + attribute :custom_emoji_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/reaction_type/emoji.rb b/lib/tdlib/types/reaction_type/emoji.rb new file mode 100644 index 00000000..c18c9c06 --- /dev/null +++ b/lib/tdlib/types/reaction_type/emoji.rb @@ -0,0 +1,8 @@ +module TD::Types + # A reaction with an emoji. + # + # @attr emoji [TD::Types::String] Text representation of the reaction. + class ReactionType::Emoji < ReactionType + attribute :emoji, TD::Types::String + end +end diff --git a/lib/tdlib/types/reaction_type/paid.rb b/lib/tdlib/types/reaction_type/paid.rb new file mode 100644 index 00000000..8bdb0602 --- /dev/null +++ b/lib/tdlib/types/reaction_type/paid.rb @@ -0,0 +1,5 @@ +module TD::Types + # The paid reaction in a channel chat. + class ReactionType::Paid < ReactionType + end +end diff --git a/lib/tdlib/types/reaction_unavailability_reason.rb b/lib/tdlib/types/reaction_unavailability_reason.rb new file mode 100644 index 00000000..5a7a287b --- /dev/null +++ b/lib/tdlib/types/reaction_unavailability_reason.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes why the current user can't add reactions to the message, despite some other users can. + class ReactionUnavailabilityReason < Base + %w[ + anonymous_administrator + guest + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/reaction_unavailability_reason/#{type}" + end + end +end diff --git a/lib/tdlib/types/reaction_unavailability_reason/anonymous_administrator.rb b/lib/tdlib/types/reaction_unavailability_reason/anonymous_administrator.rb new file mode 100644 index 00000000..539df596 --- /dev/null +++ b/lib/tdlib/types/reaction_unavailability_reason/anonymous_administrator.rb @@ -0,0 +1,6 @@ +module TD::Types + # The user is an anonymous administrator in the supergroup, but isn't a creator of it, so they can't vote on behalf + # of the supergroup. + class ReactionUnavailabilityReason::AnonymousAdministrator < ReactionUnavailabilityReason + end +end diff --git a/lib/tdlib/types/reaction_unavailability_reason/guest.rb b/lib/tdlib/types/reaction_unavailability_reason/guest.rb new file mode 100644 index 00000000..91e6e3f3 --- /dev/null +++ b/lib/tdlib/types/reaction_unavailability_reason/guest.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user isn't a member of the supergroup and can't send messages and reactions there without joining. + class ReactionUnavailabilityReason::Guest < ReactionUnavailabilityReason + end +end diff --git a/lib/tdlib/types/read_date_privacy_settings.rb b/lib/tdlib/types/read_date_privacy_settings.rb new file mode 100644 index 00000000..2a59ed31 --- /dev/null +++ b/lib/tdlib/types/read_date_privacy_settings.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains privacy settings for message read date in private chats. + # Read dates are always shown to the users that can see online status of the current user regardless of this setting. + # + # @attr show_read_date [Boolean] True, if message read date is shown to other users in private chats. + # If false and the current user isn't a Telegram Premium user, then they will not be able to see other's message + # read date. + class ReadDatePrivacySettings < Base + attribute :show_read_date, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/recommended_chat_filter.rb b/lib/tdlib/types/recommended_chat_filter.rb deleted file mode 100644 index 3dc47681..00000000 --- a/lib/tdlib/types/recommended_chat_filter.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # Describes a recommended chat filter. - # - # @attr filter [TD::Types::ChatFilter] The chat filter. - # @attr description [TD::Types::String] Chat filter description. - class RecommendedChatFilter < Base - attribute :filter, TD::Types::ChatFilter - attribute :description, TD::Types::String - end -end diff --git a/lib/tdlib/types/recommended_chat_filters.rb b/lib/tdlib/types/recommended_chat_filters.rb deleted file mode 100644 index b6cb9b8f..00000000 --- a/lib/tdlib/types/recommended_chat_filters.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # Contains a list of recommended chat filters. - # - # @attr chat_filters [Array] List of recommended chat filters. - class RecommendedChatFilters < Base - attribute :chat_filters, TD::Types::Array.of(TD::Types::RecommendedChatFilter) - end -end diff --git a/lib/tdlib/types/recommended_chat_folder.rb b/lib/tdlib/types/recommended_chat_folder.rb new file mode 100644 index 00000000..de5bc4e0 --- /dev/null +++ b/lib/tdlib/types/recommended_chat_folder.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a recommended chat folder. + # + # @attr folder [TD::Types::ChatFolder] The chat folder. + # @attr description [TD::Types::String] Chat folder description. + class RecommendedChatFolder < Base + attribute :folder, TD::Types::ChatFolder + attribute :description, TD::Types::String + end +end diff --git a/lib/tdlib/types/recommended_chat_folders.rb b/lib/tdlib/types/recommended_chat_folders.rb new file mode 100644 index 00000000..b89ca9ee --- /dev/null +++ b/lib/tdlib/types/recommended_chat_folders.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of recommended chat folders. + # + # @attr chat_folders [Array] List of recommended chat folders. + class RecommendedChatFolders < Base + attribute :chat_folders, TD::Types::Array.of(TD::Types::RecommendedChatFolder) + end +end diff --git a/lib/tdlib/types/remote_file.rb b/lib/tdlib/types/remote_file.rb index 1c88f205..33243d29 100644 --- a/lib/tdlib/types/remote_file.rb +++ b/lib/tdlib/types/remote_file.rb @@ -4,19 +4,19 @@ module TD::Types # @attr id [TD::Types::String, nil] Remote file identifier; may be empty. # Can be used by the current user across application restarts or even from other devices. # Uniquely identifies a file, but a file can have a lot of different valid identifiers. - # If the ID starts with "http://" or "https://", it represents the HTTP URL of the file. + # If the identifier starts with "http://" or "https://", it represents the HTTP URL of the file. # TDLib is currently unable to download files if only their URL is known. - # If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation - # process by sending {TD::Types::Update::FileGenerationStart} to the application with the HTTP URL in the original_path - # and "#url#" as the conversion string. - # Application should generate the file by downloading it to the specified location. + # If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a + # file generation process by sending {TD::Types::Update::FileGenerationStart} to the application with the HTTP URL in the + # original_path and "#url#" as the conversion string. + # Application must generate the file by downloading it to the specified location. # @attr unique_id [TD::Types::String, nil] Unique file identifier; may be empty if unknown. # The unique file identifier which is the same for the same file even for different users and is persistent over # time. # @attr is_uploading_active [Boolean] True, if the file is currently being uploaded (or a remote copy is being # generated by some other means). # @attr is_uploading_completed [Boolean] True, if a remote copy is fully available. - # @attr uploaded_size [Integer] Size of the remote available part of the file; 0 if unknown. + # @attr uploaded_size [Integer] Size of the remote available part of the file, in bytes; 0 if unknown. class RemoteFile < Base attribute :id, TD::Types::String.optional.default(nil) attribute :unique_id, TD::Types::String.optional.default(nil) diff --git a/lib/tdlib/types/reply_markup/force_reply.rb b/lib/tdlib/types/reply_markup/force_reply.rb index 0defae60..5affd811 100644 --- a/lib/tdlib/types/reply_markup/force_reply.rb +++ b/lib/tdlib/types/reply_markup/force_reply.rb @@ -4,7 +4,10 @@ module TD::Types # @attr is_personal [Boolean] True, if a forced reply must automatically be shown to the current user. # For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user # of a reply. + # @attr input_field_placeholder [TD::Types::String] If non-empty, the placeholder to be shown in the input field when + # the reply is active; 0-64 characters. class ReplyMarkup::ForceReply < ReplyMarkup attribute :is_personal, TD::Types::Bool + attribute :input_field_placeholder, TD::Types::String end end diff --git a/lib/tdlib/types/reply_markup/remove_keyboard.rb b/lib/tdlib/types/reply_markup/remove_keyboard.rb index e59a68ef..8e987705 100644 --- a/lib/tdlib/types/reply_markup/remove_keyboard.rb +++ b/lib/tdlib/types/reply_markup/remove_keyboard.rb @@ -1,6 +1,6 @@ module TD::Types # Instructs application to remove the keyboard once this message has been received. - # This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 + # This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 # will be sent. # # @attr is_personal [Boolean] True, if the keyboard is removed only for the mentioned users or the target user of a diff --git a/lib/tdlib/types/reply_markup/show_keyboard.rb b/lib/tdlib/types/reply_markup/show_keyboard.rb index 30f97c49..c2be71b4 100644 --- a/lib/tdlib/types/reply_markup/show_keyboard.rb +++ b/lib/tdlib/types/reply_markup/show_keyboard.rb @@ -2,15 +2,21 @@ module TD::Types # Contains a custom keyboard layout to quickly reply to bots. # # @attr rows [Array>] A list of rows of bot keyboard buttons. + # @attr is_persistent [Boolean] True, if the keyboard is supposed to always be shown when the ordinary keyboard is + # hidden. # @attr resize_keyboard [Boolean] True, if the application needs to resize the keyboard vertically. # @attr one_time [Boolean] True, if the application needs to hide the keyboard after use. # @attr is_personal [Boolean] True, if the keyboard must automatically be shown to the current user. # For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of # a reply. + # @attr input_field_placeholder [TD::Types::String] If non-empty, the placeholder to be shown in the input field when + # the keyboard is active; 0-64 characters. class ReplyMarkup::ShowKeyboard < ReplyMarkup attribute :rows, TD::Types::Array.of(TD::Types::Array.of(TD::Types::KeyboardButton)) + attribute :is_persistent, TD::Types::Bool attribute :resize_keyboard, TD::Types::Bool attribute :one_time, TD::Types::Bool attribute :is_personal, TD::Types::Bool + attribute :input_field_placeholder, TD::Types::String end end diff --git a/lib/tdlib/types/report_chat_sponsored_message_option.rb b/lib/tdlib/types/report_chat_sponsored_message_option.rb new file mode 100644 index 00000000..2243efab --- /dev/null +++ b/lib/tdlib/types/report_chat_sponsored_message_option.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes an option to report a sponsored message. + # + # @attr id [String] Unique identifier of the option. + # @attr text [TD::Types::String] Text of the option. + class ReportChatSponsoredMessageOption < Base + attribute :id, TD::Types::Coercible::String + attribute :text, TD::Types::String + end +end diff --git a/lib/tdlib/types/report_chat_sponsored_message_result.rb b/lib/tdlib/types/report_chat_sponsored_message_result.rb new file mode 100644 index 00000000..22161fa4 --- /dev/null +++ b/lib/tdlib/types/report_chat_sponsored_message_result.rb @@ -0,0 +1,14 @@ +module TD::Types + # Describes result of sponsored message report. + class ReportChatSponsoredMessageResult < Base + %w[ + ok + failed + option_required + ads_hidden + premium_required + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/report_chat_sponsored_message_result/#{type}" + end + end +end diff --git a/lib/tdlib/types/report_chat_sponsored_message_result/ads_hidden.rb b/lib/tdlib/types/report_chat_sponsored_message_result/ads_hidden.rb new file mode 100644 index 00000000..835bb200 --- /dev/null +++ b/lib/tdlib/types/report_chat_sponsored_message_result/ads_hidden.rb @@ -0,0 +1,5 @@ +module TD::Types + # Sponsored messages were hidden for the user in all chats. + class ReportChatSponsoredMessageResult::AdsHidden < ReportChatSponsoredMessageResult + end +end diff --git a/lib/tdlib/types/report_chat_sponsored_message_result/failed.rb b/lib/tdlib/types/report_chat_sponsored_message_result/failed.rb new file mode 100644 index 00000000..4596badf --- /dev/null +++ b/lib/tdlib/types/report_chat_sponsored_message_result/failed.rb @@ -0,0 +1,5 @@ +module TD::Types + # The sponsored message is too old or not found. + class ReportChatSponsoredMessageResult::Failed < ReportChatSponsoredMessageResult + end +end diff --git a/lib/tdlib/types/report_chat_sponsored_message_result/ok.rb b/lib/tdlib/types/report_chat_sponsored_message_result/ok.rb new file mode 100644 index 00000000..0997ca9d --- /dev/null +++ b/lib/tdlib/types/report_chat_sponsored_message_result/ok.rb @@ -0,0 +1,5 @@ +module TD::Types + # The message was reported successfully. + class ReportChatSponsoredMessageResult::Ok < ReportChatSponsoredMessageResult + end +end diff --git a/lib/tdlib/types/report_chat_sponsored_message_result/option_required.rb b/lib/tdlib/types/report_chat_sponsored_message_result/option_required.rb new file mode 100644 index 00000000..abad501e --- /dev/null +++ b/lib/tdlib/types/report_chat_sponsored_message_result/option_required.rb @@ -0,0 +1,10 @@ +module TD::Types + # The user must choose an option to report the message and repeat request with the chosen option. + # + # @attr title [TD::Types::String] Title for the option choice. + # @attr options [Array] List of available options. + class ReportChatSponsoredMessageResult::OptionRequired < ReportChatSponsoredMessageResult + attribute :title, TD::Types::String + attribute :options, TD::Types::Array.of(TD::Types::ReportChatSponsoredMessageOption) + end +end diff --git a/lib/tdlib/types/report_chat_sponsored_message_result/premium_required.rb b/lib/tdlib/types/report_chat_sponsored_message_result/premium_required.rb new file mode 100644 index 00000000..6ffab412 --- /dev/null +++ b/lib/tdlib/types/report_chat_sponsored_message_result/premium_required.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user asked to hide sponsored messages, but Telegram Premium is required for this. + class ReportChatSponsoredMessageResult::PremiumRequired < ReportChatSponsoredMessageResult + end +end diff --git a/lib/tdlib/types/chat_report_reason.rb b/lib/tdlib/types/report_reason.rb similarity index 61% rename from lib/tdlib/types/chat_report_reason.rb rename to lib/tdlib/types/report_reason.rb index d018f0b5..3b8fed1c 100644 --- a/lib/tdlib/types/chat_report_reason.rb +++ b/lib/tdlib/types/report_reason.rb @@ -1,6 +1,6 @@ module TD::Types # Describes the reason why a chat is reported. - class ChatReportReason < Base + class ReportReason < Base %w[ spam violence @@ -9,9 +9,11 @@ class ChatReportReason < Base copyright unrelated_location fake + illegal_drugs + personal_details custom ].each do |type| - autoload TD::Types.camelize(type), "tdlib/types/chat_report_reason/#{type}" + autoload TD::Types.camelize(type), "tdlib/types/report_reason/#{type}" end end end diff --git a/lib/tdlib/types/chat_report_reason/child_abuse.rb b/lib/tdlib/types/report_reason/child_abuse.rb similarity index 56% rename from lib/tdlib/types/chat_report_reason/child_abuse.rb rename to lib/tdlib/types/report_reason/child_abuse.rb index ca205666..8a392cd5 100644 --- a/lib/tdlib/types/chat_report_reason/child_abuse.rb +++ b/lib/tdlib/types/report_reason/child_abuse.rb @@ -1,5 +1,5 @@ module TD::Types # The chat has child abuse related content. - class ChatReportReason::ChildAbuse < ChatReportReason + class ReportReason::ChildAbuse < ReportReason end end diff --git a/lib/tdlib/types/chat_report_reason/copyright.rb b/lib/tdlib/types/report_reason/copyright.rb similarity index 56% rename from lib/tdlib/types/chat_report_reason/copyright.rb rename to lib/tdlib/types/report_reason/copyright.rb index 3b06d3c7..310e1e09 100644 --- a/lib/tdlib/types/chat_report_reason/copyright.rb +++ b/lib/tdlib/types/report_reason/copyright.rb @@ -1,5 +1,5 @@ module TD::Types # The chat contains copyrighted content. - class ChatReportReason::Copyright < ChatReportReason + class ReportReason::Copyright < ReportReason end end diff --git a/lib/tdlib/types/chat_report_reason/custom.rb b/lib/tdlib/types/report_reason/custom.rb similarity index 57% rename from lib/tdlib/types/chat_report_reason/custom.rb rename to lib/tdlib/types/report_reason/custom.rb index 49c59164..5746886a 100644 --- a/lib/tdlib/types/chat_report_reason/custom.rb +++ b/lib/tdlib/types/report_reason/custom.rb @@ -1,5 +1,5 @@ module TD::Types # A custom reason provided by the user. - class ChatReportReason::Custom < ChatReportReason + class ReportReason::Custom < ReportReason end end diff --git a/lib/tdlib/types/chat_report_reason/fake.rb b/lib/tdlib/types/report_reason/fake.rb similarity index 57% rename from lib/tdlib/types/chat_report_reason/fake.rb rename to lib/tdlib/types/report_reason/fake.rb index 75c0fae3..3d793c9f 100644 --- a/lib/tdlib/types/chat_report_reason/fake.rb +++ b/lib/tdlib/types/report_reason/fake.rb @@ -1,5 +1,5 @@ module TD::Types # The chat represents a fake account. - class ChatReportReason::Fake < ChatReportReason + class ReportReason::Fake < ReportReason end end diff --git a/lib/tdlib/types/report_reason/illegal_drugs.rb b/lib/tdlib/types/report_reason/illegal_drugs.rb new file mode 100644 index 00000000..d5d93bc4 --- /dev/null +++ b/lib/tdlib/types/report_reason/illegal_drugs.rb @@ -0,0 +1,5 @@ +module TD::Types + # The chat has illegal drugs related content. + class ReportReason::IllegalDrugs < ReportReason + end +end diff --git a/lib/tdlib/types/report_reason/personal_details.rb b/lib/tdlib/types/report_reason/personal_details.rb new file mode 100644 index 00000000..d57d2849 --- /dev/null +++ b/lib/tdlib/types/report_reason/personal_details.rb @@ -0,0 +1,5 @@ +module TD::Types + # The chat contains messages with personal details. + class ReportReason::PersonalDetails < ReportReason + end +end diff --git a/lib/tdlib/types/chat_report_reason/pornography.rb b/lib/tdlib/types/report_reason/pornography.rb similarity index 55% rename from lib/tdlib/types/chat_report_reason/pornography.rb rename to lib/tdlib/types/report_reason/pornography.rb index 53da7955..cc3112e0 100644 --- a/lib/tdlib/types/chat_report_reason/pornography.rb +++ b/lib/tdlib/types/report_reason/pornography.rb @@ -1,5 +1,5 @@ module TD::Types # The chat contains pornographic messages. - class ChatReportReason::Pornography < ChatReportReason + class ReportReason::Pornography < ReportReason end end diff --git a/lib/tdlib/types/chat_report_reason/spam.rb b/lib/tdlib/types/report_reason/spam.rb similarity index 56% rename from lib/tdlib/types/chat_report_reason/spam.rb rename to lib/tdlib/types/report_reason/spam.rb index 787d4542..e7040b69 100644 --- a/lib/tdlib/types/chat_report_reason/spam.rb +++ b/lib/tdlib/types/report_reason/spam.rb @@ -1,5 +1,5 @@ module TD::Types # The chat contains spam messages. - class ChatReportReason::Spam < ChatReportReason + class ReportReason::Spam < ReportReason end end diff --git a/lib/tdlib/types/chat_report_reason/unrelated_location.rb b/lib/tdlib/types/report_reason/unrelated_location.rb similarity index 59% rename from lib/tdlib/types/chat_report_reason/unrelated_location.rb rename to lib/tdlib/types/report_reason/unrelated_location.rb index addde3ac..9ca51688 100644 --- a/lib/tdlib/types/chat_report_reason/unrelated_location.rb +++ b/lib/tdlib/types/report_reason/unrelated_location.rb @@ -1,5 +1,5 @@ module TD::Types # The location-based chat is unrelated to its stated location. - class ChatReportReason::UnrelatedLocation < ChatReportReason + class ReportReason::UnrelatedLocation < ReportReason end end diff --git a/lib/tdlib/types/chat_report_reason/violence.rb b/lib/tdlib/types/report_reason/violence.rb similarity index 52% rename from lib/tdlib/types/chat_report_reason/violence.rb rename to lib/tdlib/types/report_reason/violence.rb index a32fddab..a24bb767 100644 --- a/lib/tdlib/types/chat_report_reason/violence.rb +++ b/lib/tdlib/types/report_reason/violence.rb @@ -1,5 +1,5 @@ module TD::Types # The chat promotes violence. - class ChatReportReason::Violence < ChatReportReason + class ReportReason::Violence < ReportReason end end diff --git a/lib/tdlib/types/resend_code_reason.rb b/lib/tdlib/types/resend_code_reason.rb new file mode 100644 index 00000000..d8ef72a8 --- /dev/null +++ b/lib/tdlib/types/resend_code_reason.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes the reason why a code needs to be re-sent. + class ResendCodeReason < Base + %w[ + user_request + verification_failed + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/resend_code_reason/#{type}" + end + end +end diff --git a/lib/tdlib/types/resend_code_reason/user_request.rb b/lib/tdlib/types/resend_code_reason/user_request.rb new file mode 100644 index 00000000..236aabb4 --- /dev/null +++ b/lib/tdlib/types/resend_code_reason/user_request.rb @@ -0,0 +1,5 @@ +module TD::Types + # The user requested to resend the code. + class ResendCodeReason::UserRequest < ResendCodeReason + end +end diff --git a/lib/tdlib/types/resend_code_reason/verification_failed.rb b/lib/tdlib/types/resend_code_reason/verification_failed.rb new file mode 100644 index 00000000..8822f95c --- /dev/null +++ b/lib/tdlib/types/resend_code_reason/verification_failed.rb @@ -0,0 +1,9 @@ +module TD::Types + # The code is re-sent, because device verification has failed. + # + # @attr error_message [TD::Types::String] Cause of the verification failure, for example, + # PLAY_SERVICES_NOT_AVAILABLE, APNS_RECEIVE_TIMEOUT, or APNS_INIT_FAILED. + class ResendCodeReason::VerificationFailed < ResendCodeReason + attribute :error_message, TD::Types::String + end +end diff --git a/lib/tdlib/types/reset_password_result.rb b/lib/tdlib/types/reset_password_result.rb new file mode 100644 index 00000000..c37ecf4d --- /dev/null +++ b/lib/tdlib/types/reset_password_result.rb @@ -0,0 +1,12 @@ +module TD::Types + # Represents result of 2-step verification password reset. + class ResetPasswordResult < Base + %w[ + ok + pending + declined + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/reset_password_result/#{type}" + end + end +end diff --git a/lib/tdlib/types/reset_password_result/declined.rb b/lib/tdlib/types/reset_password_result/declined.rb new file mode 100644 index 00000000..e35da9ac --- /dev/null +++ b/lib/tdlib/types/reset_password_result/declined.rb @@ -0,0 +1,8 @@ +module TD::Types + # The password reset request was declined. + # + # @attr retry_date [Integer] Point in time (Unix timestamp) when the password reset can be retried. + class ResetPasswordResult::Declined < ResetPasswordResult + attribute :retry_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/reset_password_result/ok.rb b/lib/tdlib/types/reset_password_result/ok.rb new file mode 100644 index 00000000..d444d35f --- /dev/null +++ b/lib/tdlib/types/reset_password_result/ok.rb @@ -0,0 +1,5 @@ +module TD::Types + # The password was reset. + class ResetPasswordResult::Ok < ResetPasswordResult + end +end diff --git a/lib/tdlib/types/reset_password_result/pending.rb b/lib/tdlib/types/reset_password_result/pending.rb new file mode 100644 index 00000000..ae447581 --- /dev/null +++ b/lib/tdlib/types/reset_password_result/pending.rb @@ -0,0 +1,9 @@ +module TD::Types + # The password reset request is pending. + # + # @attr pending_reset_date [Integer] Point in time (Unix timestamp) after which the password can be reset immediately + # using resetPassword. + class ResetPasswordResult::Pending < ResetPasswordResult + attribute :pending_reset_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/revenue_withdrawal_state.rb b/lib/tdlib/types/revenue_withdrawal_state.rb new file mode 100644 index 00000000..998c467f --- /dev/null +++ b/lib/tdlib/types/revenue_withdrawal_state.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes state of a revenue withdrawal. + class RevenueWithdrawalState < Base + %w[ + pending + succeeded + failed + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/revenue_withdrawal_state/#{type}" + end + end +end diff --git a/lib/tdlib/types/revenue_withdrawal_state/failed.rb b/lib/tdlib/types/revenue_withdrawal_state/failed.rb new file mode 100644 index 00000000..2f6130d5 --- /dev/null +++ b/lib/tdlib/types/revenue_withdrawal_state/failed.rb @@ -0,0 +1,5 @@ +module TD::Types + # Withdrawal failed. + class RevenueWithdrawalState::Failed < RevenueWithdrawalState + end +end diff --git a/lib/tdlib/types/revenue_withdrawal_state/pending.rb b/lib/tdlib/types/revenue_withdrawal_state/pending.rb new file mode 100644 index 00000000..e3fd07cc --- /dev/null +++ b/lib/tdlib/types/revenue_withdrawal_state/pending.rb @@ -0,0 +1,5 @@ +module TD::Types + # Withdrawal is pending. + class RevenueWithdrawalState::Pending < RevenueWithdrawalState + end +end diff --git a/lib/tdlib/types/revenue_withdrawal_state/succeeded.rb b/lib/tdlib/types/revenue_withdrawal_state/succeeded.rb new file mode 100644 index 00000000..1573dd10 --- /dev/null +++ b/lib/tdlib/types/revenue_withdrawal_state/succeeded.rb @@ -0,0 +1,10 @@ +module TD::Types + # Withdrawal succeeded. + # + # @attr date [Integer] Point in time (Unix timestamp) when the withdrawal was completed. + # @attr url [TD::Types::String] The URL where the withdrawal transaction can be viewed. + class RevenueWithdrawalState::Succeeded < RevenueWithdrawalState + attribute :date, TD::Types::Coercible::Integer + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/rich_text.rb b/lib/tdlib/types/rich_text.rb index cab7938b..eb70f0cf 100644 --- a/lib/tdlib/types/rich_text.rb +++ b/lib/tdlib/types/rich_text.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes a text object inside an instant-view web page. + # Describes a formatted text object. class RichText < Base %w[ plain diff --git a/lib/tdlib/types/rich_text/anchor_link.rb b/lib/tdlib/types/rich_text/anchor_link.rb index 9bcb1219..4489ef19 100644 --- a/lib/tdlib/types/rich_text/anchor_link.rb +++ b/lib/tdlib/types/rich_text/anchor_link.rb @@ -1,9 +1,9 @@ module TD::Types - # A link to an anchor on the same web page. + # A link to an anchor on the same page. # # @attr text [TD::Types::RichText] The link text. # @attr anchor_name [TD::Types::String] The anchor name. - # If the name is empty, the link should bring back to top. + # If the name is empty, the link must bring back to top. # @attr url [TD::Types::String] An HTTP URL, opening the anchor. class RichText::AnchorLink < RichText attribute :text, TD::Types::RichText diff --git a/lib/tdlib/types/rich_text/icon.rb b/lib/tdlib/types/rich_text/icon.rb index 2654de93..6b36dedd 100644 --- a/lib/tdlib/types/rich_text/icon.rb +++ b/lib/tdlib/types/rich_text/icon.rb @@ -3,8 +3,8 @@ module TD::Types # # @attr document [TD::Types::Document] The image represented as a document. # The image can be in GIF, JPEG or PNG format. - # @attr width [Integer] Width of a bounding box in which the image should be shown; 0 if unknown. - # @attr height [Integer] Height of a bounding box in which the image should be shown; 0 if unknown. + # @attr width [Integer] Width of a bounding box in which the image must be shown; 0 if unknown. + # @attr height [Integer] Height of a bounding box in which the image must be shown; 0 if unknown. class RichText::Icon < RichText attribute :document, TD::Types::Document attribute :width, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/rich_text/reference.rb b/lib/tdlib/types/rich_text/reference.rb index 5ba53e0c..3ff75c3b 100644 --- a/lib/tdlib/types/rich_text/reference.rb +++ b/lib/tdlib/types/rich_text/reference.rb @@ -1,5 +1,5 @@ module TD::Types - # A reference to a richTexts object on the same web page. + # A reference to a richTexts object on the same page. # # @attr text [TD::Types::RichText] The text. # @attr anchor_name [TD::Types::String] The name of a {TD::Types::RichText::Anchor} object, which is the first diff --git a/lib/tdlib/types/rtmp_url.rb b/lib/tdlib/types/rtmp_url.rb new file mode 100644 index 00000000..ed6604ac --- /dev/null +++ b/lib/tdlib/types/rtmp_url.rb @@ -0,0 +1,10 @@ +module TD::Types + # Represents an RTMP URL. + # + # @attr url [TD::Types::String] The URL. + # @attr stream_key [TD::Types::String] Stream key. + class RtmpUrl < Base + attribute :url, TD::Types::String + attribute :stream_key, TD::Types::String + end +end diff --git a/lib/tdlib/types/saved_credentials.rb b/lib/tdlib/types/saved_credentials.rb index 3037d351..27ee6d61 100644 --- a/lib/tdlib/types/saved_credentials.rb +++ b/lib/tdlib/types/saved_credentials.rb @@ -1,5 +1,5 @@ module TD::Types - # Contains information about saved card credentials. + # Contains information about saved payment credentials. # # @attr id [TD::Types::String] Unique identifier of the saved credentials. # @attr title [TD::Types::String] Title of the saved credentials. diff --git a/lib/tdlib/types/saved_messages_tag.rb b/lib/tdlib/types/saved_messages_tag.rb new file mode 100644 index 00000000..cf64c582 --- /dev/null +++ b/lib/tdlib/types/saved_messages_tag.rb @@ -0,0 +1,13 @@ +module TD::Types + # Represents a tag used in Saved Messages or a Saved Messages topic. + # + # @attr tag [TD::Types::ReactionType] The tag. + # @attr label [TD::Types::String] Label of the tag; 0-12 characters. + # Always empty if the tag is returned for a Saved Messages topic. + # @attr count [Integer] Number of times the tag was used; may be 0 if the tag has non-empty label. + class SavedMessagesTag < Base + attribute :tag, TD::Types::ReactionType + attribute :label, TD::Types::String + attribute :count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/saved_messages_tags.rb b/lib/tdlib/types/saved_messages_tags.rb new file mode 100644 index 00000000..07841fb6 --- /dev/null +++ b/lib/tdlib/types/saved_messages_tags.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of tags used in Saved Messages. + # + # @attr tags [Array] List of tags. + class SavedMessagesTags < Base + attribute :tags, TD::Types::Array.of(TD::Types::SavedMessagesTag) + end +end diff --git a/lib/tdlib/types/saved_messages_topic.rb b/lib/tdlib/types/saved_messages_topic.rb new file mode 100644 index 00000000..e4de089d --- /dev/null +++ b/lib/tdlib/types/saved_messages_topic.rb @@ -0,0 +1,19 @@ +module TD::Types + # Contains information about a Saved Messages topic. + # + # @attr id [Integer] Unique topic identifier. + # @attr type [TD::Types::SavedMessagesTopicType] Type of the topic. + # @attr is_pinned [Boolean] True, if the topic is pinned. + # @attr order [Integer] A parameter used to determine order of the topic in the topic list. + # Topics must be sorted by the order in descending order. + # @attr last_message [TD::Types::Message, nil] Last message in the topic; may be null if none or unknown. + # @attr draft_message [TD::Types::DraftMessage, nil] A draft of a message in the topic; may be null if none. + class SavedMessagesTopic < Base + attribute :id, TD::Types::Coercible::Integer + attribute :type, TD::Types::SavedMessagesTopicType + attribute :is_pinned, TD::Types::Bool + attribute :order, TD::Types::Coercible::Integer + attribute :last_message, TD::Types::Message.optional.default(nil) + attribute :draft_message, TD::Types::DraftMessage.optional.default(nil) + end +end diff --git a/lib/tdlib/types/saved_messages_topic_type.rb b/lib/tdlib/types/saved_messages_topic_type.rb new file mode 100644 index 00000000..05c33508 --- /dev/null +++ b/lib/tdlib/types/saved_messages_topic_type.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes type of Saved Messages topic. + class SavedMessagesTopicType < Base + %w[ + my_notes + author_hidden + saved_from_chat + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/saved_messages_topic_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/saved_messages_topic_type/author_hidden.rb b/lib/tdlib/types/saved_messages_topic_type/author_hidden.rb new file mode 100644 index 00000000..81ad8e70 --- /dev/null +++ b/lib/tdlib/types/saved_messages_topic_type/author_hidden.rb @@ -0,0 +1,5 @@ +module TD::Types + # Topic containing messages forwarded from a user with hidden privacy. + class SavedMessagesTopicType::AuthorHidden < SavedMessagesTopicType + end +end diff --git a/lib/tdlib/types/saved_messages_topic_type/my_notes.rb b/lib/tdlib/types/saved_messages_topic_type/my_notes.rb new file mode 100644 index 00000000..f7abc83e --- /dev/null +++ b/lib/tdlib/types/saved_messages_topic_type/my_notes.rb @@ -0,0 +1,5 @@ +module TD::Types + # Topic containing messages sent by the current user of forwarded from an unknown chat. + class SavedMessagesTopicType::MyNotes < SavedMessagesTopicType + end +end diff --git a/lib/tdlib/types/saved_messages_topic_type/saved_from_chat.rb b/lib/tdlib/types/saved_messages_topic_type/saved_from_chat.rb new file mode 100644 index 00000000..363beff9 --- /dev/null +++ b/lib/tdlib/types/saved_messages_topic_type/saved_from_chat.rb @@ -0,0 +1,8 @@ +module TD::Types + # Topic containing messages forwarded from a specific chat. + # + # @attr chat_id [Integer] Identifier of the chat. + class SavedMessagesTopicType::SavedFromChat < SavedMessagesTopicType + attribute :chat_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/scope_autosave_settings.rb b/lib/tdlib/types/scope_autosave_settings.rb new file mode 100644 index 00000000..ac8742a1 --- /dev/null +++ b/lib/tdlib/types/scope_autosave_settings.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains autosave settings for an autosave settings scope. + # + # @attr autosave_photos [Boolean] True, if photo autosave is enabled. + # @attr autosave_videos [Boolean] True, if video autosave is enabled. + # @attr max_video_file_size [Integer] The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB. + class ScopeAutosaveSettings < Base + attribute :autosave_photos, TD::Types::Bool + attribute :autosave_videos, TD::Types::Bool + attribute :max_video_file_size, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/scope_notification_settings.rb b/lib/tdlib/types/scope_notification_settings.rb index afd3a6dd..18f75008 100644 --- a/lib/tdlib/types/scope_notification_settings.rb +++ b/lib/tdlib/types/scope_notification_settings.rb @@ -2,17 +2,26 @@ module TD::Types # Contains information about notification settings for several chats. # # @attr mute_for [Integer] Time left before notifications will be unmuted, in seconds. - # @attr sound [TD::Types::String] The name of an audio file to be used for notification sounds; only applies to iOS - # applications. - # @attr show_preview [Boolean] True, if message content should be displayed in notifications. + # @attr sound_id [Integer] Identifier of the notification sound to be played; 0 if sound is disabled. + # @attr show_preview [Boolean] True, if message content must be displayed in notifications. + # @attr use_default_mute_stories [Boolean] If true, story notifications are received only for the first 5 chats from + # {TD::Types::TopChatCategory::Users} regardless of the value of mute_stories. + # @attr mute_stories [Boolean] True, if story notifications are disabled. + # @attr story_sound_id [Integer] Identifier of the notification sound to be played for stories; 0 if sound is + # disabled. + # @attr show_story_sender [Boolean] True, if the sender of stories must be displayed in notifications. # @attr disable_pinned_message_notifications [Boolean] True, if notifications for incoming pinned messages will be # created as for an ordinary unread message. # @attr disable_mention_notifications [Boolean] True, if notifications for messages with mentions will be created as # for an ordinary unread message. class ScopeNotificationSettings < Base attribute :mute_for, TD::Types::Coercible::Integer - attribute :sound, TD::Types::String + attribute :sound_id, TD::Types::Coercible::Integer attribute :show_preview, TD::Types::Bool + attribute :use_default_mute_stories, TD::Types::Bool + attribute :mute_stories, TD::Types::Bool + attribute :story_sound_id, TD::Types::Coercible::Integer + attribute :show_story_sender, TD::Types::Bool attribute :disable_pinned_message_notifications, TD::Types::Bool attribute :disable_mention_notifications, TD::Types::Bool end diff --git a/lib/tdlib/types/search_messages_filter.rb b/lib/tdlib/types/search_messages_filter.rb index 0b57e803..aaaeaad9 100644 --- a/lib/tdlib/types/search_messages_filter.rb +++ b/lib/tdlib/types/search_messages_filter.rb @@ -12,12 +12,11 @@ class SearchMessagesFilter < Base photo_and_video url chat_photo - call - missed_call video_note voice_and_video_note mention unread_mention + unread_reaction failed_to_send pinned ].each do |type| diff --git a/lib/tdlib/types/search_messages_filter/call.rb b/lib/tdlib/types/search_messages_filter/call.rb deleted file mode 100644 index ab5d8596..00000000 --- a/lib/tdlib/types/search_messages_filter/call.rb +++ /dev/null @@ -1,5 +0,0 @@ -module TD::Types - # Returns only call messages. - class SearchMessagesFilter::Call < SearchMessagesFilter - end -end diff --git a/lib/tdlib/types/search_messages_filter/missed_call.rb b/lib/tdlib/types/search_messages_filter/missed_call.rb deleted file mode 100644 index 772b669e..00000000 --- a/lib/tdlib/types/search_messages_filter/missed_call.rb +++ /dev/null @@ -1,5 +0,0 @@ -module TD::Types - # Returns only incoming call messages with missed/declined discard reasons. - class SearchMessagesFilter::MissedCall < SearchMessagesFilter - end -end diff --git a/lib/tdlib/types/search_messages_filter/unread_reaction.rb b/lib/tdlib/types/search_messages_filter/unread_reaction.rb new file mode 100644 index 00000000..4dc7ea4a --- /dev/null +++ b/lib/tdlib/types/search_messages_filter/unread_reaction.rb @@ -0,0 +1,7 @@ +module TD::Types + # Returns only messages with unread reactions for the current user. + # When using this filter the results can't be additionally filtered by a query, a message thread or by the sending + # user. + class SearchMessagesFilter::UnreadReaction < SearchMessagesFilter + end +end diff --git a/lib/tdlib/types/secret_chat.rb b/lib/tdlib/types/secret_chat.rb index 6db11956..6030e470 100644 --- a/lib/tdlib/types/secret_chat.rb +++ b/lib/tdlib/types/secret_chat.rb @@ -4,7 +4,7 @@ module TD::Types # @attr id [Integer] Secret chat identifier. # @attr user_id [Integer] Identifier of the chat partner. # @attr state [TD::Types::SecretChatState] State of the secret chat. - # @attr is_outbound [Boolean] True, if the chat was created by the current user; otherwise false. + # @attr is_outbound [Boolean] True, if the chat was created by the current user; false otherwise. # @attr key_hash [String] Hash of the currently used key for comparison with the hash of the chat partner's key. # This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of # one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. @@ -12,8 +12,9 @@ module TD::Types # Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 # 2-digit hex numbers. # @attr layer [Integer] Secret chat layer; determines features supported by the chat partner's application. - # Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are - # supported if the layer >= 101. + # Nested text entities and underline and strikethrough entities are supported if the layer >= 101, files bigger + # than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= + # 144. class SecretChat < Base attribute :id, TD::Types::Coercible::Integer attribute :user_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/sent_web_app_message.rb b/lib/tdlib/types/sent_web_app_message.rb new file mode 100644 index 00000000..bc56a36a --- /dev/null +++ b/lib/tdlib/types/sent_web_app_message.rb @@ -0,0 +1,8 @@ +module TD::Types + # Information about the message sent by answerWebAppQuery. + # + # @attr inline_message_id [TD::Types::String] Identifier of the sent inline message, if known. + class SentWebAppMessage < Base + attribute :inline_message_id, TD::Types::String + end +end diff --git a/lib/tdlib/types/session.rb b/lib/tdlib/types/session.rb index 40037349..4c1a6b3a 100644 --- a/lib/tdlib/types/session.rb +++ b/lib/tdlib/types/session.rb @@ -1,10 +1,16 @@ module TD::Types # Contains information about one session in a Telegram application used by the current user. - # Sessions should be shown to the user in the returned order. + # Sessions must be shown to the user in the returned order. # # @attr id [Integer] Session identifier. # @attr is_current [Boolean] True, if this session is the current session. - # @attr is_password_pending [Boolean] True, if a password is needed to complete authorization of the session. + # @attr is_password_pending [Boolean] True, if a 2-step verification password is needed to complete authorization of + # the session. + # @attr is_unconfirmed [Boolean] True, if the session wasn't confirmed from another session. + # @attr can_accept_secret_chats [Boolean] True, if incoming secret chats can be accepted by the session. + # @attr can_accept_calls [Boolean] True, if incoming calls can be accepted by the session. + # @attr type [TD::Types::SessionType] Session type based on the system and application version, which can be used to + # display a corresponding icon. # @attr api_id [Integer] Telegram API identifier, as provided by the application. # @attr application_name [TD::Types::String] Name of the application, as provided by the application. # @attr application_version [TD::Types::String] The version of the application, as provided by the application. @@ -18,14 +24,17 @@ module TD::Types # on, as provided by the application. # @attr log_in_date [Integer] Point in time (Unix timestamp) when the user has logged in. # @attr last_active_date [Integer] Point in time (Unix timestamp) when the session was last used. - # @attr ip [TD::Types::String] IP address from which the session was created, in human-readable format. - # @attr country [TD::Types::String] A two-letter country code for the country from which the session was created, + # @attr ip_address [TD::Types::String] IP address from which the session was created, in human-readable format. + # @attr location [TD::Types::String] A human-readable description of the location from which the session was created, # based on the IP address. - # @attr region [TD::Types::String] Region code from which the session was created, based on the IP address. class Session < Base attribute :id, TD::Types::Coercible::Integer attribute :is_current, TD::Types::Bool attribute :is_password_pending, TD::Types::Bool + attribute :is_unconfirmed, TD::Types::Bool + attribute :can_accept_secret_chats, TD::Types::Bool + attribute :can_accept_calls, TD::Types::Bool + attribute :type, TD::Types::SessionType attribute :api_id, TD::Types::Coercible::Integer attribute :application_name, TD::Types::String attribute :application_version, TD::Types::String @@ -35,8 +44,7 @@ class Session < Base attribute :system_version, TD::Types::String attribute :log_in_date, TD::Types::Coercible::Integer attribute :last_active_date, TD::Types::Coercible::Integer - attribute :ip, TD::Types::String - attribute :country, TD::Types::String - attribute :region, TD::Types::String + attribute :ip_address, TD::Types::String + attribute :location, TD::Types::String end end diff --git a/lib/tdlib/types/session_type.rb b/lib/tdlib/types/session_type.rb new file mode 100644 index 00000000..c593be92 --- /dev/null +++ b/lib/tdlib/types/session_type.rb @@ -0,0 +1,26 @@ +module TD::Types + # Represents the type of session. + class SessionType < Base + %w[ + android + apple + brave + chrome + edge + firefox + ipad + iphone + linux + mac + opera + safari + ubuntu + unknown + vivaldi + windows + xbox + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/session_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/session_type/android.rb b/lib/tdlib/types/session_type/android.rb new file mode 100644 index 00000000..e820b9fc --- /dev/null +++ b/lib/tdlib/types/session_type/android.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on an Android device. + class SessionType::Android < SessionType + end +end diff --git a/lib/tdlib/types/session_type/apple.rb b/lib/tdlib/types/session_type/apple.rb new file mode 100644 index 00000000..e6696521 --- /dev/null +++ b/lib/tdlib/types/session_type/apple.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on a generic Apple device. + class SessionType::Apple < SessionType + end +end diff --git a/lib/tdlib/types/session_type/brave.rb b/lib/tdlib/types/session_type/brave.rb new file mode 100644 index 00000000..51bdef4b --- /dev/null +++ b/lib/tdlib/types/session_type/brave.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on the Brave browser. + class SessionType::Brave < SessionType + end +end diff --git a/lib/tdlib/types/session_type/chrome.rb b/lib/tdlib/types/session_type/chrome.rb new file mode 100644 index 00000000..a7fafe0f --- /dev/null +++ b/lib/tdlib/types/session_type/chrome.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on the Chrome browser. + class SessionType::Chrome < SessionType + end +end diff --git a/lib/tdlib/types/session_type/edge.rb b/lib/tdlib/types/session_type/edge.rb new file mode 100644 index 00000000..50856a89 --- /dev/null +++ b/lib/tdlib/types/session_type/edge.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on the Edge browser. + class SessionType::Edge < SessionType + end +end diff --git a/lib/tdlib/types/session_type/firefox.rb b/lib/tdlib/types/session_type/firefox.rb new file mode 100644 index 00000000..080a6e49 --- /dev/null +++ b/lib/tdlib/types/session_type/firefox.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on the Firefox browser. + class SessionType::Firefox < SessionType + end +end diff --git a/lib/tdlib/types/session_type/ipad.rb b/lib/tdlib/types/session_type/ipad.rb new file mode 100644 index 00000000..b2c8b52a --- /dev/null +++ b/lib/tdlib/types/session_type/ipad.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on an iPad device. + class SessionType::Ipad < SessionType + end +end diff --git a/lib/tdlib/types/session_type/iphone.rb b/lib/tdlib/types/session_type/iphone.rb new file mode 100644 index 00000000..3303e68d --- /dev/null +++ b/lib/tdlib/types/session_type/iphone.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on an iPhone device. + class SessionType::Iphone < SessionType + end +end diff --git a/lib/tdlib/types/session_type/linux.rb b/lib/tdlib/types/session_type/linux.rb new file mode 100644 index 00000000..565f9dca --- /dev/null +++ b/lib/tdlib/types/session_type/linux.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on a Linux device. + class SessionType::Linux < SessionType + end +end diff --git a/lib/tdlib/types/session_type/mac.rb b/lib/tdlib/types/session_type/mac.rb new file mode 100644 index 00000000..a33ad46e --- /dev/null +++ b/lib/tdlib/types/session_type/mac.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on a Mac device. + class SessionType::Mac < SessionType + end +end diff --git a/lib/tdlib/types/session_type/opera.rb b/lib/tdlib/types/session_type/opera.rb new file mode 100644 index 00000000..3e4808b2 --- /dev/null +++ b/lib/tdlib/types/session_type/opera.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on the Opera browser. + class SessionType::Opera < SessionType + end +end diff --git a/lib/tdlib/types/session_type/safari.rb b/lib/tdlib/types/session_type/safari.rb new file mode 100644 index 00000000..419a2e52 --- /dev/null +++ b/lib/tdlib/types/session_type/safari.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on the Safari browser. + class SessionType::Safari < SessionType + end +end diff --git a/lib/tdlib/types/session_type/ubuntu.rb b/lib/tdlib/types/session_type/ubuntu.rb new file mode 100644 index 00000000..07473f9d --- /dev/null +++ b/lib/tdlib/types/session_type/ubuntu.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on an Ubuntu device. + class SessionType::Ubuntu < SessionType + end +end diff --git a/lib/tdlib/types/session_type/unknown.rb b/lib/tdlib/types/session_type/unknown.rb new file mode 100644 index 00000000..3332ce5a --- /dev/null +++ b/lib/tdlib/types/session_type/unknown.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on an unknown type of device. + class SessionType::Unknown < SessionType + end +end diff --git a/lib/tdlib/types/session_type/vivaldi.rb b/lib/tdlib/types/session_type/vivaldi.rb new file mode 100644 index 00000000..5609f0a8 --- /dev/null +++ b/lib/tdlib/types/session_type/vivaldi.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on the Vivaldi browser. + class SessionType::Vivaldi < SessionType + end +end diff --git a/lib/tdlib/types/session_type/windows.rb b/lib/tdlib/types/session_type/windows.rb new file mode 100644 index 00000000..a0873190 --- /dev/null +++ b/lib/tdlib/types/session_type/windows.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on a Windows device. + class SessionType::Windows < SessionType + end +end diff --git a/lib/tdlib/types/session_type/xbox.rb b/lib/tdlib/types/session_type/xbox.rb new file mode 100644 index 00000000..0fec1ca4 --- /dev/null +++ b/lib/tdlib/types/session_type/xbox.rb @@ -0,0 +1,5 @@ +module TD::Types + # The session is running on an Xbox console. + class SessionType::Xbox < SessionType + end +end diff --git a/lib/tdlib/types/sessions.rb b/lib/tdlib/types/sessions.rb index ce6bc907..7bc1e38b 100644 --- a/lib/tdlib/types/sessions.rb +++ b/lib/tdlib/types/sessions.rb @@ -2,7 +2,10 @@ module TD::Types # Contains a list of sessions. # # @attr sessions [Array] List of sessions. + # @attr inactive_session_ttl_days [Integer] Number of days of inactivity before sessions will automatically be + # terminated; 1-366 days. class Sessions < Base attribute :sessions, TD::Types::Array.of(TD::Types::Session) + attribute :inactive_session_ttl_days, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/shared_chat.rb b/lib/tdlib/types/shared_chat.rb new file mode 100644 index 00000000..315df0d7 --- /dev/null +++ b/lib/tdlib/types/shared_chat.rb @@ -0,0 +1,14 @@ +module TD::Types + # Contains information about a chat shared with a bot. + # + # @attr chat_id [Integer] Chat identifier. + # @attr title [TD::Types::String] Title of the chat; for bots only. + # @attr username [TD::Types::String] Username of the chat; for bots only. + # @attr photo [TD::Types::Photo, nil] Photo of the chat; for bots only; may be null. + class SharedChat < Base + attribute :chat_id, TD::Types::Coercible::Integer + attribute :title, TD::Types::String + attribute :username, TD::Types::String + attribute :photo, TD::Types::Photo.optional.default(nil) + end +end diff --git a/lib/tdlib/types/shared_user.rb b/lib/tdlib/types/shared_user.rb new file mode 100644 index 00000000..cdbc2497 --- /dev/null +++ b/lib/tdlib/types/shared_user.rb @@ -0,0 +1,16 @@ +module TD::Types + # Contains information about a user shared with a bot. + # + # @attr user_id [Integer] User identifier. + # @attr first_name [TD::Types::String] First name of the user; for bots only. + # @attr last_name [TD::Types::String] Last name of the user; for bots only. + # @attr username [TD::Types::String] Username of the user; for bots only. + # @attr photo [TD::Types::Photo, nil] Profile photo of the user; for bots only; may be null. + class SharedUser < Base + attribute :user_id, TD::Types::Coercible::Integer + attribute :first_name, TD::Types::String + attribute :last_name, TD::Types::String + attribute :username, TD::Types::String + attribute :photo, TD::Types::Photo.optional.default(nil) + end +end diff --git a/lib/tdlib/types/speech_recognition_result.rb b/lib/tdlib/types/speech_recognition_result.rb new file mode 100644 index 00000000..9b8b8632 --- /dev/null +++ b/lib/tdlib/types/speech_recognition_result.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes result of speech recognition in a voice note. + class SpeechRecognitionResult < Base + %w[ + pending + text + error + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/speech_recognition_result/#{type}" + end + end +end diff --git a/lib/tdlib/types/speech_recognition_result/error.rb b/lib/tdlib/types/speech_recognition_result/error.rb new file mode 100644 index 00000000..1c24476b --- /dev/null +++ b/lib/tdlib/types/speech_recognition_result/error.rb @@ -0,0 +1,9 @@ +module TD::Types + # The speech recognition failed. + # + # @attr error [TD::Types::Error] Recognition error. + # An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized. + class SpeechRecognitionResult::Error < SpeechRecognitionResult + attribute :error, TD::Types::Error + end +end diff --git a/lib/tdlib/types/speech_recognition_result/pending.rb b/lib/tdlib/types/speech_recognition_result/pending.rb new file mode 100644 index 00000000..38cff4b2 --- /dev/null +++ b/lib/tdlib/types/speech_recognition_result/pending.rb @@ -0,0 +1,8 @@ +module TD::Types + # The speech recognition is ongoing. + # + # @attr partial_text [TD::Types::String] Partially recognized text. + class SpeechRecognitionResult::Pending < SpeechRecognitionResult + attribute :partial_text, TD::Types::String + end +end diff --git a/lib/tdlib/types/speech_recognition_result/text.rb b/lib/tdlib/types/speech_recognition_result/text.rb new file mode 100644 index 00000000..7058e1bb --- /dev/null +++ b/lib/tdlib/types/speech_recognition_result/text.rb @@ -0,0 +1,8 @@ +module TD::Types + # The speech recognition successfully finished. + # + # @attr text [TD::Types::String] Recognized text. + class SpeechRecognitionResult::Text < SpeechRecognitionResult + attribute :text, TD::Types::String + end +end diff --git a/lib/tdlib/types/sponsored_message.rb b/lib/tdlib/types/sponsored_message.rb new file mode 100644 index 00000000..e26d63e0 --- /dev/null +++ b/lib/tdlib/types/sponsored_message.rb @@ -0,0 +1,31 @@ +module TD::Types + # Describes a sponsored message. + # + # @attr message_id [Integer] Message identifier; unique for the chat to which the sponsored message belongs among + # both ordinary and sponsored messages. + # @attr is_recommended [Boolean] True, if the message needs to be labeled as "recommended" instead of "sponsored". + # @attr can_be_reported [Boolean] True, if the message can be reported to Telegram moderators through + # reportChatSponsoredMessage. + # @attr content [TD::Types::MessageContent] Content of the message. + # Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. + # @attr sponsor [TD::Types::MessageSponsor] Information about the sponsor of the message. + # @attr title [TD::Types::String] Title of the sponsored message. + # @attr button_text [TD::Types::String] Text for the message action button. + # @attr accent_color_id [Integer] Identifier of the accent color for title, button text and message background. + # @attr background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the message background; 0 if + # none. + # @attr additional_info [TD::Types::String] If non-empty, additional information about the sponsored message to be + # shown along with the message. + class SponsoredMessage < Base + attribute :message_id, TD::Types::Coercible::Integer + attribute :is_recommended, TD::Types::Bool + attribute :can_be_reported, TD::Types::Bool + attribute :content, TD::Types::MessageContent + attribute :sponsor, TD::Types::MessageSponsor + attribute :title, TD::Types::String + attribute :button_text, TD::Types::String + attribute :accent_color_id, TD::Types::Coercible::Integer + attribute :background_custom_emoji_id, TD::Types::Coercible::Integer + attribute :additional_info, TD::Types::String + end +end diff --git a/lib/tdlib/types/sponsored_messages.rb b/lib/tdlib/types/sponsored_messages.rb new file mode 100644 index 00000000..080ba674 --- /dev/null +++ b/lib/tdlib/types/sponsored_messages.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains a list of sponsored messages. + # + # @attr messages [Array] List of sponsored messages. + # @attr messages_between [Integer] The minimum number of messages between shown sponsored messages, or 0 if only one + # sponsored message must be shown after all ordinary messages. + class SponsoredMessages < Base + attribute :messages, TD::Types::Array.of(TD::Types::SponsoredMessage) + attribute :messages_between, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/star_payment_option.rb b/lib/tdlib/types/star_payment_option.rb new file mode 100644 index 00000000..1f89934a --- /dev/null +++ b/lib/tdlib/types/star_payment_option.rb @@ -0,0 +1,18 @@ +module TD::Types + # Describes an option for buying Telegram Stars. + # Use telegramPaymentPurposeStars for out-of-store payments. + # + # @attr currency [TD::Types::String] ISO 4217 currency code for the payment. + # @attr amount [Integer] The amount to pay, in the smallest units of the currency. + # @attr star_count [Integer] Number of Telegram Stars that will be purchased. + # @attr store_product_id [TD::Types::String, nil] Identifier of the store product associated with the option; may be + # empty if none. + # @attr is_additional [Boolean] True, if the option must be shown only in the full list of payment options. + class StarPaymentOption < Base + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :star_count, TD::Types::Coercible::Integer + attribute :store_product_id, TD::Types::String.optional.default(nil) + attribute :is_additional, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/star_payment_options.rb b/lib/tdlib/types/star_payment_options.rb new file mode 100644 index 00000000..f58ddfe6 --- /dev/null +++ b/lib/tdlib/types/star_payment_options.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of options for buying Telegram Stars. + # + # @attr options [Array] The list of options. + class StarPaymentOptions < Base + attribute :options, TD::Types::Array.of(TD::Types::StarPaymentOption) + end +end diff --git a/lib/tdlib/types/star_revenue_statistics.rb b/lib/tdlib/types/star_revenue_statistics.rb new file mode 100644 index 00000000..ea4ef53d --- /dev/null +++ b/lib/tdlib/types/star_revenue_statistics.rb @@ -0,0 +1,12 @@ +module TD::Types + # A detailed statistics about Telegram Stars earned by a bot or a chat. + # + # @attr revenue_by_day_graph [TD::Types::StatisticalGraph] A graph containing amount of revenue in a given day. + # @attr status [TD::Types::StarRevenueStatus] Telegram Star revenue status. + # @attr usd_rate [Float] Current conversion rate of a Telegram Star to USD. + class StarRevenueStatistics < Base + attribute :revenue_by_day_graph, TD::Types::StatisticalGraph + attribute :status, TD::Types::StarRevenueStatus + attribute :usd_rate, TD::Types::Coercible::Float + end +end diff --git a/lib/tdlib/types/star_revenue_status.rb b/lib/tdlib/types/star_revenue_status.rb new file mode 100644 index 00000000..2f49b091 --- /dev/null +++ b/lib/tdlib/types/star_revenue_status.rb @@ -0,0 +1,17 @@ +module TD::Types + # Contains information about Telegram Stars earned by a bot or a chat. + # + # @attr total_count [Integer] Total number of Telegram Stars earned. + # @attr current_count [Integer] The number of Telegram Stars that aren't withdrawn yet. + # @attr available_count [Integer] The number of Telegram Stars that are available for withdrawal. + # @attr withdrawal_enabled [Boolean] True, if Telegram Stars can be withdrawn now or later. + # @attr next_withdrawal_in [Integer] Time left before the next withdrawal can be started, in seconds; 0 if withdrawal + # can be started now. + class StarRevenueStatus < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :current_count, TD::Types::Coercible::Integer + attribute :available_count, TD::Types::Coercible::Integer + attribute :withdrawal_enabled, TD::Types::Bool + attribute :next_withdrawal_in, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/star_subscription.rb b/lib/tdlib/types/star_subscription.rb new file mode 100644 index 00000000..b03065e7 --- /dev/null +++ b/lib/tdlib/types/star_subscription.rb @@ -0,0 +1,25 @@ +module TD::Types + # Contains information about subscription to a channel chat paid in Telegram Stars. + # + # @attr id [TD::Types::String] Unique identifier of the subscription. + # @attr chat_id [Integer] Identifier of the channel chat that is subscribed. + # @attr expiration_date [Integer] Point in time (Unix timestamp) when the subscription will expire or expired. + # @attr can_reuse [Boolean] True, if the subscription is active and the user can use the method reuseStarSubscription + # to join the subscribed chat again. + # @attr is_canceled [Boolean] True, if the subscription was canceled. + # @attr is_expiring [Boolean] True, if the subscription expires soon and there are no enough Telegram Stars on the + # user's balance to extend it. + # @attr invite_link [TD::Types::String, nil] The invite link that can be used to renew the subscription if it has + # been expired; may be empty, if the link isn't available anymore. + # @attr pricing [TD::Types::StarSubscriptionPricing] The subscription plan. + class StarSubscription < Base + attribute :id, TD::Types::String + attribute :chat_id, TD::Types::Coercible::Integer + attribute :expiration_date, TD::Types::Coercible::Integer + attribute :can_reuse, TD::Types::Bool + attribute :is_canceled, TD::Types::Bool + attribute :is_expiring, TD::Types::Bool + attribute :invite_link, TD::Types::String.optional.default(nil) + attribute :pricing, TD::Types::StarSubscriptionPricing + end +end diff --git a/lib/tdlib/types/star_subscription_pricing.rb b/lib/tdlib/types/star_subscription_pricing.rb new file mode 100644 index 00000000..7c5ec294 --- /dev/null +++ b/lib/tdlib/types/star_subscription_pricing.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes subscription plan paid in Telegram Stars. + # + # @attr period [Integer] The number of seconds between consecutive Telegram Star debiting. + # @attr star_count [Integer] The amount of Telegram Stars that must be paid for each period. + class StarSubscriptionPricing < Base + attribute :period, TD::Types::Coercible::Integer + attribute :star_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/star_subscriptions.rb b/lib/tdlib/types/star_subscriptions.rb new file mode 100644 index 00000000..733d47a8 --- /dev/null +++ b/lib/tdlib/types/star_subscriptions.rb @@ -0,0 +1,16 @@ +module TD::Types + # Represents a list of Telegram Star subscriptions. + # + # @attr star_count [Integer] The amount of owned Telegram Stars. + # @attr subscriptions [Array] List of subbscriptions for Telegram Stars. + # @attr required_star_count [Integer] The number of Telegram Stars required to buy to extend subscriptions expiring + # soon. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. + class StarSubscriptions < Base + attribute :star_count, TD::Types::Coercible::Integer + attribute :subscriptions, TD::Types::Array.of(TD::Types::StarSubscription) + attribute :required_star_count, TD::Types::Coercible::Integer + attribute :next_offset, TD::Types::String + end +end diff --git a/lib/tdlib/types/star_transaction.rb b/lib/tdlib/types/star_transaction.rb new file mode 100644 index 00000000..be8fbb75 --- /dev/null +++ b/lib/tdlib/types/star_transaction.rb @@ -0,0 +1,17 @@ +module TD::Types + # Represents a transaction changing the amount of owned Telegram Stars. + # + # @attr id [TD::Types::String] Unique identifier of the transaction. + # @attr star_count [Integer] The amount of added owned Telegram Stars; negative for outgoing transactions. + # @attr is_refund [Boolean] True, if the transaction is a refund of a previous transaction. + # @attr date [Integer] Point in time (Unix timestamp) when the transaction was completed. + # @attr partner [TD::Types::StarTransactionPartner] Source of the incoming transaction, or its recipient for outgoing + # transactions. + class StarTransaction < Base + attribute :id, TD::Types::String + attribute :star_count, TD::Types::Coercible::Integer + attribute :is_refund, TD::Types::Bool + attribute :date, TD::Types::Coercible::Integer + attribute :partner, TD::Types::StarTransactionPartner + end +end diff --git a/lib/tdlib/types/star_transaction_direction.rb b/lib/tdlib/types/star_transaction_direction.rb new file mode 100644 index 00000000..e67bee35 --- /dev/null +++ b/lib/tdlib/types/star_transaction_direction.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes direction of a transaction with Telegram Stars. + class StarTransactionDirection < Base + %w[ + incoming + outgoing + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/star_transaction_direction/#{type}" + end + end +end diff --git a/lib/tdlib/types/star_transaction_direction/incoming.rb b/lib/tdlib/types/star_transaction_direction/incoming.rb new file mode 100644 index 00000000..8dd2c27e --- /dev/null +++ b/lib/tdlib/types/star_transaction_direction/incoming.rb @@ -0,0 +1,5 @@ +module TD::Types + # The transaction is incoming and increases the number of owned Telegram Stars. + class StarTransactionDirection::Incoming < StarTransactionDirection + end +end diff --git a/lib/tdlib/types/star_transaction_direction/outgoing.rb b/lib/tdlib/types/star_transaction_direction/outgoing.rb new file mode 100644 index 00000000..72bfec79 --- /dev/null +++ b/lib/tdlib/types/star_transaction_direction/outgoing.rb @@ -0,0 +1,5 @@ +module TD::Types + # The transaction is outgoing and decreases the number of owned Telegram Stars. + class StarTransactionDirection::Outgoing < StarTransactionDirection + end +end diff --git a/lib/tdlib/types/star_transaction_partner.rb b/lib/tdlib/types/star_transaction_partner.rb new file mode 100644 index 00000000..4ae4f536 --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner.rb @@ -0,0 +1,19 @@ +module TD::Types + # Describes source or recipient of a transaction with Telegram Stars. + class StarTransactionPartner < Base + %w[ + telegram + app_store + google_play + fragment + telegram_ads + bot + business + channel + user + unsupported + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/star_transaction_partner/#{type}" + end + end +end diff --git a/lib/tdlib/types/star_transaction_partner/app_store.rb b/lib/tdlib/types/star_transaction_partner/app_store.rb new file mode 100644 index 00000000..26e53596 --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/app_store.rb @@ -0,0 +1,5 @@ +module TD::Types + # The transaction is a transaction with App Store. + class StarTransactionPartner::AppStore < StarTransactionPartner + end +end diff --git a/lib/tdlib/types/star_transaction_partner/bot.rb b/lib/tdlib/types/star_transaction_partner/bot.rb new file mode 100644 index 00000000..348fa179 --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/bot.rb @@ -0,0 +1,10 @@ +module TD::Types + # The transaction is a transaction with a bot. + # + # @attr user_id [Integer] Identifier of the bot. + # @attr purpose [TD::Types::BotTransactionPurpose] Purpose of the transaction. + class StarTransactionPartner::Bot < StarTransactionPartner + attribute :user_id, TD::Types::Coercible::Integer + attribute :purpose, TD::Types::BotTransactionPurpose + end +end diff --git a/lib/tdlib/types/star_transaction_partner/business.rb b/lib/tdlib/types/star_transaction_partner/business.rb new file mode 100644 index 00000000..adfc7a6a --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/business.rb @@ -0,0 +1,10 @@ +module TD::Types + # The transaction is a transaction with a business account. + # + # @attr user_id [Integer] Identifier of the business account user. + # @attr media [Array] The bought media if the trancastion wasn't refunded. + class StarTransactionPartner::Business < StarTransactionPartner + attribute :user_id, TD::Types::Coercible::Integer + attribute :media, TD::Types::Array.of(TD::Types::PaidMedia) + end +end diff --git a/lib/tdlib/types/star_transaction_partner/channel.rb b/lib/tdlib/types/star_transaction_partner/channel.rb new file mode 100644 index 00000000..de1ed2ed --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/channel.rb @@ -0,0 +1,10 @@ +module TD::Types + # The transaction is a transaction with a channel chat. + # + # @attr chat_id [Integer] Identifier of the chat. + # @attr purpose [TD::Types::ChannelTransactionPurpose] Purpose of the transaction. + class StarTransactionPartner::Channel < StarTransactionPartner + attribute :chat_id, TD::Types::Coercible::Integer + attribute :purpose, TD::Types::ChannelTransactionPurpose + end +end diff --git a/lib/tdlib/types/star_transaction_partner/fragment.rb b/lib/tdlib/types/star_transaction_partner/fragment.rb new file mode 100644 index 00000000..3a871539 --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/fragment.rb @@ -0,0 +1,9 @@ +module TD::Types + # The transaction is a transaction with Fragment. + # + # @attr withdrawal_state [TD::Types::RevenueWithdrawalState, nil] State of the withdrawal; may be null for refunds + # from Fragment. + class StarTransactionPartner::Fragment < StarTransactionPartner + attribute :withdrawal_state, TD::Types::RevenueWithdrawalState.optional.default(nil) + end +end diff --git a/lib/tdlib/types/star_transaction_partner/google_play.rb b/lib/tdlib/types/star_transaction_partner/google_play.rb new file mode 100644 index 00000000..0134b074 --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/google_play.rb @@ -0,0 +1,5 @@ +module TD::Types + # The transaction is a transaction with Google Play. + class StarTransactionPartner::GooglePlay < StarTransactionPartner + end +end diff --git a/lib/tdlib/types/star_transaction_partner/telegram.rb b/lib/tdlib/types/star_transaction_partner/telegram.rb new file mode 100644 index 00000000..208dff3d --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/telegram.rb @@ -0,0 +1,5 @@ +module TD::Types + # The transaction is a transaction with Telegram through a bot. + class StarTransactionPartner::Telegram < StarTransactionPartner + end +end diff --git a/lib/tdlib/types/star_transaction_partner/telegram_ads.rb b/lib/tdlib/types/star_transaction_partner/telegram_ads.rb new file mode 100644 index 00000000..f23dc1e1 --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/telegram_ads.rb @@ -0,0 +1,5 @@ +module TD::Types + # The transaction is a transaction with Telegram Ad platform. + class StarTransactionPartner::TelegramAds < StarTransactionPartner + end +end diff --git a/lib/tdlib/types/star_transaction_partner/unsupported.rb b/lib/tdlib/types/star_transaction_partner/unsupported.rb new file mode 100644 index 00000000..3f745768 --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/unsupported.rb @@ -0,0 +1,5 @@ +module TD::Types + # The transaction is a transaction with unknown partner. + class StarTransactionPartner::Unsupported < StarTransactionPartner + end +end diff --git a/lib/tdlib/types/star_transaction_partner/user.rb b/lib/tdlib/types/star_transaction_partner/user.rb new file mode 100644 index 00000000..beee38e9 --- /dev/null +++ b/lib/tdlib/types/star_transaction_partner/user.rb @@ -0,0 +1,11 @@ +module TD::Types + # The transaction is a gift of Telegram Stars from another user. + # + # @attr user_id [Integer] Identifier of the user; 0 if the gift was anonymous. + # @attr sticker [TD::Types::Sticker, nil] A sticker to be shown in the transaction information; may be null if + # unknown. + class StarTransactionPartner::User < StarTransactionPartner + attribute :user_id, TD::Types::Coercible::Integer + attribute :sticker, TD::Types::Sticker.optional.default(nil) + end +end diff --git a/lib/tdlib/types/star_transactions.rb b/lib/tdlib/types/star_transactions.rb new file mode 100644 index 00000000..d3bfdf45 --- /dev/null +++ b/lib/tdlib/types/star_transactions.rb @@ -0,0 +1,13 @@ +module TD::Types + # Represents a list of Telegram Star transactions. + # + # @attr star_count [Integer] The amount of owned Telegram Stars. + # @attr transactions [Array] List of transactions with Telegram Stars. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. + class StarTransactions < Base + attribute :star_count, TD::Types::Coercible::Integer + attribute :transactions, TD::Types::Array.of(TD::Types::StarTransaction) + attribute :next_offset, TD::Types::String + end +end diff --git a/lib/tdlib/types/sticker.rb b/lib/tdlib/types/sticker.rb index 52a48f35..ec4bf158 100644 --- a/lib/tdlib/types/sticker.rb +++ b/lib/tdlib/types/sticker.rb @@ -1,26 +1,26 @@ module TD::Types # Describes a sticker. # - # @attr set_id [Integer] The identifier of the sticker set to which the sticker belongs; 0 if none. + # @attr id [Integer] Unique sticker identifier within the set; 0 if none. + # @attr set_id [Integer] Identifier of the sticker set to which the sticker belongs; 0 if none. # @attr width [Integer] Sticker width; as defined by the sender. # @attr height [Integer] Sticker height; as defined by the sender. # @attr emoji [TD::Types::String] Emoji corresponding to the sticker. - # @attr is_animated [Boolean] True, if the sticker is an animated sticker in TGS format. - # @attr is_mask [Boolean] True, if the sticker is a mask. - # @attr mask_position [TD::Types::MaskPosition, nil] Position where the mask should be placed; may be null. + # @attr format [TD::Types::StickerFormat] Sticker format. + # @attr full_type [TD::Types::StickerFullType] Sticker's full type. # @attr outline [Array, nil] Sticker's outline represented as a list of closed vector # paths; may be empty. # The coordinate system origin is in the upper-left corner. # @attr thumbnail [TD::Types::Thumbnail, nil] Sticker thumbnail in WEBP or JPEG format; may be null. # @attr sticker [TD::Types::File] File containing the sticker. class Sticker < Base + attribute :id, TD::Types::Coercible::Integer attribute :set_id, TD::Types::Coercible::Integer attribute :width, TD::Types::Coercible::Integer attribute :height, TD::Types::Coercible::Integer attribute :emoji, TD::Types::String - attribute :is_animated, TD::Types::Bool - attribute :is_mask, TD::Types::Bool - attribute :mask_position, TD::Types::MaskPosition.optional.default(nil) + attribute :format, TD::Types::StickerFormat + attribute :full_type, TD::Types::StickerFullType attribute :outline, TD::Types::Array.of(TD::Types::ClosedVectorPath).optional.default(nil) attribute :thumbnail, TD::Types::Thumbnail.optional.default(nil) attribute :sticker, TD::Types::File diff --git a/lib/tdlib/types/sticker_format.rb b/lib/tdlib/types/sticker_format.rb new file mode 100644 index 00000000..564e71f6 --- /dev/null +++ b/lib/tdlib/types/sticker_format.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes format of a sticker. + class StickerFormat < Base + %w[ + webp + tgs + webm + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/sticker_format/#{type}" + end + end +end diff --git a/lib/tdlib/types/sticker_format/tgs.rb b/lib/tdlib/types/sticker_format/tgs.rb new file mode 100644 index 00000000..1f291fb9 --- /dev/null +++ b/lib/tdlib/types/sticker_format/tgs.rb @@ -0,0 +1,5 @@ +module TD::Types + # The sticker is an animation in TGS format. + class StickerFormat::Tgs < StickerFormat + end +end diff --git a/lib/tdlib/types/sticker_format/webm.rb b/lib/tdlib/types/sticker_format/webm.rb new file mode 100644 index 00000000..b81b27db --- /dev/null +++ b/lib/tdlib/types/sticker_format/webm.rb @@ -0,0 +1,5 @@ +module TD::Types + # The sticker is a video in WEBM format. + class StickerFormat::Webm < StickerFormat + end +end diff --git a/lib/tdlib/types/sticker_format/webp.rb b/lib/tdlib/types/sticker_format/webp.rb new file mode 100644 index 00000000..1c38d21b --- /dev/null +++ b/lib/tdlib/types/sticker_format/webp.rb @@ -0,0 +1,5 @@ +module TD::Types + # The sticker is an image in WEBP format. + class StickerFormat::Webp < StickerFormat + end +end diff --git a/lib/tdlib/types/sticker_full_type.rb b/lib/tdlib/types/sticker_full_type.rb new file mode 100644 index 00000000..8d6de1a4 --- /dev/null +++ b/lib/tdlib/types/sticker_full_type.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains full information about sticker type. + class StickerFullType < Base + %w[ + regular + mask + custom_emoji + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/sticker_full_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/sticker_full_type/custom_emoji.rb b/lib/tdlib/types/sticker_full_type/custom_emoji.rb new file mode 100644 index 00000000..c89b5cba --- /dev/null +++ b/lib/tdlib/types/sticker_full_type/custom_emoji.rb @@ -0,0 +1,12 @@ +module TD::Types + # The sticker is a custom emoji to be used inside message text and caption. + # Currently, only Telegram Premium users can use custom emoji. + # + # @attr custom_emoji_id [Integer] Identifier of the custom emoji. + # @attr needs_repainting [Boolean] True, if the sticker must be repainted to a text color in messages, the color of + # the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places. + class StickerFullType::CustomEmoji < StickerFullType + attribute :custom_emoji_id, TD::Types::Coercible::Integer + attribute :needs_repainting, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/sticker_full_type/mask.rb b/lib/tdlib/types/sticker_full_type/mask.rb new file mode 100644 index 00000000..695fe531 --- /dev/null +++ b/lib/tdlib/types/sticker_full_type/mask.rb @@ -0,0 +1,8 @@ +module TD::Types + # The sticker is a mask in WEBP format to be placed on photos or videos. + # + # @attr mask_position [TD::Types::MaskPosition, nil] Position where the mask is placed; may be null. + class StickerFullType::Mask < StickerFullType + attribute :mask_position, TD::Types::MaskPosition.optional.default(nil) + end +end diff --git a/lib/tdlib/types/sticker_full_type/regular.rb b/lib/tdlib/types/sticker_full_type/regular.rb new file mode 100644 index 00000000..fb7405b9 --- /dev/null +++ b/lib/tdlib/types/sticker_full_type/regular.rb @@ -0,0 +1,9 @@ +module TD::Types + # The sticker is a regular sticker. + # + # @attr premium_animation [TD::Types::File, nil] Premium animation of the sticker; may be null. + # If present, only Telegram Premium users can use the sticker. + class StickerFullType::Regular < StickerFullType + attribute :premium_animation, TD::Types::File.optional.default(nil) + end +end diff --git a/lib/tdlib/types/sticker_set.rb b/lib/tdlib/types/sticker_set.rb index 6d8c2c07..acfee01a 100644 --- a/lib/tdlib/types/sticker_set.rb +++ b/lib/tdlib/types/sticker_set.rb @@ -4,21 +4,25 @@ module TD::Types # @attr id [Integer] Identifier of the sticker set. # @attr title [TD::Types::String] Title of the sticker set. # @attr name [TD::Types::String] Name of the sticker set. - # @attr thumbnail [TD::Types::Thumbnail, nil] Sticker set thumbnail in WEBP or TGS format with width and height 100; - # may be null. + # @attr thumbnail [TD::Types::Thumbnail, nil] Sticker set thumbnail in WEBP, TGS, or WEBM format with width and + # height 100; may be null. # The file can be downloaded only before the thumbnail is changed. # @attr thumbnail_outline [Array, nil] Sticker set thumbnail's outline represented as a # list of closed vector paths; may be empty. # The coordinate system origin is in the upper-left corner. + # @attr is_owned [Boolean] True, if the sticker set is owned by the current user. # @attr is_installed [Boolean] True, if the sticker set has been installed by the current user. # @attr is_archived [Boolean] True, if the sticker set has been archived. # A sticker set can't be installed and archived simultaneously. # @attr is_official [Boolean] True, if the sticker set is official. - # @attr is_animated [Boolean] True, is the stickers in the set are animated. - # @attr is_masks [Boolean] True, if the stickers in the set are masks. + # @attr sticker_type [TD::Types::StickerType] Type of the stickers in the set. + # @attr needs_repainting [Boolean] True, if stickers in the sticker set are custom emoji that must be repainted; for + # custom emoji sticker sets only. + # @attr is_allowed_as_chat_emoji_status [Boolean] True, if stickers in the sticker set are custom emoji that can be + # used as chat emoji status; for custom emoji sticker sets only. # @attr is_viewed [Boolean] True for already viewed trending sticker sets. # @attr stickers [Array] List of stickers in this set. - # @attr emojis [Array] A list of emoji corresponding to the stickers in the same order. + # @attr emojis [Array] A list of emojis corresponding to the stickers in the same order. # The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the # corresponding Sticker object. class StickerSet < Base @@ -27,11 +31,13 @@ class StickerSet < Base attribute :name, TD::Types::String attribute :thumbnail, TD::Types::Thumbnail.optional.default(nil) attribute :thumbnail_outline, TD::Types::Array.of(TD::Types::ClosedVectorPath).optional.default(nil) + attribute :is_owned, TD::Types::Bool attribute :is_installed, TD::Types::Bool attribute :is_archived, TD::Types::Bool attribute :is_official, TD::Types::Bool - attribute :is_animated, TD::Types::Bool - attribute :is_masks, TD::Types::Bool + attribute :sticker_type, TD::Types::StickerType + attribute :needs_repainting, TD::Types::Bool + attribute :is_allowed_as_chat_emoji_status, TD::Types::Bool attribute :is_viewed, TD::Types::Bool attribute :stickers, TD::Types::Array.of(TD::Types::Sticker) attribute :emojis, TD::Types::Array.of(TD::Types::Emojis) diff --git a/lib/tdlib/types/sticker_set_info.rb b/lib/tdlib/types/sticker_set_info.rb index 33c4415e..95044f86 100644 --- a/lib/tdlib/types/sticker_set_info.rb +++ b/lib/tdlib/types/sticker_set_info.rb @@ -4,33 +4,39 @@ module TD::Types # @attr id [Integer] Identifier of the sticker set. # @attr title [TD::Types::String] Title of the sticker set. # @attr name [TD::Types::String] Name of the sticker set. - # @attr thumbnail [TD::Types::Thumbnail, nil] Sticker set thumbnail in WEBP or TGS format with width and height 100; - # may be null. + # @attr thumbnail [TD::Types::Thumbnail, nil] Sticker set thumbnail in WEBP, TGS, or WEBM format with width and + # height 100; may be null. + # The file can be downloaded only before the thumbnail is changed. # @attr thumbnail_outline [Array, nil] Sticker set thumbnail's outline represented as a # list of closed vector paths; may be empty. # The coordinate system origin is in the upper-left corner. + # @attr is_owned [Boolean] True, if the sticker set is owned by the current user. # @attr is_installed [Boolean] True, if the sticker set has been installed by the current user. # @attr is_archived [Boolean] True, if the sticker set has been archived. # A sticker set can't be installed and archived simultaneously. # @attr is_official [Boolean] True, if the sticker set is official. - # @attr is_animated [Boolean] True, is the stickers in the set are animated. - # @attr is_masks [Boolean] True, if the stickers in the set are masks. + # @attr sticker_type [TD::Types::StickerType] Type of the stickers in the set. + # @attr needs_repainting [Boolean] True, if stickers in the sticker set are custom emoji that must be repainted; for + # custom emoji sticker sets only. + # @attr is_allowed_as_chat_emoji_status [Boolean] True, if stickers in the sticker set are custom emoji that can be + # used as chat emoji status; for custom emoji sticker sets only. # @attr is_viewed [Boolean] True for already viewed trending sticker sets. # @attr size [Integer] Total number of stickers in the set. - # @attr covers [Array] Contains up to the first 5 stickers from the set, depending on the - # context. - # If the application needs more stickers the full set should be requested. + # @attr covers [Array] Up to the first 5 stickers from the set, depending on the context. + # If the application needs more stickers the full sticker set needs to be requested. class StickerSetInfo < Base attribute :id, TD::Types::Coercible::Integer attribute :title, TD::Types::String attribute :name, TD::Types::String attribute :thumbnail, TD::Types::Thumbnail.optional.default(nil) attribute :thumbnail_outline, TD::Types::Array.of(TD::Types::ClosedVectorPath).optional.default(nil) + attribute :is_owned, TD::Types::Bool attribute :is_installed, TD::Types::Bool attribute :is_archived, TD::Types::Bool attribute :is_official, TD::Types::Bool - attribute :is_animated, TD::Types::Bool - attribute :is_masks, TD::Types::Bool + attribute :sticker_type, TD::Types::StickerType + attribute :needs_repainting, TD::Types::Bool + attribute :is_allowed_as_chat_emoji_status, TD::Types::Bool attribute :is_viewed, TD::Types::Bool attribute :size, TD::Types::Coercible::Integer attribute :covers, TD::Types::Array.of(TD::Types::Sticker) diff --git a/lib/tdlib/types/sticker_type.rb b/lib/tdlib/types/sticker_type.rb new file mode 100644 index 00000000..50e1181f --- /dev/null +++ b/lib/tdlib/types/sticker_type.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes type of sticker. + class StickerType < Base + %w[ + regular + mask + custom_emoji + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/sticker_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/sticker_type/custom_emoji.rb b/lib/tdlib/types/sticker_type/custom_emoji.rb new file mode 100644 index 00000000..787b5f25 --- /dev/null +++ b/lib/tdlib/types/sticker_type/custom_emoji.rb @@ -0,0 +1,5 @@ +module TD::Types + # The sticker is a custom emoji to be used inside message text and caption. + class StickerType::CustomEmoji < StickerType + end +end diff --git a/lib/tdlib/types/sticker_type/mask.rb b/lib/tdlib/types/sticker_type/mask.rb new file mode 100644 index 00000000..5b079b95 --- /dev/null +++ b/lib/tdlib/types/sticker_type/mask.rb @@ -0,0 +1,5 @@ +module TD::Types + # The sticker is a mask in WEBP format to be placed on photos or videos. + class StickerType::Mask < StickerType + end +end diff --git a/lib/tdlib/types/sticker_type/regular.rb b/lib/tdlib/types/sticker_type/regular.rb new file mode 100644 index 00000000..66aad979 --- /dev/null +++ b/lib/tdlib/types/sticker_type/regular.rb @@ -0,0 +1,5 @@ +module TD::Types + # The sticker is a regular sticker. + class StickerType::Regular < StickerType + end +end diff --git a/lib/tdlib/types/storage_statistics.rb b/lib/tdlib/types/storage_statistics.rb index c7d9a0f5..21c62595 100644 --- a/lib/tdlib/types/storage_statistics.rb +++ b/lib/tdlib/types/storage_statistics.rb @@ -1,7 +1,7 @@ module TD::Types # Contains the exact storage usage statistics split by chats and file type. # - # @attr size [Integer] Total size of files. + # @attr size [Integer] Total size of files, in bytes. # @attr count [Integer] Total number of files. # @attr by_chat [Array] Statistics split by chats. class StorageStatistics < Base diff --git a/lib/tdlib/types/storage_statistics_by_chat.rb b/lib/tdlib/types/storage_statistics_by_chat.rb index 59316056..0223fa3e 100644 --- a/lib/tdlib/types/storage_statistics_by_chat.rb +++ b/lib/tdlib/types/storage_statistics_by_chat.rb @@ -2,7 +2,7 @@ module TD::Types # Contains the storage usage statistics for a specific chat. # # @attr chat_id [Integer] Chat identifier; 0 if none. - # @attr size [Integer] Total size of the files in the chat. + # @attr size [Integer] Total size of the files in the chat, in bytes. # @attr count [Integer] Total number of files in the chat. # @attr by_file_type [Array] Statistics split by file types. class StorageStatisticsByChat < Base diff --git a/lib/tdlib/types/storage_statistics_by_file_type.rb b/lib/tdlib/types/storage_statistics_by_file_type.rb index 9a0fd805..c80d37ee 100644 --- a/lib/tdlib/types/storage_statistics_by_file_type.rb +++ b/lib/tdlib/types/storage_statistics_by_file_type.rb @@ -2,7 +2,7 @@ module TD::Types # Contains the storage usage statistics for a specific file type. # # @attr file_type [TD::Types::FileType] File type. - # @attr size [Integer] Total size of the files. + # @attr size [Integer] Total size of the files, in bytes. # @attr count [Integer] Total number of files. class StorageStatisticsByFileType < Base attribute :file_type, TD::Types::FileType diff --git a/lib/tdlib/types/storage_statistics_fast.rb b/lib/tdlib/types/storage_statistics_fast.rb index 11d3dbb7..ff2eb42d 100644 --- a/lib/tdlib/types/storage_statistics_fast.rb +++ b/lib/tdlib/types/storage_statistics_fast.rb @@ -1,7 +1,7 @@ module TD::Types # Contains approximate storage usage statistics, excluding files of unknown file type. # - # @attr files_size [Integer] Approximate total size of files. + # @attr files_size [Integer] Approximate total size of files, in bytes. # @attr file_count [Integer] Approximate number of files. # @attr database_size [Integer] Size of the database. # @attr language_pack_database_size [Integer] Size of the language pack database. diff --git a/lib/tdlib/types/store_payment_purpose.rb b/lib/tdlib/types/store_payment_purpose.rb new file mode 100644 index 00000000..131cd393 --- /dev/null +++ b/lib/tdlib/types/store_payment_purpose.rb @@ -0,0 +1,15 @@ +module TD::Types + # Describes a purpose of an in-store payment. + class StorePaymentPurpose < Base + %w[ + premium_subscription + gifted_premium + premium_gift_codes + premium_giveaway + stars + gifted_stars + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/store_payment_purpose/#{type}" + end + end +end diff --git a/lib/tdlib/types/store_payment_purpose/gifted_premium.rb b/lib/tdlib/types/store_payment_purpose/gifted_premium.rb new file mode 100644 index 00000000..ae9e6613 --- /dev/null +++ b/lib/tdlib/types/store_payment_purpose/gifted_premium.rb @@ -0,0 +1,12 @@ +module TD::Types + # The user gifting Telegram Premium to another user. + # + # @attr user_id [Integer] Identifier of the user to which Telegram Premium is gifted. + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + class StorePaymentPurpose::GiftedPremium < StorePaymentPurpose + attribute :user_id, TD::Types::Coercible::Integer + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/store_payment_purpose/gifted_stars.rb b/lib/tdlib/types/store_payment_purpose/gifted_stars.rb new file mode 100644 index 00000000..5dbe0e21 --- /dev/null +++ b/lib/tdlib/types/store_payment_purpose/gifted_stars.rb @@ -0,0 +1,14 @@ +module TD::Types + # The user buying Telegram Stars for other users. + # + # @attr user_id [Integer] Identifier of the user to which Telegram Stars are gifted. + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + # @attr star_count [Integer] Number of bought Telegram Stars. + class StorePaymentPurpose::GiftedStars < StorePaymentPurpose + attribute :user_id, TD::Types::Coercible::Integer + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :star_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/store_payment_purpose/premium_gift_codes.rb b/lib/tdlib/types/store_payment_purpose/premium_gift_codes.rb new file mode 100644 index 00000000..2e406760 --- /dev/null +++ b/lib/tdlib/types/store_payment_purpose/premium_gift_codes.rb @@ -0,0 +1,15 @@ +module TD::Types + # The user creating Telegram Premium gift codes for other users. + # + # @attr boosted_chat_id [Integer] Identifier of the supergroup or channel chat, which will be automatically boosted + # by the users for duration of the Premium subscription and which is administered by the user; 0 if none. + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + # @attr user_ids [Array] Identifiers of the users which can activate the gift codes. + class StorePaymentPurpose::PremiumGiftCodes < StorePaymentPurpose + attribute :boosted_chat_id, TD::Types::Coercible::Integer + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/store_payment_purpose/premium_giveaway.rb b/lib/tdlib/types/store_payment_purpose/premium_giveaway.rb new file mode 100644 index 00000000..a784db7f --- /dev/null +++ b/lib/tdlib/types/store_payment_purpose/premium_giveaway.rb @@ -0,0 +1,12 @@ +module TD::Types + # The user creating a Telegram Premium giveaway. + # + # @attr parameters [TD::Types::PremiumGiveawayParameters] Giveaway parameters. + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + class StorePaymentPurpose::PremiumGiveaway < StorePaymentPurpose + attribute :parameters, TD::Types::PremiumGiveawayParameters + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/store_payment_purpose/premium_subscription.rb b/lib/tdlib/types/store_payment_purpose/premium_subscription.rb new file mode 100644 index 00000000..81ef942a --- /dev/null +++ b/lib/tdlib/types/store_payment_purpose/premium_subscription.rb @@ -0,0 +1,11 @@ +module TD::Types + # The user subscribing to Telegram Premium. + # + # @attr is_restore [Boolean] Pass true if this is a restore of a Telegram Premium purchase; only for App Store. + # @attr is_upgrade [Boolean] Pass true if this is an upgrade from a monthly subscription to early subscription; only + # for App Store. + class StorePaymentPurpose::PremiumSubscription < StorePaymentPurpose + attribute :is_restore, TD::Types::Bool + attribute :is_upgrade, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/store_payment_purpose/stars.rb b/lib/tdlib/types/store_payment_purpose/stars.rb new file mode 100644 index 00000000..79c633b1 --- /dev/null +++ b/lib/tdlib/types/store_payment_purpose/stars.rb @@ -0,0 +1,12 @@ +module TD::Types + # The user buying Telegram Stars. + # + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + # @attr star_count [Integer] Number of bought Telegram Stars. + class StorePaymentPurpose::Stars < StorePaymentPurpose + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :star_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/stories.rb b/lib/tdlib/types/stories.rb new file mode 100644 index 00000000..145f5aaa --- /dev/null +++ b/lib/tdlib/types/stories.rb @@ -0,0 +1,13 @@ +module TD::Types + # Represents a list of stories. + # + # @attr total_count [Integer] Approximate total number of stories found. + # @attr stories [Array] The list of stories. + # @attr pinned_story_ids [Array] Identifiers of the pinned stories; returned only in + # getChatPostedToChatPageStories with from_story_id == 0. + class Stories < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :stories, TD::Types::Array.of(TD::Types::Story) + attribute :pinned_story_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/story.rb b/lib/tdlib/types/story.rb new file mode 100644 index 00000000..9a8716f4 --- /dev/null +++ b/lib/tdlib/types/story.rb @@ -0,0 +1,62 @@ +module TD::Types + # Represents a story. + # + # @attr id [Integer] Unique story identifier among stories of the given sender. + # @attr sender_chat_id [Integer] Identifier of the chat that posted the story. + # @attr sender_id [TD::Types::MessageSender, nil] Identifier of the sender of the story; may be null if the story is + # posted on behalf of the sender_chat_id. + # @attr date [Integer] Point in time (Unix timestamp) when the story was published. + # @attr is_being_sent [Boolean] True, if the story is being sent by the current user. + # @attr is_being_edited [Boolean] True, if the story is being edited by the current user. + # @attr is_edited [Boolean] True, if the story was edited. + # @attr is_posted_to_chat_page [Boolean] True, if the story is saved in the sender's profile and will be available + # there after expiration. + # @attr is_visible_only_for_self [Boolean] True, if the story is visible only for the current user. + # @attr can_be_deleted [Boolean] True, if the story can be deleted. + # @attr can_be_edited [Boolean] True, if the story can be edited. + # @attr can_be_forwarded [Boolean] True, if the story can be forwarded as a message. + # Otherwise, screenshots and saving of the story content must be also forbidden. + # @attr can_be_replied [Boolean] True, if the story can be replied in the chat with the story sender. + # @attr can_toggle_is_posted_to_chat_page [Boolean] True, if the story's is_posted_to_chat_page value can be changed. + # @attr can_get_statistics [Boolean] True, if the story statistics are available through getStoryStatistics. + # @attr can_get_interactions [Boolean] True, if interactions with the story can be received through + # getStoryInteractions. + # @attr has_expired_viewers [Boolean] True, if users viewed the story can't be received, because the story has + # expired more than getOption("story_viewers_expiration_delay") seconds ago. + # @attr repost_info [TD::Types::StoryRepostInfo, nil] Information about the original story; may be null if the story + # wasn't reposted. + # @attr interaction_info [TD::Types::StoryInteractionInfo, nil] Information about interactions with the story; may be + # null if the story isn't owned or there were no interactions. + # @attr chosen_reaction_type [TD::Types::ReactionType, nil] Type of the chosen reaction; may be null if none. + # @attr privacy_settings [TD::Types::StoryPrivacySettings] Privacy rules affecting story visibility; may be + # approximate for non-owned stories. + # @attr content [TD::Types::StoryContent] Content of the story. + # @attr areas [Array] Clickable areas to be shown on the story content. + # @attr caption [TD::Types::FormattedText] Caption of the story. + class Story < Base + attribute :id, TD::Types::Coercible::Integer + attribute :sender_chat_id, TD::Types::Coercible::Integer + attribute :sender_id, TD::Types::MessageSender.optional.default(nil) + attribute :date, TD::Types::Coercible::Integer + attribute :is_being_sent, TD::Types::Bool + attribute :is_being_edited, TD::Types::Bool + attribute :is_edited, TD::Types::Bool + attribute :is_posted_to_chat_page, TD::Types::Bool + attribute :is_visible_only_for_self, TD::Types::Bool + attribute :can_be_deleted, TD::Types::Bool + attribute :can_be_edited, TD::Types::Bool + attribute :can_be_forwarded, TD::Types::Bool + attribute :can_be_replied, TD::Types::Bool + attribute :can_toggle_is_posted_to_chat_page, TD::Types::Bool + attribute :can_get_statistics, TD::Types::Bool + attribute :can_get_interactions, TD::Types::Bool + attribute :has_expired_viewers, TD::Types::Bool + attribute :repost_info, TD::Types::StoryRepostInfo.optional.default(nil) + attribute :interaction_info, TD::Types::StoryInteractionInfo.optional.default(nil) + attribute :chosen_reaction_type, TD::Types::ReactionType.optional.default(nil) + attribute :privacy_settings, TD::Types::StoryPrivacySettings + attribute :content, TD::Types::StoryContent + attribute :areas, TD::Types::Array.of(TD::Types::StoryArea) + attribute :caption, TD::Types::FormattedText + end +end diff --git a/lib/tdlib/types/story_area.rb b/lib/tdlib/types/story_area.rb new file mode 100644 index 00000000..da71ab68 --- /dev/null +++ b/lib/tdlib/types/story_area.rb @@ -0,0 +1,10 @@ +module TD::Types + # Describes a clickable rectangle area on a story media. + # + # @attr position [TD::Types::StoryAreaPosition] Position of the area. + # @attr type [TD::Types::StoryAreaType] Type of the area. + class StoryArea < Base + attribute :position, TD::Types::StoryAreaPosition + attribute :type, TD::Types::StoryAreaType + end +end diff --git a/lib/tdlib/types/story_area_position.rb b/lib/tdlib/types/story_area_position.rb new file mode 100644 index 00000000..2c40b6d2 --- /dev/null +++ b/lib/tdlib/types/story_area_position.rb @@ -0,0 +1,19 @@ +module TD::Types + # Describes position of a clickable rectangle area on a story media. + # + # @attr x_percentage [Float] The abscissa of the rectangle's center, as a percentage of the media width. + # @attr y_percentage [Float] The ordinate of the rectangle's center, as a percentage of the media height. + # @attr width_percentage [Float] The width of the rectangle, as a percentage of the media width. + # @attr height_percentage [Float] The height of the rectangle, as a percentage of the media height. + # @attr rotation_angle [Float] Clockwise rotation angle of the rectangle, in degrees; 0-360. + # @attr corner_radius_percentage [Float] The radius of the rectangle corner rounding, as a percentage of the media + # width. + class StoryAreaPosition < Base + attribute :x_percentage, TD::Types::Coercible::Float + attribute :y_percentage, TD::Types::Coercible::Float + attribute :width_percentage, TD::Types::Coercible::Float + attribute :height_percentage, TD::Types::Coercible::Float + attribute :rotation_angle, TD::Types::Coercible::Float + attribute :corner_radius_percentage, TD::Types::Coercible::Float + end +end diff --git a/lib/tdlib/types/story_area_type.rb b/lib/tdlib/types/story_area_type.rb new file mode 100644 index 00000000..fbe6be51 --- /dev/null +++ b/lib/tdlib/types/story_area_type.rb @@ -0,0 +1,15 @@ +module TD::Types + # Describes type of clickable area on a story media. + class StoryAreaType < Base + %w[ + location + venue + suggested_reaction + message + link + weather + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/story_area_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/story_area_type/link.rb b/lib/tdlib/types/story_area_type/link.rb new file mode 100644 index 00000000..967369dc --- /dev/null +++ b/lib/tdlib/types/story_area_type/link.rb @@ -0,0 +1,8 @@ +module TD::Types + # An area pointing to a HTTP or tg:// link. + # + # @attr url [TD::Types::String] HTTP or tg:// URL to be opened when the area is clicked. + class StoryAreaType::Link < StoryAreaType + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/story_area_type/location.rb b/lib/tdlib/types/story_area_type/location.rb new file mode 100644 index 00000000..558338c9 --- /dev/null +++ b/lib/tdlib/types/story_area_type/location.rb @@ -0,0 +1,10 @@ +module TD::Types + # An area pointing to a location. + # + # @attr location [TD::Types::Location] The location. + # @attr address [TD::Types::LocationAddress, nil] Address of the location; may be null if unknown. + class StoryAreaType::Location < StoryAreaType + attribute :location, TD::Types::Location + attribute :address, TD::Types::LocationAddress.optional.default(nil) + end +end diff --git a/lib/tdlib/types/story_area_type/message.rb b/lib/tdlib/types/story_area_type/message.rb new file mode 100644 index 00000000..018c1a24 --- /dev/null +++ b/lib/tdlib/types/story_area_type/message.rb @@ -0,0 +1,10 @@ +module TD::Types + # An area pointing to a message. + # + # @attr chat_id [Integer] Identifier of the chat with the message. + # @attr message_id [Integer] Identifier of the message. + class StoryAreaType::Message < StoryAreaType + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/story_area_type/suggested_reaction.rb b/lib/tdlib/types/story_area_type/suggested_reaction.rb new file mode 100644 index 00000000..6221d321 --- /dev/null +++ b/lib/tdlib/types/story_area_type/suggested_reaction.rb @@ -0,0 +1,15 @@ +module TD::Types + # An area pointing to a suggested reaction. + # App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked. + # + # @attr reaction_type [TD::Types::ReactionType] Type of the reaction. + # @attr total_count [Integer] Number of times the reaction was added. + # @attr is_dark [Boolean] True, if reaction has a dark background. + # @attr is_flipped [Boolean] True, if reaction corner is flipped. + class StoryAreaType::SuggestedReaction < StoryAreaType + attribute :reaction_type, TD::Types::ReactionType + attribute :total_count, TD::Types::Coercible::Integer + attribute :is_dark, TD::Types::Bool + attribute :is_flipped, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/story_area_type/venue.rb b/lib/tdlib/types/story_area_type/venue.rb new file mode 100644 index 00000000..e18586f3 --- /dev/null +++ b/lib/tdlib/types/story_area_type/venue.rb @@ -0,0 +1,8 @@ +module TD::Types + # An area pointing to a venue. + # + # @attr venue [TD::Types::Venue] Information about the venue. + class StoryAreaType::Venue < StoryAreaType + attribute :venue, TD::Types::Venue + end +end diff --git a/lib/tdlib/types/story_area_type/weather.rb b/lib/tdlib/types/story_area_type/weather.rb new file mode 100644 index 00000000..200c35ae --- /dev/null +++ b/lib/tdlib/types/story_area_type/weather.rb @@ -0,0 +1,12 @@ +module TD::Types + # An area with information about weather. + # + # @attr temperature [Float] Temperature, in degree Celsius. + # @attr emoji [TD::Types::String] Emoji representing the weather. + # @attr background_color [Integer] A color of the area background in the ARGB format. + class StoryAreaType::Weather < StoryAreaType + attribute :temperature, TD::Types::Coercible::Float + attribute :emoji, TD::Types::String + attribute :background_color, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/story_content.rb b/lib/tdlib/types/story_content.rb new file mode 100644 index 00000000..bf9520f3 --- /dev/null +++ b/lib/tdlib/types/story_content.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains the content of a story. + class StoryContent < Base + %w[ + photo + video + unsupported + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/story_content/#{type}" + end + end +end diff --git a/lib/tdlib/types/story_content/photo.rb b/lib/tdlib/types/story_content/photo.rb new file mode 100644 index 00000000..02842cec --- /dev/null +++ b/lib/tdlib/types/story_content/photo.rb @@ -0,0 +1,8 @@ +module TD::Types + # A photo story. + # + # @attr photo [TD::Types::Photo] The photo. + class StoryContent::Photo < StoryContent + attribute :photo, TD::Types::Photo + end +end diff --git a/lib/tdlib/types/story_content/unsupported.rb b/lib/tdlib/types/story_content/unsupported.rb new file mode 100644 index 00000000..c2273dfb --- /dev/null +++ b/lib/tdlib/types/story_content/unsupported.rb @@ -0,0 +1,5 @@ +module TD::Types + # A story content that is not supported in the current TDLib version. + class StoryContent::Unsupported < StoryContent + end +end diff --git a/lib/tdlib/types/story_content/video.rb b/lib/tdlib/types/story_content/video.rb new file mode 100644 index 00000000..00946c37 --- /dev/null +++ b/lib/tdlib/types/story_content/video.rb @@ -0,0 +1,11 @@ +module TD::Types + # A video story. + # + # @attr video [TD::Types::StoryVideo] The video in MPEG4 format. + # @attr alternative_video [TD::Types::StoryVideo, nil] Alternative version of the video in MPEG4 format, encoded by + # x264 codec; may be null. + class StoryContent::Video < StoryContent + attribute :video, TD::Types::StoryVideo + attribute :alternative_video, TD::Types::StoryVideo.optional.default(nil) + end +end diff --git a/lib/tdlib/types/story_full_id.rb b/lib/tdlib/types/story_full_id.rb new file mode 100644 index 00000000..0b244576 --- /dev/null +++ b/lib/tdlib/types/story_full_id.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains identifier of a story along with identifier of its sender. + # + # @attr sender_chat_id [Integer] Identifier of the chat that posted the story. + # @attr story_id [Integer] Unique story identifier among stories of the given sender. + class StoryFullId < Base + attribute :sender_chat_id, TD::Types::Coercible::Integer + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/story_info.rb b/lib/tdlib/types/story_info.rb new file mode 100644 index 00000000..cc9b47c3 --- /dev/null +++ b/lib/tdlib/types/story_info.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains basic information about a story. + # + # @attr story_id [Integer] Unique story identifier among stories of the given sender. + # @attr date [Integer] Point in time (Unix timestamp) when the story was published. + # @attr is_for_close_friends [Boolean] True, if the story is available only to close friends. + class StoryInfo < Base + attribute :story_id, TD::Types::Coercible::Integer + attribute :date, TD::Types::Coercible::Integer + attribute :is_for_close_friends, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/story_interaction.rb b/lib/tdlib/types/story_interaction.rb new file mode 100644 index 00000000..5e8d3397 --- /dev/null +++ b/lib/tdlib/types/story_interaction.rb @@ -0,0 +1,15 @@ +module TD::Types + # Represents interaction with a story. + # + # @attr actor_id [TD::Types::MessageSender] Identifier of the user or chat that made the interaction. + # @attr interaction_date [Integer] Approximate point in time (Unix timestamp) when the interaction happened. + # @attr block_list [TD::Types::BlockList, nil] Block list to which the actor is added; may be null if none or for + # chat stories. + # @attr type [TD::Types::StoryInteractionType] Type of the interaction. + class StoryInteraction < Base + attribute :actor_id, TD::Types::MessageSender + attribute :interaction_date, TD::Types::Coercible::Integer + attribute :block_list, TD::Types::BlockList.optional.default(nil) + attribute :type, TD::Types::StoryInteractionType + end +end diff --git a/lib/tdlib/types/story_interaction_info.rb b/lib/tdlib/types/story_interaction_info.rb new file mode 100644 index 00000000..5ba1d72f --- /dev/null +++ b/lib/tdlib/types/story_interaction_info.rb @@ -0,0 +1,14 @@ +module TD::Types + # Contains information about interactions with a story. + # + # @attr view_count [Integer] Number of times the story was viewed. + # @attr forward_count [Integer] Number of times the story was forwarded; 0 if none or unknown. + # @attr reaction_count [Integer] Number of reactions added to the story; 0 if none or unknown. + # @attr recent_viewer_user_ids [Array] Identifiers of at most 3 recent viewers of the story. + class StoryInteractionInfo < Base + attribute :view_count, TD::Types::Coercible::Integer + attribute :forward_count, TD::Types::Coercible::Integer + attribute :reaction_count, TD::Types::Coercible::Integer + attribute :recent_viewer_user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/story_interaction_type.rb b/lib/tdlib/types/story_interaction_type.rb new file mode 100644 index 00000000..7504c3cc --- /dev/null +++ b/lib/tdlib/types/story_interaction_type.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes type of interaction with a story. + class StoryInteractionType < Base + %w[ + view + forward + repost + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/story_interaction_type/#{type}" + end + end +end diff --git a/lib/tdlib/types/story_interaction_type/forward.rb b/lib/tdlib/types/story_interaction_type/forward.rb new file mode 100644 index 00000000..bd5f425a --- /dev/null +++ b/lib/tdlib/types/story_interaction_type/forward.rb @@ -0,0 +1,8 @@ +module TD::Types + # A forward of the story as a message. + # + # @attr message [TD::Types::Message] The message with story forward. + class StoryInteractionType::Forward < StoryInteractionType + attribute :message, TD::Types::Message + end +end diff --git a/lib/tdlib/types/story_interaction_type/repost.rb b/lib/tdlib/types/story_interaction_type/repost.rb new file mode 100644 index 00000000..a4c231ec --- /dev/null +++ b/lib/tdlib/types/story_interaction_type/repost.rb @@ -0,0 +1,8 @@ +module TD::Types + # A repost of the story as a story. + # + # @attr story [TD::Types::Story] The reposted story. + class StoryInteractionType::Repost < StoryInteractionType + attribute :story, TD::Types::Story + end +end diff --git a/lib/tdlib/types/story_interaction_type/view.rb b/lib/tdlib/types/story_interaction_type/view.rb new file mode 100644 index 00000000..dc597c7a --- /dev/null +++ b/lib/tdlib/types/story_interaction_type/view.rb @@ -0,0 +1,9 @@ +module TD::Types + # A view of the story. + # + # @attr chosen_reaction_type [TD::Types::ReactionType, nil] Type of the reaction that was chosen by the viewer; may + # be null if none. + class StoryInteractionType::View < StoryInteractionType + attribute :chosen_reaction_type, TD::Types::ReactionType.optional.default(nil) + end +end diff --git a/lib/tdlib/types/story_interactions.rb b/lib/tdlib/types/story_interactions.rb new file mode 100644 index 00000000..09469e5b --- /dev/null +++ b/lib/tdlib/types/story_interactions.rb @@ -0,0 +1,18 @@ +module TD::Types + # Represents a list of interactions with a story. + # + # @attr total_count [Integer] Approximate total number of interactions found. + # @attr total_forward_count [Integer] Approximate total number of found forwards and reposts; always 0 for chat + # stories. + # @attr total_reaction_count [Integer] Approximate total number of found reactions; always 0 for chat stories. + # @attr interactions [Array] List of story interactions. + # @attr next_offset [TD::Types::String] The offset for the next request. + # If empty, then there are no more results. + class StoryInteractions < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :total_forward_count, TD::Types::Coercible::Integer + attribute :total_reaction_count, TD::Types::Coercible::Integer + attribute :interactions, TD::Types::Array.of(TD::Types::StoryInteraction) + attribute :next_offset, TD::Types::String + end +end diff --git a/lib/tdlib/types/story_list.rb b/lib/tdlib/types/story_list.rb new file mode 100644 index 00000000..2690ea4a --- /dev/null +++ b/lib/tdlib/types/story_list.rb @@ -0,0 +1,11 @@ +module TD::Types + # Describes a list of stories. + class StoryList < Base + %w[ + main + archive + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/story_list/#{type}" + end + end +end diff --git a/lib/tdlib/types/story_list/archive.rb b/lib/tdlib/types/story_list/archive.rb new file mode 100644 index 00000000..09ea1e50 --- /dev/null +++ b/lib/tdlib/types/story_list/archive.rb @@ -0,0 +1,5 @@ +module TD::Types + # The list of stories, shown in the Arvhive chat list. + class StoryList::Archive < StoryList + end +end diff --git a/lib/tdlib/types/story_list/main.rb b/lib/tdlib/types/story_list/main.rb new file mode 100644 index 00000000..9706cd29 --- /dev/null +++ b/lib/tdlib/types/story_list/main.rb @@ -0,0 +1,5 @@ +module TD::Types + # The list of stories, shown in the main chat list and folder chat lists. + class StoryList::Main < StoryList + end +end diff --git a/lib/tdlib/types/story_origin.rb b/lib/tdlib/types/story_origin.rb new file mode 100644 index 00000000..c99fef5c --- /dev/null +++ b/lib/tdlib/types/story_origin.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains information about the origin of a story that was reposted. + class StoryOrigin < Base + %w[ + public_story + hidden_user + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/story_origin/#{type}" + end + end +end diff --git a/lib/tdlib/types/story_origin/hidden_user.rb b/lib/tdlib/types/story_origin/hidden_user.rb new file mode 100644 index 00000000..c65d3306 --- /dev/null +++ b/lib/tdlib/types/story_origin/hidden_user.rb @@ -0,0 +1,8 @@ +module TD::Types + # The original story was sent by an unknown user. + # + # @attr sender_name [TD::Types::String] Name of the story sender. + class StoryOrigin::HiddenUser < StoryOrigin + attribute :sender_name, TD::Types::String + end +end diff --git a/lib/tdlib/types/story_origin/public_story.rb b/lib/tdlib/types/story_origin/public_story.rb new file mode 100644 index 00000000..d1cdb1f7 --- /dev/null +++ b/lib/tdlib/types/story_origin/public_story.rb @@ -0,0 +1,10 @@ +module TD::Types + # The original story was a public story with known sender. + # + # @attr chat_id [Integer] Identifier of the chat that posted original story. + # @attr story_id [Integer] Story identifier of the original story. + class StoryOrigin::PublicStory < StoryOrigin + attribute :chat_id, TD::Types::Coercible::Integer + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/story_privacy_settings.rb b/lib/tdlib/types/story_privacy_settings.rb new file mode 100644 index 00000000..92e12693 --- /dev/null +++ b/lib/tdlib/types/story_privacy_settings.rb @@ -0,0 +1,13 @@ +module TD::Types + # Describes privacy settings of a story. + class StoryPrivacySettings < Base + %w[ + everyone + contacts + close_friends + selected_users + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/story_privacy_settings/#{type}" + end + end +end diff --git a/lib/tdlib/types/story_privacy_settings/close_friends.rb b/lib/tdlib/types/story_privacy_settings/close_friends.rb new file mode 100644 index 00000000..b2d271c2 --- /dev/null +++ b/lib/tdlib/types/story_privacy_settings/close_friends.rb @@ -0,0 +1,5 @@ +module TD::Types + # The story can be viewed by all close friends. + class StoryPrivacySettings::CloseFriends < StoryPrivacySettings + end +end diff --git a/lib/tdlib/types/story_privacy_settings/contacts.rb b/lib/tdlib/types/story_privacy_settings/contacts.rb new file mode 100644 index 00000000..8ebc4949 --- /dev/null +++ b/lib/tdlib/types/story_privacy_settings/contacts.rb @@ -0,0 +1,9 @@ +module TD::Types + # The story can be viewed by all contacts except chosen users. + # + # @attr except_user_ids [Array, nil] User identifiers of the contacts that can't see the story; always + # unknown and empty for non-owned stories. + class StoryPrivacySettings::Contacts < StoryPrivacySettings + attribute :except_user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer).optional.default(nil) + end +end diff --git a/lib/tdlib/types/story_privacy_settings/everyone.rb b/lib/tdlib/types/story_privacy_settings/everyone.rb new file mode 100644 index 00000000..911e85e1 --- /dev/null +++ b/lib/tdlib/types/story_privacy_settings/everyone.rb @@ -0,0 +1,9 @@ +module TD::Types + # The story can be viewed by everyone. + # + # @attr except_user_ids [Array, nil] Identifiers of the users that can't see the story; always unknown and + # empty for non-owned stories. + class StoryPrivacySettings::Everyone < StoryPrivacySettings + attribute :except_user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer).optional.default(nil) + end +end diff --git a/lib/tdlib/types/story_privacy_settings/selected_users.rb b/lib/tdlib/types/story_privacy_settings/selected_users.rb new file mode 100644 index 00000000..89b12d03 --- /dev/null +++ b/lib/tdlib/types/story_privacy_settings/selected_users.rb @@ -0,0 +1,8 @@ +module TD::Types + # The story can be viewed by certain specified users. + # + # @attr user_ids [Array, nil] Identifiers of the users; always unknown and empty for non-owned stories. + class StoryPrivacySettings::SelectedUsers < StoryPrivacySettings + attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer).optional.default(nil) + end +end diff --git a/lib/tdlib/types/story_repost_info.rb b/lib/tdlib/types/story_repost_info.rb new file mode 100644 index 00000000..62a8bc33 --- /dev/null +++ b/lib/tdlib/types/story_repost_info.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains information about original story that was reposted. + # + # @attr origin [TD::Types::StoryOrigin] Origin of the story that was reposted. + # @attr is_content_modified [Boolean] True, if story content was modified during reposting; otherwise, story wasn't + # modified. + class StoryRepostInfo < Base + attribute :origin, TD::Types::StoryOrigin + attribute :is_content_modified, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/story_statistics.rb b/lib/tdlib/types/story_statistics.rb new file mode 100644 index 00000000..6ba34370 --- /dev/null +++ b/lib/tdlib/types/story_statistics.rb @@ -0,0 +1,10 @@ +module TD::Types + # A detailed statistics about a story. + # + # @attr story_interaction_graph [TD::Types::StatisticalGraph] A graph containing number of story views and shares. + # @attr story_reaction_graph [TD::Types::StatisticalGraph] A graph containing number of story reactions. + class StoryStatistics < Base + attribute :story_interaction_graph, TD::Types::StatisticalGraph + attribute :story_reaction_graph, TD::Types::StatisticalGraph + end +end diff --git a/lib/tdlib/types/story_video.rb b/lib/tdlib/types/story_video.rb new file mode 100644 index 00000000..765141e0 --- /dev/null +++ b/lib/tdlib/types/story_video.rb @@ -0,0 +1,27 @@ +module TD::Types + # Describes a video file sent in a story. + # + # @attr duration [Float] Duration of the video, in seconds. + # @attr width [Integer] Video width. + # @attr height [Integer] Video height. + # @attr has_stickers [Boolean] True, if stickers were added to the video. + # The list of corresponding sticker sets can be received using getAttachedStickerSets. + # @attr is_animation [Boolean] True, if the video has no sound. + # @attr minithumbnail [TD::Types::Minithumbnail, nil] Video minithumbnail; may be null. + # @attr thumbnail [TD::Types::Thumbnail, nil] Video thumbnail in JPEG or MPEG4 format; may be null. + # @attr preload_prefix_size [Integer] Size of file prefix, which is supposed to be preloaded, in bytes. + # @attr cover_frame_timestamp [Float] Timestamp of the frame used as video thumbnail. + # @attr video [TD::Types::File] File containing the video. + class StoryVideo < Base + attribute :duration, TD::Types::Coercible::Float + attribute :width, TD::Types::Coercible::Integer + attribute :height, TD::Types::Coercible::Integer + attribute :has_stickers, TD::Types::Bool + attribute :is_animation, TD::Types::Bool + attribute :minithumbnail, TD::Types::Minithumbnail.optional.default(nil) + attribute :thumbnail, TD::Types::Thumbnail.optional.default(nil) + attribute :preload_prefix_size, TD::Types::Coercible::Integer + attribute :cover_frame_timestamp, TD::Types::Coercible::Float + attribute :video, TD::Types::File + end +end diff --git a/lib/tdlib/types/suggested_action.rb b/lib/tdlib/types/suggested_action.rb index 33de1f3e..da24f5b9 100644 --- a/lib/tdlib/types/suggested_action.rb +++ b/lib/tdlib/types/suggested_action.rb @@ -3,9 +3,18 @@ module TD::Types class SuggestedAction < Base %w[ enable_archive_and_mute_new_chats + check_password check_phone_number - see_ticks_hint + view_checks_hint convert_to_broadcast_group + set_password + upgrade_premium + restore_premium + subscribe_to_annual_premium + gift_premium_for_christmas + set_birthdate + extend_premium + extend_star_subscriptions ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/suggested_action/#{type}" end diff --git a/lib/tdlib/types/suggested_action/check_password.rb b/lib/tdlib/types/suggested_action/check_password.rb new file mode 100644 index 00000000..a89daa2a --- /dev/null +++ b/lib/tdlib/types/suggested_action/check_password.rb @@ -0,0 +1,5 @@ +module TD::Types + # Suggests the user to check whether they still remember their 2-step verification password. + class SuggestedAction::CheckPassword < SuggestedAction + end +end diff --git a/lib/tdlib/types/suggested_action/check_phone_number.rb b/lib/tdlib/types/suggested_action/check_phone_number.rb index 620ff46e..ec8308d3 100644 --- a/lib/tdlib/types/suggested_action/check_phone_number.rb +++ b/lib/tdlib/types/suggested_action/check_phone_number.rb @@ -1,5 +1,6 @@ module TD::Types - # Suggests the user to check authorization phone number and change the phone number if it is inaccessible. + # Suggests the user to check whether authorization phone number is correct and change the phone number if it is + # inaccessible. class SuggestedAction::CheckPhoneNumber < SuggestedAction end end diff --git a/lib/tdlib/types/suggested_action/enable_archive_and_mute_new_chats.rb b/lib/tdlib/types/suggested_action/enable_archive_and_mute_new_chats.rb index 41d4336a..89edf87c 100644 --- a/lib/tdlib/types/suggested_action/enable_archive_and_mute_new_chats.rb +++ b/lib/tdlib/types/suggested_action/enable_archive_and_mute_new_chats.rb @@ -1,5 +1,5 @@ module TD::Types - # Suggests the user to enable "archive_and_mute_new_chats_from_unknown_users" option. + # Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings. class SuggestedAction::EnableArchiveAndMuteNewChats < SuggestedAction end end diff --git a/lib/tdlib/types/suggested_action/extend_premium.rb b/lib/tdlib/types/suggested_action/extend_premium.rb new file mode 100644 index 00000000..62d50347 --- /dev/null +++ b/lib/tdlib/types/suggested_action/extend_premium.rb @@ -0,0 +1,8 @@ +module TD::Types + # Suggests the user to extend their expiring Telegram Premium subscription. + # + # @attr manage_premium_subscription_url [TD::Types::String] A URL for managing Telegram Premium subscription. + class SuggestedAction::ExtendPremium < SuggestedAction + attribute :manage_premium_subscription_url, TD::Types::String + end +end diff --git a/lib/tdlib/types/suggested_action/extend_star_subscriptions.rb b/lib/tdlib/types/suggested_action/extend_star_subscriptions.rb new file mode 100644 index 00000000..fd373c67 --- /dev/null +++ b/lib/tdlib/types/suggested_action/extend_star_subscriptions.rb @@ -0,0 +1,7 @@ +module TD::Types + # Suggests the user to extend their expiring Telegram Star subscriptions. + # Call getStarSubscriptions with only_expiring == true to get the number of expiring subscriptions and the number of + # required to buy Telegram Stars. + class SuggestedAction::ExtendStarSubscriptions < SuggestedAction + end +end diff --git a/lib/tdlib/types/suggested_action/gift_premium_for_christmas.rb b/lib/tdlib/types/suggested_action/gift_premium_for_christmas.rb new file mode 100644 index 00000000..26e51fcc --- /dev/null +++ b/lib/tdlib/types/suggested_action/gift_premium_for_christmas.rb @@ -0,0 +1,5 @@ +module TD::Types + # Suggests the user to gift Telegram Premium to friends for Christmas. + class SuggestedAction::GiftPremiumForChristmas < SuggestedAction + end +end diff --git a/lib/tdlib/types/suggested_action/restore_premium.rb b/lib/tdlib/types/suggested_action/restore_premium.rb new file mode 100644 index 00000000..9f3dab5a --- /dev/null +++ b/lib/tdlib/types/suggested_action/restore_premium.rb @@ -0,0 +1,5 @@ +module TD::Types + # Suggests the user to restore a recently expired Premium subscription. + class SuggestedAction::RestorePremium < SuggestedAction + end +end diff --git a/lib/tdlib/types/suggested_action/see_ticks_hint.rb b/lib/tdlib/types/suggested_action/see_ticks_hint.rb deleted file mode 100644 index 25824021..00000000 --- a/lib/tdlib/types/suggested_action/see_ticks_hint.rb +++ /dev/null @@ -1,5 +0,0 @@ -module TD::Types - # Suggests the user to see a hint about meaning of one and two ticks on sent message. - class SuggestedAction::SeeTicksHint < SuggestedAction - end -end diff --git a/lib/tdlib/types/suggested_action/set_birthdate.rb b/lib/tdlib/types/suggested_action/set_birthdate.rb new file mode 100644 index 00000000..b0a8a3da --- /dev/null +++ b/lib/tdlib/types/suggested_action/set_birthdate.rb @@ -0,0 +1,5 @@ +module TD::Types + # Suggests the user to set birthdate. + class SuggestedAction::SetBirthdate < SuggestedAction + end +end diff --git a/lib/tdlib/types/suggested_action/set_password.rb b/lib/tdlib/types/suggested_action/set_password.rb new file mode 100644 index 00000000..0f5fff1c --- /dev/null +++ b/lib/tdlib/types/suggested_action/set_password.rb @@ -0,0 +1,9 @@ +module TD::Types + # Suggests the user to set a 2-step verification password to be able to log in again. + # + # @attr authorization_delay [Integer] The number of days to pass between consecutive authorizations if the user + # declines to set password; if 0, then the user is advised to set the password for security reasons. + class SuggestedAction::SetPassword < SuggestedAction + attribute :authorization_delay, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/suggested_action/subscribe_to_annual_premium.rb b/lib/tdlib/types/suggested_action/subscribe_to_annual_premium.rb new file mode 100644 index 00000000..c0ef6563 --- /dev/null +++ b/lib/tdlib/types/suggested_action/subscribe_to_annual_premium.rb @@ -0,0 +1,5 @@ +module TD::Types + # Suggests the user to subscribe to the Premium subscription with annual payments. + class SuggestedAction::SubscribeToAnnualPremium < SuggestedAction + end +end diff --git a/lib/tdlib/types/suggested_action/upgrade_premium.rb b/lib/tdlib/types/suggested_action/upgrade_premium.rb new file mode 100644 index 00000000..d87bc552 --- /dev/null +++ b/lib/tdlib/types/suggested_action/upgrade_premium.rb @@ -0,0 +1,5 @@ +module TD::Types + # Suggests the user to upgrade the Premium subscription from monthly payments to annual payments. + class SuggestedAction::UpgradePremium < SuggestedAction + end +end diff --git a/lib/tdlib/types/suggested_action/view_checks_hint.rb b/lib/tdlib/types/suggested_action/view_checks_hint.rb new file mode 100644 index 00000000..5bda5662 --- /dev/null +++ b/lib/tdlib/types/suggested_action/view_checks_hint.rb @@ -0,0 +1,5 @@ +module TD::Types + # Suggests the user to view a hint about the meaning of one and two check marks on sent messages. + class SuggestedAction::ViewChecksHint < SuggestedAction + end +end diff --git a/lib/tdlib/types/supergroup.rb b/lib/tdlib/types/supergroup.rb index 185133c3..082485aa 100644 --- a/lib/tdlib/types/supergroup.rb +++ b/lib/tdlib/types/supergroup.rb @@ -6,46 +6,70 @@ module TD::Types # Unlike supergroups, channels can have an unlimited number of subscribers. # # @attr id [Integer] Supergroup or channel identifier. - # @attr username [TD::Types::String, nil] Username of the supergroup or channel; empty for private supergroups or - # channels. + # @attr usernames [TD::Types::Usernames, nil] Usernames of the supergroup or channel; may be null. # @attr date [Integer] Point in time (Unix timestamp) when the current user joined, or the point in time when the # supergroup or channel was created, in case the user is not a member. # @attr status [TD::Types::ChatMemberStatus] Status of the current user in the supergroup or channel; custom title - # will be always empty. + # will always be empty. # @attr member_count [Integer] Number of members in the supergroup or channel; 0 if unknown. - # Currently it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, - # searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or - # getUserPrivacySettingRules. + # Currently, it is guaranteed to be known only if the supergroup or channel was received through + # getChatSimilarChats, getChatsToSendStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, + # getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, + # searchChatsNearby, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in + # userFullInfo.personal_chat_id, or for chats with messages or stories from {TD::Types::PublicForwards} and foundStories. + # @attr boost_level [Integer] Approximate boost level for the chat. # @attr has_linked_chat [Boolean] True, if the channel has a discussion group, or the supergroup is the designated # discussion group for a channel. # @attr has_location [Boolean] True, if the supergroup is connected to a location, i.e. # the supergroup is a location-based supergroup. - # @attr sign_messages [Boolean] True, if messages sent to the channel should contain information about the sender. + # @attr sign_messages [Boolean] True, if messages sent to the channel contains name of the sender. # This field is only applicable to channels. + # @attr show_message_sender [Boolean] True, if messages sent to the channel have information about the sender user. + # This field is only applicable to channels. + # @attr join_to_send_messages [Boolean] True, if users need to join the supergroup before they can send messages. + # Always true for channels and non-discussion supergroups. + # @attr join_by_request [Boolean] True, if all users directly joining the supergroup need to be approved by + # supergroup administrators. + # Always false for channels and supergroups without username, location, or a linked chat. # @attr is_slow_mode_enabled [Boolean] True, if the slow mode is enabled in the supergroup. # @attr is_channel [Boolean] True, if the supergroup is a channel. # @attr is_broadcast_group [Boolean] True, if the supergroup is a broadcast group, i.e. - # only administrators can send messages and there is no limit on number of members. + # only administrators can send messages and there is no limit on the number of members. + # @attr is_forum [Boolean] True, if the supergroup is a forum with topics. # @attr is_verified [Boolean] True, if the supergroup or channel is verified. + # @attr has_sensitive_content [Boolean] True, if content of media messages in the supergroup or channel chat must be + # hidden with 18+ spoiler. # @attr restriction_reason [TD::Types::String] If non-empty, contains a human-readable description of the reason why # access to this supergroup or channel must be restricted. # @attr is_scam [Boolean] True, if many users reported this supergroup or channel as a scam. # @attr is_fake [Boolean] True, if many users reported this supergroup or channel as a fake account. + # @attr has_active_stories [Boolean] True, if the supergroup or channel has non-expired stories available to the + # current user. + # @attr has_unread_active_stories [Boolean] True, if the supergroup or channel has unread non-expired stories + # available to the current user. class Supergroup < Base attribute :id, TD::Types::Coercible::Integer - attribute :username, TD::Types::String.optional.default(nil) + attribute :usernames, TD::Types::Usernames.optional.default(nil) attribute :date, TD::Types::Coercible::Integer attribute :status, TD::Types::ChatMemberStatus attribute :member_count, TD::Types::Coercible::Integer + attribute :boost_level, TD::Types::Coercible::Integer attribute :has_linked_chat, TD::Types::Bool attribute :has_location, TD::Types::Bool attribute :sign_messages, TD::Types::Bool + attribute :show_message_sender, TD::Types::Bool + attribute :join_to_send_messages, TD::Types::Bool + attribute :join_by_request, TD::Types::Bool attribute :is_slow_mode_enabled, TD::Types::Bool attribute :is_channel, TD::Types::Bool attribute :is_broadcast_group, TD::Types::Bool + attribute :is_forum, TD::Types::Bool attribute :is_verified, TD::Types::Bool + attribute :has_sensitive_content, TD::Types::Bool attribute :restriction_reason, TD::Types::String attribute :is_scam, TD::Types::Bool attribute :is_fake, TD::Types::Bool + attribute :has_active_stories, TD::Types::Bool + attribute :has_unread_active_stories, TD::Types::Bool end end diff --git a/lib/tdlib/types/supergroup_full_info.rb b/lib/tdlib/types/supergroup_full_info.rb index 51f9ea6e..87c3f265 100644 --- a/lib/tdlib/types/supergroup_full_info.rb +++ b/lib/tdlib/types/supergroup_full_info.rb @@ -1,7 +1,8 @@ module TD::Types # Contains full information about a supergroup or channel. # - # @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] Supergroup or channel description. # @attr member_count [Integer] Number of members in the supergroup or channel; 0 if unknown. # @attr administrator_count [Integer] Number of privileged users in the supergroup or channel; 0 if unknown. @@ -14,19 +15,45 @@ module TD::Types # @attr slow_mode_delay_expires_in [Float] Time left before next message can be sent in the supergroup, in seconds. # An {TD::Types::Update::SupergroupFullInfo} update is not triggered when value of this field changes, but both new # and old values are non-zero. - # @attr can_get_members [Boolean] True, if members of the chat can be retrieved. - # @attr can_set_username [Boolean] True, if the chat username can be changed. + # @attr can_enable_paid_reaction [Boolean] True, if paid reaction can be enabled in the channel chat; for channels + # only. + # @attr can_get_members [Boolean] True, if members of the chat can be retrieved via getSupergroupMembers or + # searchChatMembers. + # @attr has_hidden_members [Boolean] True, if non-administrators can receive only administrators and bots using + # getSupergroupMembers or searchChatMembers. + # @attr can_hide_members [Boolean] True, if non-administrators and non-bots can be hidden in responses to + # getSupergroupMembers and searchChatMembers for non-administrators. # @attr can_set_sticker_set [Boolean] True, if the supergroup sticker set can be changed. # @attr can_set_location [Boolean] True, if the supergroup location can be changed. # @attr can_get_statistics [Boolean] True, if the supergroup or channel statistics are available. + # @attr can_get_revenue_statistics [Boolean] True, if the supergroup or channel revenue statistics are available. + # @attr can_get_star_revenue_statistics [Boolean] True, if the supergroup or channel Telegram Star revenue statistics + # are available. + # @attr can_toggle_aggressive_anti_spam [Boolean] True, if aggressive anti-spam checks can be enabled or disabled in + # the supergroup. # @attr is_all_history_available [Boolean] True, if new chat members will have access to old messages. - # In public or discussion groups and both public and private channels, old messages are always available, so this - # option affects only private supergroups without a linked chat. - # The value of this field is only available for chat administrators. - # @attr sticker_set_id [Integer] Identifier of the supergroup sticker set; 0 if none. - # @attr location [TD::Types::ChatLocation, nil] Location to which the supergroup is connected; may be null. - # @attr invite_link [TD::Types::ChatInviteLink, nil] Primary invite link for this chat; may be null. + # In public, discussion, of forum groups and all channels, old messages are always available, so this option + # affects only private non-forum supergroups without a linked chat. + # The value of this field is only available to chat administrators. + # @attr can_have_sponsored_messages [Boolean] True, if the chat can have sponsored messages. + # The value of this field is only available to the owner of the chat. + # @attr has_aggressive_anti_spam_enabled [Boolean] True, if aggressive anti-spam checks are enabled in the + # supergroup. + # The value of this field is only available to chat administrators. + # @attr has_paid_media_allowed [Boolean] True, if paid media can be sent and forwarded to the channel chat; for + # channels only. + # @attr has_pinned_stories [Boolean] True, if the supergroup or channel has pinned stories. + # @attr my_boost_count [Integer] Number of times the current user boosted the supergroup or channel. + # @attr unrestrict_boost_count [Integer] Number of times the supergroup must be boosted by a user to ignore slow mode + # and chat permission restrictions; 0 if unspecified. + # @attr sticker_set_id [Integer] Identifier of the supergroup sticker set that must be shown before user sticker + # sets; 0 if none. + # @attr custom_emoji_sticker_set_id [Integer] Identifier of the custom emoji sticker set that can be used in the + # supergroup without Telegram Premium subscription; 0 if none. + # @attr location [TD::Types::ChatLocation, nil] Location to which the supergroup is connected; may be null if none. + # @attr invite_link [TD::Types::ChatInviteLink, nil] Primary invite link for the chat; may be null. # For chat administrators with can_invite_users right only. + # @attr bot_commands [Array] List of commands of bots in the group. # @attr upgraded_from_basic_group_id [Integer] Identifier of the basic group from which supergroup was upgraded; 0 if # none. # @attr upgraded_from_max_message_id [Integer] Identifier of the last message in the basic group from which @@ -41,15 +68,28 @@ class SupergroupFullInfo < Base attribute :linked_chat_id, TD::Types::Coercible::Integer attribute :slow_mode_delay, TD::Types::Coercible::Integer attribute :slow_mode_delay_expires_in, TD::Types::Coercible::Float + attribute :can_enable_paid_reaction, TD::Types::Bool attribute :can_get_members, TD::Types::Bool - attribute :can_set_username, TD::Types::Bool + attribute :has_hidden_members, TD::Types::Bool + attribute :can_hide_members, TD::Types::Bool attribute :can_set_sticker_set, TD::Types::Bool attribute :can_set_location, TD::Types::Bool attribute :can_get_statistics, TD::Types::Bool + attribute :can_get_revenue_statistics, TD::Types::Bool + attribute :can_get_star_revenue_statistics, TD::Types::Bool + attribute :can_toggle_aggressive_anti_spam, TD::Types::Bool attribute :is_all_history_available, TD::Types::Bool + attribute :can_have_sponsored_messages, TD::Types::Bool + attribute :has_aggressive_anti_spam_enabled, TD::Types::Bool + attribute :has_paid_media_allowed, TD::Types::Bool + attribute :has_pinned_stories, TD::Types::Bool + attribute :my_boost_count, TD::Types::Coercible::Integer + attribute :unrestrict_boost_count, TD::Types::Coercible::Integer attribute :sticker_set_id, TD::Types::Coercible::Integer + attribute :custom_emoji_sticker_set_id, TD::Types::Coercible::Integer attribute :location, TD::Types::ChatLocation.optional.default(nil) attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil) + attribute :bot_commands, TD::Types::Array.of(TD::Types::BotCommands) attribute :upgraded_from_basic_group_id, TD::Types::Coercible::Integer attribute :upgraded_from_max_message_id, TD::Types::Coercible::Integer end diff --git a/lib/tdlib/types/t_me_url_type.rb b/lib/tdlib/types/t_me_url_type.rb index 4ec86c94..f74f9dde 100644 --- a/lib/tdlib/types/t_me_url_type.rb +++ b/lib/tdlib/types/t_me_url_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the type of a URL linking to an internal Telegram entity. + # Describes the type of URL linking to an internal Telegram entity. class TMeUrlType < Base %w[ user diff --git a/lib/tdlib/types/t_me_url_type/chat_invite.rb b/lib/tdlib/types/t_me_url_type/chat_invite.rb index 5f1a2734..9100b04b 100644 --- a/lib/tdlib/types/t_me_url_type/chat_invite.rb +++ b/lib/tdlib/types/t_me_url_type/chat_invite.rb @@ -1,7 +1,7 @@ module TD::Types # A chat invite link. # - # @attr info [TD::Types::ChatInviteLinkInfo] Chat invite link info. + # @attr info [TD::Types::ChatInviteLinkInfo] Information about the chat invite link. class TMeUrlType::ChatInvite < TMeUrlType attribute :info, TD::Types::ChatInviteLinkInfo end diff --git a/lib/tdlib/types/target_chat.rb b/lib/tdlib/types/target_chat.rb new file mode 100644 index 00000000..0b44a647 --- /dev/null +++ b/lib/tdlib/types/target_chat.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes the target chat to be opened. + class TargetChat < Base + %w[ + current + chosen + internal_link + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/target_chat/#{type}" + end + end +end diff --git a/lib/tdlib/types/target_chat/chosen.rb b/lib/tdlib/types/target_chat/chosen.rb new file mode 100644 index 00000000..3b227a74 --- /dev/null +++ b/lib/tdlib/types/target_chat/chosen.rb @@ -0,0 +1,14 @@ +module TD::Types + # The chat needs to be chosen by the user among chats of the specified types. + # + # @attr allow_user_chats [Boolean] True, if private chats with ordinary users are allowed. + # @attr allow_bot_chats [Boolean] True, if private chats with other bots are allowed. + # @attr allow_group_chats [Boolean] True, if basic group and supergroup chats are allowed. + # @attr allow_channel_chats [Boolean] True, if channel chats are allowed. + class TargetChat::Chosen < TargetChat + attribute :allow_user_chats, TD::Types::Bool + attribute :allow_bot_chats, TD::Types::Bool + attribute :allow_group_chats, TD::Types::Bool + attribute :allow_channel_chats, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/target_chat/current.rb b/lib/tdlib/types/target_chat/current.rb new file mode 100644 index 00000000..77f996d1 --- /dev/null +++ b/lib/tdlib/types/target_chat/current.rb @@ -0,0 +1,5 @@ +module TD::Types + # The currently opened chat needs to be kept. + class TargetChat::Current < TargetChat + end +end diff --git a/lib/tdlib/types/target_chat/internal_link.rb b/lib/tdlib/types/target_chat/internal_link.rb new file mode 100644 index 00000000..fa4e2fa8 --- /dev/null +++ b/lib/tdlib/types/target_chat/internal_link.rb @@ -0,0 +1,8 @@ +module TD::Types + # The chat needs to be open with the provided internal link. + # + # @attr link [TD::Types::InternalLinkType] An internal link pointing to the chat. + class TargetChat::InternalLink < TargetChat + attribute :link, TD::Types::InternalLinkType + end +end diff --git a/lib/tdlib/types/tdlib_parameters.rb b/lib/tdlib/types/tdlib_parameters.rb deleted file mode 100644 index 7e66cf98..00000000 --- a/lib/tdlib/types/tdlib_parameters.rb +++ /dev/null @@ -1,48 +0,0 @@ -module TD::Types - # Contains parameters for TDLib initialization. - # - # @attr use_test_dc [Boolean, nil] If set to true, the Telegram test environment will be used instead of the - # production environment. - # @attr database_directory [TD::Types::String, nil] The path to the directory for the persistent database; if empty, - # the current working directory will be used. - # @attr files_directory [TD::Types::String, nil] The path to the directory for storing files; if empty, - # database_directory will be used. - # @attr use_file_database [Boolean, nil] If set to true, information about downloaded and uploaded files will be - # saved between application restarts. - # @attr use_chat_info_database [Boolean, nil] If set to true, the library will maintain a cache of users, basic - # groups, supergroups, channels and secret chats. - # Implies use_file_database. - # @attr use_message_database [Boolean, nil] If set to true, the library will maintain a cache of chats and messages. - # Implies use_chat_info_database. - # @attr use_secret_chats [Boolean, nil] If set to true, support for secret chats will be enabled. - # @attr api_id [Integer, nil] Application identifier for Telegram API access, which can be obtained at - # https://my.telegram.org. - # @attr api_hash [TD::Types::String, nil] Application identifier hash for Telegram API access, which can be obtained - # at https://my.telegram.org. - # @attr system_language_code [TD::Types::String] IETF language tag of the user's operating system language; must be - # non-empty. - # @attr device_model [TD::Types::String] Model of the device the application is being run on; must be non-empty. - # @attr system_version [TD::Types::String, nil] Version of the operating system the application is being run on. - # If empty, the version is automatically detected by TDLib. - # @attr application_version [TD::Types::String] Application version; must be non-empty. - # @attr enable_storage_optimizer [Boolean, nil] If set to true, old files will automatically be deleted. - # @attr ignore_file_names [Boolean, nil] If set to true, original file names will be ignored. - # Otherwise, downloaded files will be saved under names as close as possible to the original name. - class TdlibParameters < Base - attribute :use_test_dc, TD::Types::Bool.optional.default(nil) - attribute :database_directory, TD::Types::String.optional.default(nil) - attribute :files_directory, TD::Types::String.optional.default(nil) - attribute :use_file_database, TD::Types::Bool.optional.default(nil) - attribute :use_chat_info_database, TD::Types::Bool.optional.default(nil) - attribute :use_message_database, TD::Types::Bool.optional.default(nil) - attribute :use_secret_chats, TD::Types::Bool.optional.default(nil) - attribute :api_id, TD::Types::Coercible::Integer.optional.default(nil) - attribute :api_hash, TD::Types::String.optional.default(nil) - attribute :system_language_code, TD::Types::String - attribute :device_model, TD::Types::String - attribute :system_version, TD::Types::String.optional.default(nil) - attribute :application_version, TD::Types::String - attribute :enable_storage_optimizer, TD::Types::Bool.optional.default(nil) - attribute :ignore_file_names, TD::Types::Bool.optional.default(nil) - end -end diff --git a/lib/tdlib/types/telegram_payment_purpose.rb b/lib/tdlib/types/telegram_payment_purpose.rb new file mode 100644 index 00000000..664141b7 --- /dev/null +++ b/lib/tdlib/types/telegram_payment_purpose.rb @@ -0,0 +1,14 @@ +module TD::Types + # Describes a purpose of a payment toward Telegram. + class TelegramPaymentPurpose < Base + %w[ + premium_gift_codes + premium_giveaway + stars + gifted_stars + join_chat + ].each do |type| + autoload TD::Types.camelize(type), "tdlib/types/telegram_payment_purpose/#{type}" + end + end +end diff --git a/lib/tdlib/types/telegram_payment_purpose/gifted_stars.rb b/lib/tdlib/types/telegram_payment_purpose/gifted_stars.rb new file mode 100644 index 00000000..c9364f2d --- /dev/null +++ b/lib/tdlib/types/telegram_payment_purpose/gifted_stars.rb @@ -0,0 +1,14 @@ +module TD::Types + # The user buying Telegram Stars for other users. + # + # @attr user_id [Integer] Identifier of the user to which Telegram Stars are gifted. + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + # @attr star_count [Integer] Number of bought Telegram Stars. + class TelegramPaymentPurpose::GiftedStars < TelegramPaymentPurpose + attribute :user_id, TD::Types::Coercible::Integer + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :star_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/telegram_payment_purpose/join_chat.rb b/lib/tdlib/types/telegram_payment_purpose/join_chat.rb new file mode 100644 index 00000000..087fab57 --- /dev/null +++ b/lib/tdlib/types/telegram_payment_purpose/join_chat.rb @@ -0,0 +1,8 @@ +module TD::Types + # The user joins a chat and subscribes to regular payments in Telegram Stars. + # + # @attr invite_link [TD::Types::String] Invite link to use. + class TelegramPaymentPurpose::JoinChat < TelegramPaymentPurpose + attribute :invite_link, TD::Types::String + end +end diff --git a/lib/tdlib/types/telegram_payment_purpose/premium_gift_codes.rb b/lib/tdlib/types/telegram_payment_purpose/premium_gift_codes.rb new file mode 100644 index 00000000..cc0731f0 --- /dev/null +++ b/lib/tdlib/types/telegram_payment_purpose/premium_gift_codes.rb @@ -0,0 +1,17 @@ +module TD::Types + # The user creating Telegram Premium gift codes for other users. + # + # @attr boosted_chat_id [Integer] Identifier of the supergroup or channel chat, which will be automatically boosted + # by the users for duration of the Premium subscription and which is administered by the user; 0 if none. + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + # @attr user_ids [Array] Identifiers of the users which can activate the gift codes. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active for the users. + class TelegramPaymentPurpose::PremiumGiftCodes < TelegramPaymentPurpose + attribute :boosted_chat_id, TD::Types::Coercible::Integer + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :user_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :month_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/telegram_payment_purpose/premium_giveaway.rb b/lib/tdlib/types/telegram_payment_purpose/premium_giveaway.rb new file mode 100644 index 00000000..a45db92d --- /dev/null +++ b/lib/tdlib/types/telegram_payment_purpose/premium_giveaway.rb @@ -0,0 +1,16 @@ +module TD::Types + # The user creating a Telegram Premium giveaway. + # + # @attr parameters [TD::Types::PremiumGiveawayParameters] Giveaway parameters. + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + # @attr winner_count [Integer] Number of users which will be able to activate the gift codes. + # @attr month_count [Integer] Number of months the Telegram Premium subscription will be active for the users. + class TelegramPaymentPurpose::PremiumGiveaway < TelegramPaymentPurpose + attribute :parameters, TD::Types::PremiumGiveawayParameters + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :winner_count, TD::Types::Coercible::Integer + attribute :month_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/telegram_payment_purpose/stars.rb b/lib/tdlib/types/telegram_payment_purpose/stars.rb new file mode 100644 index 00000000..df4ca6f3 --- /dev/null +++ b/lib/tdlib/types/telegram_payment_purpose/stars.rb @@ -0,0 +1,12 @@ +module TD::Types + # The user buying Telegram Stars. + # + # @attr currency [TD::Types::String] ISO 4217 currency code of the payment currency. + # @attr amount [Integer] Paid amount, in the smallest units of the currency. + # @attr star_count [Integer] Number of bought Telegram Stars. + class TelegramPaymentPurpose::Stars < TelegramPaymentPurpose + attribute :currency, TD::Types::String + attribute :amount, TD::Types::Coercible::Integer + attribute :star_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/terms_of_service.rb b/lib/tdlib/types/terms_of_service.rb index ca5e97cf..f5ad1d77 100644 --- a/lib/tdlib/types/terms_of_service.rb +++ b/lib/tdlib/types/terms_of_service.rb @@ -2,7 +2,7 @@ module TD::Types # Contains Telegram terms of service. # # @attr text [TD::Types::FormattedText] Text of the terms of service. - # @attr min_user_age [Integer] The minimum age of a user to be able to accept the terms; 0 if any. + # @attr min_user_age [Integer] The minimum age of a user to be able to accept the terms; 0 if age isn't restricted. # @attr show_popup [Boolean] True, if a blocking popup with terms of service must be shown to the user. class TermsOfService < Base attribute :text, TD::Types::FormattedText diff --git a/lib/tdlib/types/text_entity_type.rb b/lib/tdlib/types/text_entity_type.rb index 2a2c92c1..b4d78973 100644 --- a/lib/tdlib/types/text_entity_type.rb +++ b/lib/tdlib/types/text_entity_type.rb @@ -14,11 +14,16 @@ class TextEntityType < Base italic underline strikethrough + spoiler code pre pre_code + block_quote + expandable_block_quote text_url mention_name + custom_emoji + media_timestamp ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/text_entity_type/#{type}" end diff --git a/lib/tdlib/types/text_entity_type/block_quote.rb b/lib/tdlib/types/text_entity_type/block_quote.rb new file mode 100644 index 00000000..6b51a9b4 --- /dev/null +++ b/lib/tdlib/types/text_entity_type/block_quote.rb @@ -0,0 +1,5 @@ +module TD::Types + # Text that must be formatted as if inside a blockquote HTML tag; not supported in secret chats. + class TextEntityType::BlockQuote < TextEntityType + end +end diff --git a/lib/tdlib/types/text_entity_type/bot_command.rb b/lib/tdlib/types/text_entity_type/bot_command.rb index 1ed6727e..c372704a 100644 --- a/lib/tdlib/types/text_entity_type/bot_command.rb +++ b/lib/tdlib/types/text_entity_type/bot_command.rb @@ -1,6 +1,5 @@ module TD::Types # A bot command, beginning with "/". - # This shouldn't be highlighted if there are no bots in the chat. class TextEntityType::BotCommand < TextEntityType end end diff --git a/lib/tdlib/types/text_entity_type/cashtag.rb b/lib/tdlib/types/text_entity_type/cashtag.rb index 66d09ac0..38a4f732 100644 --- a/lib/tdlib/types/text_entity_type/cashtag.rb +++ b/lib/tdlib/types/text_entity_type/cashtag.rb @@ -1,6 +1,5 @@ module TD::Types - # A cashtag text, beginning with "$" and consisting of capital english letters (i.e. - # "$USD"). + # A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD"). class TextEntityType::Cashtag < TextEntityType end end diff --git a/lib/tdlib/types/text_entity_type/custom_emoji.rb b/lib/tdlib/types/text_entity_type/custom_emoji.rb new file mode 100644 index 00000000..b1c9e10e --- /dev/null +++ b/lib/tdlib/types/text_entity_type/custom_emoji.rb @@ -0,0 +1,10 @@ +module TD::Types + # A custom emoji. + # The text behind a custom emoji must be an emoji. + # Only premium users can use premium custom emoji. + # + # @attr custom_emoji_id [Integer] Unique identifier of the custom emoji. + class TextEntityType::CustomEmoji < TextEntityType + attribute :custom_emoji_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/text_entity_type/expandable_block_quote.rb b/lib/tdlib/types/text_entity_type/expandable_block_quote.rb new file mode 100644 index 00000000..7ef9806a --- /dev/null +++ b/lib/tdlib/types/text_entity_type/expandable_block_quote.rb @@ -0,0 +1,6 @@ +module TD::Types + # Text that must be formatted as if inside a blockquote HTML tag and collapsed by default to 3 lines with the ability + # to show full text; not supported in secret chats. + class TextEntityType::ExpandableBlockQuote < TextEntityType + end +end diff --git a/lib/tdlib/types/text_entity_type/media_timestamp.rb b/lib/tdlib/types/text_entity_type/media_timestamp.rb new file mode 100644 index 00000000..71187097 --- /dev/null +++ b/lib/tdlib/types/text_entity_type/media_timestamp.rb @@ -0,0 +1,11 @@ +module TD::Types + # A media timestamp. + # + # @attr media_timestamp [Integer] Timestamp from which a video/audio/video note/voice note/story playing must start, + # in seconds. + # The media can be in the content or the link preview of the current message, or in the same places in the replied + # message. + class TextEntityType::MediaTimestamp < TextEntityType + attribute :media_timestamp, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/text_entity_type/mention.rb b/lib/tdlib/types/text_entity_type/mention.rb index c0ec7a17..3255aba7 100644 --- a/lib/tdlib/types/text_entity_type/mention.rb +++ b/lib/tdlib/types/text_entity_type/mention.rb @@ -1,5 +1,5 @@ module TD::Types - # A mention of a user by their username. + # A mention of a user, a supergroup, or a channel by their username. class TextEntityType::Mention < TextEntityType end end diff --git a/lib/tdlib/types/text_entity_type/spoiler.rb b/lib/tdlib/types/text_entity_type/spoiler.rb new file mode 100644 index 00000000..d15bda91 --- /dev/null +++ b/lib/tdlib/types/text_entity_type/spoiler.rb @@ -0,0 +1,5 @@ +module TD::Types + # A spoiler text. + class TextEntityType::Spoiler < TextEntityType + end +end diff --git a/lib/tdlib/types/text_parse_mode.rb b/lib/tdlib/types/text_parse_mode.rb index 52c45298..ebcaf2a2 100644 --- a/lib/tdlib/types/text_parse_mode.rb +++ b/lib/tdlib/types/text_parse_mode.rb @@ -1,5 +1,5 @@ module TD::Types - # Describes the way the text should be parsed for TextEntities. + # Describes the way the text needs to be parsed for text entities. class TextParseMode < Base %w[ markdown diff --git a/lib/tdlib/types/text_quote.rb b/lib/tdlib/types/text_quote.rb new file mode 100644 index 00000000..2fd94062 --- /dev/null +++ b/lib/tdlib/types/text_quote.rb @@ -0,0 +1,14 @@ +module TD::Types + # Describes manually or automatically chosen quote from another message. + # + # @attr text [TD::Types::FormattedText] Text of the quote. + # Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text. + # @attr position [Integer] Approximate quote position in the original message in UTF-16 code units as specified by + # the message sender. + # @attr is_manual [Boolean] True, if the quote was manually chosen by the message sender. + class TextQuote < Base + attribute :text, TD::Types::FormattedText + attribute :position, TD::Types::Coercible::Integer + attribute :is_manual, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/theme_parameters.rb b/lib/tdlib/types/theme_parameters.rb new file mode 100644 index 00000000..2db8fa96 --- /dev/null +++ b/lib/tdlib/types/theme_parameters.rb @@ -0,0 +1,34 @@ +module TD::Types + # Contains parameters of the application theme. + # + # @attr background_color [Integer] A color of the background in the RGB24 format. + # @attr secondary_background_color [Integer] A secondary color for the background in the RGB24 format. + # @attr header_background_color [Integer] A color of the header background in the RGB24 format. + # @attr section_background_color [Integer] A color of the section background in the RGB24 format. + # @attr section_separator_color [Integer] A color of the section separator in the RGB24 format. + # @attr text_color [Integer] A color of text in the RGB24 format. + # @attr accent_text_color [Integer] An accent color of the text in the RGB24 format. + # @attr section_header_text_color [Integer] A color of text on the section headers in the RGB24 format. + # @attr subtitle_text_color [Integer] A color of the subtitle text in the RGB24 format. + # @attr destructive_text_color [Integer] A color of the text for destructive actions in the RGB24 format. + # @attr hint_color [Integer] A color of hints in the RGB24 format. + # @attr link_color [Integer] A color of links in the RGB24 format. + # @attr button_color [Integer] A color of the buttons in the RGB24 format. + # @attr button_text_color [Integer] A color of text on the buttons in the RGB24 format. + class ThemeParameters < Base + attribute :background_color, TD::Types::Coercible::Integer + attribute :secondary_background_color, TD::Types::Coercible::Integer + attribute :header_background_color, TD::Types::Coercible::Integer + attribute :section_background_color, TD::Types::Coercible::Integer + attribute :section_separator_color, TD::Types::Coercible::Integer + attribute :text_color, TD::Types::Coercible::Integer + attribute :accent_text_color, TD::Types::Coercible::Integer + attribute :section_header_text_color, TD::Types::Coercible::Integer + attribute :subtitle_text_color, TD::Types::Coercible::Integer + attribute :destructive_text_color, TD::Types::Coercible::Integer + attribute :hint_color, TD::Types::Coercible::Integer + attribute :link_color, TD::Types::Coercible::Integer + attribute :button_color, TD::Types::Coercible::Integer + attribute :button_text_color, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/theme_settings.rb b/lib/tdlib/types/theme_settings.rb new file mode 100644 index 00000000..1b221cb9 --- /dev/null +++ b/lib/tdlib/types/theme_settings.rb @@ -0,0 +1,17 @@ +module TD::Types + # Describes theme settings. + # + # @attr accent_color [Integer] Theme accent color in ARGB format. + # @attr background [TD::Types::Background, nil] The background to be used in chats; may be null. + # @attr outgoing_message_fill [TD::Types::BackgroundFill] The fill to be used as a background for outgoing messages. + # @attr animate_outgoing_message_fill [Boolean] If true, the freeform gradient fill needs to be animated on every + # sent message. + # @attr outgoing_message_accent_color [Integer] Accent color of outgoing messages in ARGB format. + class ThemeSettings < Base + attribute :accent_color, TD::Types::Coercible::Integer + attribute :background, TD::Types::Background.optional.default(nil) + attribute :outgoing_message_fill, TD::Types::BackgroundFill + attribute :animate_outgoing_message_fill, TD::Types::Bool + attribute :outgoing_message_accent_color, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/thumbnail_format.rb b/lib/tdlib/types/thumbnail_format.rb index c20a7e3b..6c4e8dc7 100644 --- a/lib/tdlib/types/thumbnail_format.rb +++ b/lib/tdlib/types/thumbnail_format.rb @@ -1,13 +1,14 @@ module TD::Types - # Describes format of the thumbnail. + # Describes format of a thumbnail. class ThumbnailFormat < Base %w[ jpeg - png - webp gif - tgs mpeg4 + png + tgs + webm + webp ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/thumbnail_format/#{type}" end diff --git a/lib/tdlib/types/thumbnail_format/gif.rb b/lib/tdlib/types/thumbnail_format/gif.rb index 4f22930d..0751c7b7 100644 --- a/lib/tdlib/types/thumbnail_format/gif.rb +++ b/lib/tdlib/types/thumbnail_format/gif.rb @@ -1,6 +1,6 @@ module TD::Types # The thumbnail is in static GIF format. - # It will be used only for some bot inline results. + # It will be used only for some bot inline query results. class ThumbnailFormat::Gif < ThumbnailFormat end end diff --git a/lib/tdlib/types/thumbnail_format/tgs.rb b/lib/tdlib/types/thumbnail_format/tgs.rb index 7d25e801..719593ac 100644 --- a/lib/tdlib/types/thumbnail_format/tgs.rb +++ b/lib/tdlib/types/thumbnail_format/tgs.rb @@ -1,6 +1,6 @@ module TD::Types # The thumbnail is in TGS format. - # It will be used only for animated sticker sets. + # It will be used only for sticker sets. class ThumbnailFormat::Tgs < ThumbnailFormat end end diff --git a/lib/tdlib/types/thumbnail_format/webm.rb b/lib/tdlib/types/thumbnail_format/webm.rb new file mode 100644 index 00000000..e385377f --- /dev/null +++ b/lib/tdlib/types/thumbnail_format/webm.rb @@ -0,0 +1,6 @@ +module TD::Types + # The thumbnail is in WEBM format. + # It will be used only for sticker sets. + class ThumbnailFormat::Webm < ThumbnailFormat + end +end diff --git a/lib/tdlib/types/thumbnail_format/webp.rb b/lib/tdlib/types/thumbnail_format/webp.rb index ec20b732..4f6ce692 100644 --- a/lib/tdlib/types/thumbnail_format/webp.rb +++ b/lib/tdlib/types/thumbnail_format/webp.rb @@ -1,6 +1,6 @@ module TD::Types # The thumbnail is in WEBP format. - # It will be used only for some stickers. + # It will be used only for some stickers and sticker sets. class ThumbnailFormat::Webp < ThumbnailFormat end end diff --git a/lib/tdlib/types/time_zone.rb b/lib/tdlib/types/time_zone.rb new file mode 100644 index 00000000..bb1c174a --- /dev/null +++ b/lib/tdlib/types/time_zone.rb @@ -0,0 +1,12 @@ +module TD::Types + # Describes a time zone. + # + # @attr id [TD::Types::String] Unique time zone identifier. + # @attr name [TD::Types::String] Time zone name. + # @attr utc_time_offset [Integer] Current UTC time offset for the time zone. + class TimeZone < Base + attribute :id, TD::Types::String + attribute :name, TD::Types::String + attribute :utc_time_offset, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/time_zones.rb b/lib/tdlib/types/time_zones.rb new file mode 100644 index 00000000..93d18d1e --- /dev/null +++ b/lib/tdlib/types/time_zones.rb @@ -0,0 +1,8 @@ +module TD::Types + # Contains a list of time zones. + # + # @attr time_zones [Array] A list of time zones. + class TimeZones < Base + attribute :time_zones, TD::Types::Array.of(TD::Types::TimeZone) + end +end diff --git a/lib/tdlib/types/top_chat_category.rb b/lib/tdlib/types/top_chat_category.rb index 10069961..0f905dd6 100644 --- a/lib/tdlib/types/top_chat_category.rb +++ b/lib/tdlib/types/top_chat_category.rb @@ -7,6 +7,7 @@ class TopChatCategory < Base groups channels inline_bots + web_app_bots calls forward_chats ].each do |type| diff --git a/lib/tdlib/types/top_chat_category/web_app_bots.rb b/lib/tdlib/types/top_chat_category/web_app_bots.rb new file mode 100644 index 00000000..bd9d3f29 --- /dev/null +++ b/lib/tdlib/types/top_chat_category/web_app_bots.rb @@ -0,0 +1,5 @@ +module TD::Types + # A category containing frequently used chats with bots, which Web Apps were opened. + class TopChatCategory::WebAppBots < TopChatCategory + end +end diff --git a/lib/tdlib/types/trending_sticker_sets.rb b/lib/tdlib/types/trending_sticker_sets.rb new file mode 100644 index 00000000..ad4c455a --- /dev/null +++ b/lib/tdlib/types/trending_sticker_sets.rb @@ -0,0 +1,12 @@ +module TD::Types + # Represents a list of trending sticker sets. + # + # @attr total_count [Integer] Approximate total number of trending sticker sets. + # @attr sets [Array] List of trending sticker sets. + # @attr is_premium [Boolean] True, if the list contains sticker sets with premium stickers. + class TrendingStickerSets < Base + attribute :total_count, TD::Types::Coercible::Integer + attribute :sets, TD::Types::Array.of(TD::Types::StickerSetInfo) + attribute :is_premium, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/unconfirmed_session.rb b/lib/tdlib/types/unconfirmed_session.rb new file mode 100644 index 00000000..8a20fc83 --- /dev/null +++ b/lib/tdlib/types/unconfirmed_session.rb @@ -0,0 +1,16 @@ +module TD::Types + # Contains information about an unconfirmed session. + # + # @attr id [Integer] Session identifier. + # @attr log_in_date [Integer] Point in time (Unix timestamp) when the user has logged in. + # @attr device_model [TD::Types::String] Model of the device that was used for the session creation, as provided by + # the application. + # @attr location [TD::Types::String] A human-readable description of the location from which the session was created, + # based on the IP address. + class UnconfirmedSession < Base + attribute :id, TD::Types::Coercible::Integer + attribute :log_in_date, TD::Types::Coercible::Integer + attribute :device_model, TD::Types::String + attribute :location, TD::Types::String + end +end diff --git a/lib/tdlib/types/unread_reaction.rb b/lib/tdlib/types/unread_reaction.rb new file mode 100644 index 00000000..a5ce749a --- /dev/null +++ b/lib/tdlib/types/unread_reaction.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains information about an unread reaction to a message. + # + # @attr type [TD::Types::ReactionType] Type of the reaction. + # @attr sender_id [TD::Types::MessageSender] Identifier of the sender, added the reaction. + # @attr is_big [Boolean] True, if the reaction was added with a big animation. + class UnreadReaction < Base + attribute :type, TD::Types::ReactionType + attribute :sender_id, TD::Types::MessageSender + attribute :is_big, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/update.rb b/lib/tdlib/types/update.rb index a3832b14..c2f726cd 100644 --- a/lib/tdlib/types/update.rb +++ b/lib/tdlib/types/update.rb @@ -13,35 +13,59 @@ class Update < Base message_interaction_info message_content_opened message_mention_read + message_unread_reactions + message_fact_check message_live_location_viewed new_chat chat_title chat_photo + chat_accent_colors chat_permissions chat_last_message chat_position - chat_is_marked_as_unread - chat_is_blocked - chat_has_scheduled_messages - chat_voice_chat - chat_default_disable_notification + chat_added_to_list + chat_removed_from_list chat_read_inbox chat_read_outbox - chat_unread_mention_count - chat_notification_settings - scope_notification_settings - chat_message_ttl_setting chat_action_bar - chat_reply_markup + chat_business_bot_manage_bar + chat_available_reactions chat_draft_message - chat_filters + chat_emoji_status + chat_message_sender + chat_message_auto_delete_time + chat_notification_settings + chat_pending_join_requests + chat_reply_markup + chat_background + chat_theme + chat_unread_mention_count + chat_unread_reaction_count + chat_video_chat + chat_default_disable_notification + chat_has_protected_content + chat_is_translatable + chat_is_marked_as_unread + chat_view_as_topics + chat_block_list + chat_has_scheduled_messages + chat_folders chat_online_member_count + saved_messages_topic + saved_messages_topic_count + quick_reply_shortcut + quick_reply_shortcut_deleted + quick_reply_shortcuts + quick_reply_shortcut_messages + forum_topic_info + scope_notification_settings + reaction_notification_settings notification notification_group active_notifications have_pending_notifications delete_messages - user_chat_action + chat_action user_status user basic_group @@ -54,6 +78,11 @@ class Update < Base file file_generation_start file_generation_stop + file_downloads + file_added_to_downloads + file_download + file_removed_from_downloads + application_verification_required call group_call group_call_participant @@ -61,6 +90,13 @@ class Update < Base user_privacy_setting_rules unread_message_count unread_chat_count + story + story_deleted + story_send_succeeded + story_send_failed + chat_active_stories + story_list_chat_count + story_stealth_mode option sticker_set installed_sticker_sets @@ -68,18 +104,43 @@ class Update < Base recent_stickers favorite_stickers saved_animations - selected_background + saved_notification_sounds + default_background + chat_themes + accent_colors + profile_accent_colors language_pack_strings connection_state terms_of_service users_nearby + unconfirmed_session + attachment_menu_bots + web_app_message_sent + active_emoji_reactions + available_message_effects + default_reaction_type + saved_messages_tags + active_live_location_messages + owned_star_count + chat_revenue_amount + star_revenue_status + speech_recognition_trial dice_emojis + animated_emoji_message_clicked animation_search_parameters suggested_actions + speed_limit_notification + contact_close_birthdays + autosave_settings + business_connection + new_business_message + business_message_edited + business_messages_deleted new_inline_query new_chosen_inline_result new_callback_query new_inline_callback_query + new_business_callback_query new_shipping_query new_pre_checkout_query new_custom_event @@ -87,6 +148,10 @@ class Update < Base poll poll_answer chat_member + new_chat_join_request + chat_boost + message_reaction + message_reactions ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/update/#{type}" end diff --git a/lib/tdlib/types/update/accent_colors.rb b/lib/tdlib/types/update/accent_colors.rb new file mode 100644 index 00000000..b2f2fd93 --- /dev/null +++ b/lib/tdlib/types/update/accent_colors.rb @@ -0,0 +1,15 @@ +module TD::Types + # The list of supported accent colors has changed. + # + # @attr colors [Array] Information about supported colors; colors with identifiers 0 (red), 1 + # (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren't included in + # the list. + # The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme. + # @attr available_accent_color_ids [Array] The list of accent color identifiers, which can be set through + # setAccentColor and setChatAccentColor. + # The colors must be shown in the specififed order. + class Update::AccentColors < Update + attribute :colors, TD::Types::Array.of(TD::Types::AccentColor) + attribute :available_accent_color_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/update/active_emoji_reactions.rb b/lib/tdlib/types/update/active_emoji_reactions.rb new file mode 100644 index 00000000..34cddcc5 --- /dev/null +++ b/lib/tdlib/types/update/active_emoji_reactions.rb @@ -0,0 +1,8 @@ +module TD::Types + # The list of active emoji reactions has changed. + # + # @attr emojis [Array] The new list of active emoji reactions. + class Update::ActiveEmojiReactions < Update + attribute :emojis, TD::Types::Array.of(TD::Types::String) + end +end diff --git a/lib/tdlib/types/update/active_live_location_messages.rb b/lib/tdlib/types/update/active_live_location_messages.rb new file mode 100644 index 00000000..b2e0cdfe --- /dev/null +++ b/lib/tdlib/types/update/active_live_location_messages.rb @@ -0,0 +1,9 @@ +module TD::Types + # The list of messages with active live location that need to be updated by the application has changed. + # The list is persistent across application restarts only if the message database is used. + # + # @attr messages [Array] The list of messages with active live locations. + class Update::ActiveLiveLocationMessages < Update + attribute :messages, TD::Types::Array.of(TD::Types::Message) + end +end diff --git a/lib/tdlib/types/update/active_notifications.rb b/lib/tdlib/types/update/active_notifications.rb index 8aa7e53f..e062c6e0 100644 --- a/lib/tdlib/types/update/active_notifications.rb +++ b/lib/tdlib/types/update/active_notifications.rb @@ -1,5 +1,5 @@ module TD::Types - # Contains active notifications that was shown on previous application launches. + # Contains active notifications that were shown on previous application launches. # This update is sent only if the message database is used. # In that case it comes once before any updateNotification and updateNotificationGroup update. # diff --git a/lib/tdlib/types/update/animated_emoji_message_clicked.rb b/lib/tdlib/types/update/animated_emoji_message_clicked.rb new file mode 100644 index 00000000..ddce24ab --- /dev/null +++ b/lib/tdlib/types/update/animated_emoji_message_clicked.rb @@ -0,0 +1,14 @@ +module TD::Types + # Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the + # screen. + # chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_id [Integer] Message identifier. + # @attr sticker [TD::Types::Sticker] The animated sticker to be played. + class Update::AnimatedEmojiMessageClicked < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :sticker, TD::Types::Sticker + end +end diff --git a/lib/tdlib/types/update/animation_search_parameters.rb b/lib/tdlib/types/update/animation_search_parameters.rb index 0eece6d7..f689fc79 100644 --- a/lib/tdlib/types/update/animation_search_parameters.rb +++ b/lib/tdlib/types/update/animation_search_parameters.rb @@ -1,5 +1,5 @@ module TD::Types - # The parameters of animation search through GetOption("animation_search_bot_username") bot has changed. + # The parameters of animation search through getOption("animation_search_bot_username") bot has changed. # # @attr provider [TD::Types::String] Name of the animation search provider. # @attr emojis [Array] The new list of emojis suggested for searching. diff --git a/lib/tdlib/types/update/application_verification_required.rb b/lib/tdlib/types/update/application_verification_required.rb new file mode 100644 index 00000000..a0fe0869 --- /dev/null +++ b/lib/tdlib/types/update/application_verification_required.rb @@ -0,0 +1,15 @@ +module TD::Types + # A request can't be completed unless application verification is performed; for official mobile applications only. + # The method setApplicationVerificationToken must be called once the verification is completed or failed. + # + # @attr verification_id [Integer] Unique identifier for the verification process. + # @attr nonce [TD::Types::String] Unique base64url-encoded nonce for the classic Play Integrity verification + # (https://developer.android.com/google/play/integrity/classic) for Android, or a unique string to compare with + # verify_nonce field from a push notification for iOS. + # @attr cloud_project_number [Integer] Cloud project number to pass to the Play Integrity API on Android. + class Update::ApplicationVerificationRequired < Update + attribute :verification_id, TD::Types::Coercible::Integer + attribute :nonce, TD::Types::String + attribute :cloud_project_number, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/attachment_menu_bots.rb b/lib/tdlib/types/update/attachment_menu_bots.rb new file mode 100644 index 00000000..9ee40da3 --- /dev/null +++ b/lib/tdlib/types/update/attachment_menu_bots.rb @@ -0,0 +1,9 @@ +module TD::Types + # The list of bots added to attachment or side menu has changed. + # + # @attr bots [Array] The new list of bots. + # The bots must not be shown on scheduled messages screen. + class Update::AttachmentMenuBots < Update + attribute :bots, TD::Types::Array.of(TD::Types::AttachmentMenuBot) + end +end diff --git a/lib/tdlib/types/update/autosave_settings.rb b/lib/tdlib/types/update/autosave_settings.rb new file mode 100644 index 00000000..5ad16b09 --- /dev/null +++ b/lib/tdlib/types/update/autosave_settings.rb @@ -0,0 +1,11 @@ +module TD::Types + # Autosave settings for some type of chats were updated. + # + # @attr scope [TD::Types::AutosaveSettingsScope] Type of chats for which autosave settings were updated. + # @attr settings [TD::Types::ScopeAutosaveSettings, nil] The new autosave settings; may be null if the settings are + # reset to default. + class Update::AutosaveSettings < Update + attribute :scope, TD::Types::AutosaveSettingsScope + attribute :settings, TD::Types::ScopeAutosaveSettings.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/available_message_effects.rb b/lib/tdlib/types/update/available_message_effects.rb new file mode 100644 index 00000000..ea681981 --- /dev/null +++ b/lib/tdlib/types/update/available_message_effects.rb @@ -0,0 +1,10 @@ +module TD::Types + # The list of available message effects has changed. + # + # @attr reaction_effect_ids [Array] The new list of available message effects from emoji reactions. + # @attr sticker_effect_ids [Array] The new list of available message effects from Premium stickers. + class Update::AvailableMessageEffects < Update + attribute :reaction_effect_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + attribute :sticker_effect_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/update/basic_group_full_info.rb b/lib/tdlib/types/update/basic_group_full_info.rb index cbb2ea6d..b2ffa517 100644 --- a/lib/tdlib/types/update/basic_group_full_info.rb +++ b/lib/tdlib/types/update/basic_group_full_info.rb @@ -1,5 +1,5 @@ module TD::Types - # Some data from basicGroupFullInfo has been changed. + # Some data in basicGroupFullInfo has been changed. # # @attr basic_group_id [Integer] Identifier of a basic group. # @attr basic_group_full_info [TD::Types::BasicGroupFullInfo] New full information about the group. diff --git a/lib/tdlib/types/update/business_connection.rb b/lib/tdlib/types/update/business_connection.rb new file mode 100644 index 00000000..c41448d9 --- /dev/null +++ b/lib/tdlib/types/update/business_connection.rb @@ -0,0 +1,8 @@ +module TD::Types + # A business connection has changed; for bots only. + # + # @attr connection [TD::Types::BusinessConnection] New data about the connection. + class Update::BusinessConnection < Update + attribute :connection, TD::Types::BusinessConnection + end +end diff --git a/lib/tdlib/types/update/business_message_edited.rb b/lib/tdlib/types/update/business_message_edited.rb new file mode 100644 index 00000000..c103771f --- /dev/null +++ b/lib/tdlib/types/update/business_message_edited.rb @@ -0,0 +1,10 @@ +module TD::Types + # A message in a business account was edited; for bots only. + # + # @attr connection_id [TD::Types::String] Unique identifier of the business connection. + # @attr message [TD::Types::BusinessMessage] The edited message. + class Update::BusinessMessageEdited < Update + attribute :connection_id, TD::Types::String + attribute :message, TD::Types::BusinessMessage + end +end diff --git a/lib/tdlib/types/update/business_messages_deleted.rb b/lib/tdlib/types/update/business_messages_deleted.rb new file mode 100644 index 00000000..c6a2b5fa --- /dev/null +++ b/lib/tdlib/types/update/business_messages_deleted.rb @@ -0,0 +1,12 @@ +module TD::Types + # Messages in a business account were deleted; for bots only. + # + # @attr connection_id [TD::Types::String] Unique identifier of the business connection. + # @attr chat_id [Integer] Identifier of a chat in the business account in which messages were deleted. + # @attr message_ids [Array] Unique message identifiers of the deleted messages. + class Update::BusinessMessagesDeleted < Update + attribute :connection_id, TD::Types::String + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/update/chat_accent_colors.rb b/lib/tdlib/types/update/chat_accent_colors.rb new file mode 100644 index 00000000..be3ad4ab --- /dev/null +++ b/lib/tdlib/types/update/chat_accent_colors.rb @@ -0,0 +1,18 @@ +module TD::Types + # Chat accent colors have changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr accent_color_id [Integer] The new chat accent color identifier. + # @attr background_custom_emoji_id [Integer] The new identifier of a custom emoji to be shown on the reply header and + # link preview background; 0 if none. + # @attr profile_accent_color_id [Integer] The new chat profile accent color identifier; -1 if none. + # @attr profile_background_custom_emoji_id [Integer] The new identifier of a custom emoji to be shown on the profile + # background; 0 if none. + class Update::ChatAccentColors < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :accent_color_id, TD::Types::Coercible::Integer + attribute :background_custom_emoji_id, TD::Types::Coercible::Integer + attribute :profile_accent_color_id, TD::Types::Coercible::Integer + attribute :profile_background_custom_emoji_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/chat_action.rb b/lib/tdlib/types/update/chat_action.rb new file mode 100644 index 00000000..cadf89ac --- /dev/null +++ b/lib/tdlib/types/update/chat_action.rb @@ -0,0 +1,14 @@ +module TD::Types + # A message sender activity in the chat has changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_thread_id [Integer] If not 0, the message thread identifier in which the action was performed. + # @attr sender_id [TD::Types::MessageSender] Identifier of a message sender performing the action. + # @attr action [TD::Types::ChatAction] The action. + class Update::ChatAction < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_thread_id, TD::Types::Coercible::Integer + attribute :sender_id, TD::Types::MessageSender + attribute :action, TD::Types::ChatAction + end +end diff --git a/lib/tdlib/types/update/chat_active_stories.rb b/lib/tdlib/types/update/chat_active_stories.rb new file mode 100644 index 00000000..84ef7c53 --- /dev/null +++ b/lib/tdlib/types/update/chat_active_stories.rb @@ -0,0 +1,8 @@ +module TD::Types + # The list of active stories posted by a specific chat has changed. + # + # @attr active_stories [TD::Types::ChatActiveStories] The new list of active stories. + class Update::ChatActiveStories < Update + attribute :active_stories, TD::Types::ChatActiveStories + end +end diff --git a/lib/tdlib/types/update/chat_added_to_list.rb b/lib/tdlib/types/update/chat_added_to_list.rb new file mode 100644 index 00000000..0612a3e5 --- /dev/null +++ b/lib/tdlib/types/update/chat_added_to_list.rb @@ -0,0 +1,10 @@ +module TD::Types + # A chat was added to a chat list. + # + # @attr chat_id [Integer] Chat identifier. + # @attr chat_list [TD::Types::ChatList] The chat list to which the chat was added. + class Update::ChatAddedToList < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :chat_list, TD::Types::ChatList + end +end diff --git a/lib/tdlib/types/update/chat_available_reactions.rb b/lib/tdlib/types/update/chat_available_reactions.rb new file mode 100644 index 00000000..05f9d6ee --- /dev/null +++ b/lib/tdlib/types/update/chat_available_reactions.rb @@ -0,0 +1,10 @@ +module TD::Types + # The chat available reactions were changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr available_reactions [TD::Types::ChatAvailableReactions] The new reactions, available in the chat. + class Update::ChatAvailableReactions < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :available_reactions, TD::Types::ChatAvailableReactions + end +end diff --git a/lib/tdlib/types/update/chat_background.rb b/lib/tdlib/types/update/chat_background.rb new file mode 100644 index 00000000..680f032d --- /dev/null +++ b/lib/tdlib/types/update/chat_background.rb @@ -0,0 +1,11 @@ +module TD::Types + # The chat background was changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr background [TD::Types::ChatBackground, nil] The new chat background; may be null if background was reset to + # default. + class Update::ChatBackground < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :background, TD::Types::ChatBackground.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_block_list.rb b/lib/tdlib/types/update/chat_block_list.rb new file mode 100644 index 00000000..9eeee7ac --- /dev/null +++ b/lib/tdlib/types/update/chat_block_list.rb @@ -0,0 +1,10 @@ +module TD::Types + # A chat was blocked or unblocked. + # + # @attr chat_id [Integer] Chat identifier. + # @attr block_list [TD::Types::BlockList, nil] Block list to which the chat is added; may be null if none. + class Update::ChatBlockList < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :block_list, TD::Types::BlockList.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_boost.rb b/lib/tdlib/types/update/chat_boost.rb new file mode 100644 index 00000000..263986b1 --- /dev/null +++ b/lib/tdlib/types/update/chat_boost.rb @@ -0,0 +1,10 @@ +module TD::Types + # A chat boost has changed; for bots only. + # + # @attr chat_id [Integer] Chat identifier. + # @attr boost [TD::Types::ChatBoost] New information about the boost. + class Update::ChatBoost < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :boost, TD::Types::ChatBoost + end +end diff --git a/lib/tdlib/types/update/chat_business_bot_manage_bar.rb b/lib/tdlib/types/update/chat_business_bot_manage_bar.rb new file mode 100644 index 00000000..d11a25ed --- /dev/null +++ b/lib/tdlib/types/update/chat_business_bot_manage_bar.rb @@ -0,0 +1,11 @@ +module TD::Types + # The bar for managing business bot was changed in a chat. + # + # @attr chat_id [Integer] Chat identifier. + # @attr business_bot_manage_bar [TD::Types::BusinessBotManageBar, nil] The new value of the business bot manage bar; + # may be null. + class Update::ChatBusinessBotManageBar < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :business_bot_manage_bar, TD::Types::BusinessBotManageBar.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_draft_message.rb b/lib/tdlib/types/update/chat_draft_message.rb index 98c78d57..80b616f4 100644 --- a/lib/tdlib/types/update/chat_draft_message.rb +++ b/lib/tdlib/types/update/chat_draft_message.rb @@ -1,10 +1,10 @@ module TD::Types # A chat draft has changed. # Be aware that the update may come in the currently opened chat but with old content of the draft. - # If the user has changed the content of the draft, this update shouldn't be applied. + # If the user has changed the content of the draft, this update mustn't be applied. # # @attr chat_id [Integer] Chat identifier. - # @attr draft_message [TD::Types::DraftMessage, nil] The new draft message; may be null. + # @attr draft_message [TD::Types::DraftMessage, nil] The new draft message; may be null if none. # @attr positions [Array] The new chat positions in the chat lists. class Update::ChatDraftMessage < Update attribute :chat_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/update/chat_emoji_status.rb b/lib/tdlib/types/update/chat_emoji_status.rb new file mode 100644 index 00000000..ab5a6f7d --- /dev/null +++ b/lib/tdlib/types/update/chat_emoji_status.rb @@ -0,0 +1,10 @@ +module TD::Types + # Chat emoji status has changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr emoji_status [TD::Types::EmojiStatus, nil] The new chat emoji status; may be null. + class Update::ChatEmojiStatus < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :emoji_status, TD::Types::EmojiStatus.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_filters.rb b/lib/tdlib/types/update/chat_filters.rb deleted file mode 100644 index c82358c9..00000000 --- a/lib/tdlib/types/update/chat_filters.rb +++ /dev/null @@ -1,8 +0,0 @@ -module TD::Types - # The list of chat filters or a chat filter has changed. - # - # @attr chat_filters [Array] The new list of chat filters. - class Update::ChatFilters < Update - attribute :chat_filters, TD::Types::Array.of(TD::Types::ChatFilterInfo) - end -end diff --git a/lib/tdlib/types/update/chat_folders.rb b/lib/tdlib/types/update/chat_folders.rb new file mode 100644 index 00000000..eb0f0d6a --- /dev/null +++ b/lib/tdlib/types/update/chat_folders.rb @@ -0,0 +1,12 @@ +module TD::Types + # The list of chat folders or a chat folder has changed. + # + # @attr chat_folders [Array] The new list of chat folders. + # @attr main_chat_list_position [Integer] Position of the main chat list among chat folders, 0-based. + # @attr are_tags_enabled [Boolean] True, if folder tags are enabled. + class Update::ChatFolders < Update + attribute :chat_folders, TD::Types::Array.of(TD::Types::ChatFolderInfo) + attribute :main_chat_list_position, TD::Types::Coercible::Integer + attribute :are_tags_enabled, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/update/chat_has_protected_content.rb b/lib/tdlib/types/update/chat_has_protected_content.rb new file mode 100644 index 00000000..3a1025a4 --- /dev/null +++ b/lib/tdlib/types/update/chat_has_protected_content.rb @@ -0,0 +1,10 @@ +module TD::Types + # A chat content was allowed or restricted for saving. + # + # @attr chat_id [Integer] Chat identifier. + # @attr has_protected_content [Boolean] New value of has_protected_content. + class Update::ChatHasProtectedContent < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :has_protected_content, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/update/chat_is_blocked.rb b/lib/tdlib/types/update/chat_is_blocked.rb deleted file mode 100644 index 53f0039e..00000000 --- a/lib/tdlib/types/update/chat_is_blocked.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # A chat was blocked or unblocked. - # - # @attr chat_id [Integer] Chat identifier. - # @attr is_blocked [Boolean] New value of is_blocked. - class Update::ChatIsBlocked < Update - attribute :chat_id, TD::Types::Coercible::Integer - attribute :is_blocked, TD::Types::Bool - end -end diff --git a/lib/tdlib/types/update/chat_is_translatable.rb b/lib/tdlib/types/update/chat_is_translatable.rb new file mode 100644 index 00000000..23e65a0b --- /dev/null +++ b/lib/tdlib/types/update/chat_is_translatable.rb @@ -0,0 +1,10 @@ +module TD::Types + # Translation of chat messages was enabled or disabled. + # + # @attr chat_id [Integer] Chat identifier. + # @attr is_translatable [Boolean] New value of is_translatable. + class Update::ChatIsTranslatable < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :is_translatable, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/update/chat_last_message.rb b/lib/tdlib/types/update/chat_last_message.rb index 65dd57fe..e757f0c6 100644 --- a/lib/tdlib/types/update/chat_last_message.rb +++ b/lib/tdlib/types/update/chat_last_message.rb @@ -1,10 +1,11 @@ module TD::Types # The last message of a chat was changed. - # If last_message is null, then the last message in the chat became unknown. - # Some new unknown messages might be added to the chat in this case. # # @attr chat_id [Integer] Chat identifier. - # @attr last_message [TD::Types::Message, nil] The new last message in the chat; may be null. + # @attr last_message [TD::Types::Message, nil] The new last message in the chat; may be null if the last message + # became unknown. + # While the last message is unknown, new messages can be added to the chat without corresponding + # {TD::Types::Update::NewMessage} update. # @attr positions [Array] The new chat positions in the chat lists. class Update::ChatLastMessage < Update attribute :chat_id, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/update/chat_member.rb b/lib/tdlib/types/update/chat_member.rb index 10d1f8c0..89d53691 100644 --- a/lib/tdlib/types/update/chat_member.rb +++ b/lib/tdlib/types/update/chat_member.rb @@ -3,9 +3,13 @@ module TD::Types # # @attr chat_id [Integer] Chat identifier. # @attr actor_user_id [Integer] Identifier of the user, changing the rights. - # @attr date [Integer] Point in time (Unix timestamp) when the user rights was changed. + # @attr date [Integer] Point in time (Unix timestamp) when the user rights were changed. # @attr invite_link [TD::Types::ChatInviteLink, nil] If user has joined the chat using an invite link, the invite # link; may be null. + # @attr via_join_request [Boolean] True, if the user has joined the chat after sending a join request and being + # approved by an administrator. + # @attr via_chat_folder_invite_link [Boolean] True, if the user has joined the chat using an invite link for a chat + # folder. # @attr old_chat_member [TD::Types::ChatMember] Previous chat member. # @attr new_chat_member [TD::Types::ChatMember] New chat member. class Update::ChatMember < Update @@ -13,6 +17,8 @@ class Update::ChatMember < Update attribute :actor_user_id, TD::Types::Coercible::Integer attribute :date, TD::Types::Coercible::Integer attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil) + attribute :via_join_request, TD::Types::Bool + attribute :via_chat_folder_invite_link, TD::Types::Bool attribute :old_chat_member, TD::Types::ChatMember attribute :new_chat_member, TD::Types::ChatMember end diff --git a/lib/tdlib/types/update/chat_message_auto_delete_time.rb b/lib/tdlib/types/update/chat_message_auto_delete_time.rb new file mode 100644 index 00000000..7fbe53cd --- /dev/null +++ b/lib/tdlib/types/update/chat_message_auto_delete_time.rb @@ -0,0 +1,10 @@ +module TD::Types + # The message auto-delete or self-destruct timer setting for a chat was changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_auto_delete_time [Integer] New value of message_auto_delete_time. + class Update::ChatMessageAutoDeleteTime < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_auto_delete_time, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/chat_message_sender.rb b/lib/tdlib/types/update/chat_message_sender.rb new file mode 100644 index 00000000..91702a50 --- /dev/null +++ b/lib/tdlib/types/update/chat_message_sender.rb @@ -0,0 +1,11 @@ +module TD::Types + # The message sender that is selected to send messages in a chat has changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_sender_id [TD::Types::MessageSender, nil] New value of message_sender_id; may be null if the user + # can't change message sender. + class Update::ChatMessageSender < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_sender_id, TD::Types::MessageSender.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_message_ttl_setting.rb b/lib/tdlib/types/update/chat_message_ttl_setting.rb deleted file mode 100644 index d60dcada..00000000 --- a/lib/tdlib/types/update/chat_message_ttl_setting.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # The message Time To Live setting for a chat was changed. - # - # @attr chat_id [Integer] Chat identifier. - # @attr message_ttl_setting [Integer] New value of message_ttl_setting. - class Update::ChatMessageTtlSetting < Update - attribute :chat_id, TD::Types::Coercible::Integer - attribute :message_ttl_setting, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/update/chat_online_member_count.rb b/lib/tdlib/types/update/chat_online_member_count.rb index 54a73fad..f9af0cca 100644 --- a/lib/tdlib/types/update/chat_online_member_count.rb +++ b/lib/tdlib/types/update/chat_online_member_count.rb @@ -1,7 +1,7 @@ module TD::Types # The number of online group members has changed. - # This update with non-zero count is sent only for currently opened chats. - # There is no guarantee that it will be sent just after the count has changed. + # This update with non-zero number of online group members is sent only for currently opened chats. + # There is no guarantee that it is sent just after the number of online users has changed. # # @attr chat_id [Integer] Identifier of the chat. # @attr online_member_count [Integer] New number of online members in the chat, or 0 if unknown. diff --git a/lib/tdlib/types/update/chat_pending_join_requests.rb b/lib/tdlib/types/update/chat_pending_join_requests.rb new file mode 100644 index 00000000..95827b0f --- /dev/null +++ b/lib/tdlib/types/update/chat_pending_join_requests.rb @@ -0,0 +1,11 @@ +module TD::Types + # The chat pending join requests were changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr pending_join_requests [TD::Types::ChatJoinRequestsInfo, nil] The new data about pending join requests; may be + # null. + class Update::ChatPendingJoinRequests < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :pending_join_requests, TD::Types::ChatJoinRequestsInfo.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_permissions.rb b/lib/tdlib/types/update/chat_permissions.rb index 682e8bef..fb08d1fb 100644 --- a/lib/tdlib/types/update/chat_permissions.rb +++ b/lib/tdlib/types/update/chat_permissions.rb @@ -1,5 +1,5 @@ module TD::Types - # Chat permissions was changed. + # Chat permissions were changed. # # @attr chat_id [Integer] Chat identifier. # @attr permissions [TD::Types::ChatPermissions] The new chat permissions. diff --git a/lib/tdlib/types/update/chat_position.rb b/lib/tdlib/types/update/chat_position.rb index 8c44c7e1..6bbea9e2 100644 --- a/lib/tdlib/types/update/chat_position.rb +++ b/lib/tdlib/types/update/chat_position.rb @@ -1,6 +1,6 @@ module TD::Types # The position of a chat in a chat list has changed. - # Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent. + # An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update. # # @attr chat_id [Integer] Chat identifier. # @attr position [TD::Types::ChatPosition] New chat position. diff --git a/lib/tdlib/types/update/chat_read_inbox.rb b/lib/tdlib/types/update/chat_read_inbox.rb index d51e5f2c..e6381861 100644 --- a/lib/tdlib/types/update/chat_read_inbox.rb +++ b/lib/tdlib/types/update/chat_read_inbox.rb @@ -1,5 +1,5 @@ module TD::Types - # Incoming messages were read or number of unread messages has been changed. + # Incoming messages were read or the number of unread messages has been changed. # # @attr chat_id [Integer] Chat identifier. # @attr last_read_inbox_message_id [Integer] Identifier of the last read incoming message. diff --git a/lib/tdlib/types/update/chat_removed_from_list.rb b/lib/tdlib/types/update/chat_removed_from_list.rb new file mode 100644 index 00000000..9bedb5dd --- /dev/null +++ b/lib/tdlib/types/update/chat_removed_from_list.rb @@ -0,0 +1,10 @@ +module TD::Types + # A chat was removed from a chat list. + # + # @attr chat_id [Integer] Chat identifier. + # @attr chat_list [TD::Types::ChatList] The chat list from which the chat was removed. + class Update::ChatRemovedFromList < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :chat_list, TD::Types::ChatList + end +end diff --git a/lib/tdlib/types/update/chat_revenue_amount.rb b/lib/tdlib/types/update/chat_revenue_amount.rb new file mode 100644 index 00000000..67d6c313 --- /dev/null +++ b/lib/tdlib/types/update/chat_revenue_amount.rb @@ -0,0 +1,11 @@ +module TD::Types + # The revenue earned from sponsored messages in a chat has changed. + # If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions. + # + # @attr chat_id [Integer] Identifier of the chat. + # @attr revenue_amount [TD::Types::ChatRevenueAmount] New amount of earned revenue. + class Update::ChatRevenueAmount < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :revenue_amount, TD::Types::ChatRevenueAmount + end +end diff --git a/lib/tdlib/types/update/chat_theme.rb b/lib/tdlib/types/update/chat_theme.rb new file mode 100644 index 00000000..b4311c50 --- /dev/null +++ b/lib/tdlib/types/update/chat_theme.rb @@ -0,0 +1,11 @@ +module TD::Types + # The chat theme was changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr theme_name [TD::Types::String, nil] The new name of the chat theme; may be empty if theme was reset to + # default. + class Update::ChatTheme < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :theme_name, TD::Types::String.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/chat_themes.rb b/lib/tdlib/types/update/chat_themes.rb new file mode 100644 index 00000000..375b0416 --- /dev/null +++ b/lib/tdlib/types/update/chat_themes.rb @@ -0,0 +1,8 @@ +module TD::Types + # The list of available chat themes has changed. + # + # @attr chat_themes [Array] The new list of chat themes. + class Update::ChatThemes < Update + attribute :chat_themes, TD::Types::Array.of(TD::Types::ChatTheme) + end +end diff --git a/lib/tdlib/types/update/chat_unread_reaction_count.rb b/lib/tdlib/types/update/chat_unread_reaction_count.rb new file mode 100644 index 00000000..132732b6 --- /dev/null +++ b/lib/tdlib/types/update/chat_unread_reaction_count.rb @@ -0,0 +1,10 @@ +module TD::Types + # The chat unread_reaction_count has changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr unread_reaction_count [Integer] The number of messages with unread reactions left in the chat. + class Update::ChatUnreadReactionCount < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :unread_reaction_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/chat_video_chat.rb b/lib/tdlib/types/update/chat_video_chat.rb new file mode 100644 index 00000000..b75c7427 --- /dev/null +++ b/lib/tdlib/types/update/chat_video_chat.rb @@ -0,0 +1,10 @@ +module TD::Types + # A chat video chat state has changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr video_chat [TD::Types::VideoChat] New value of video_chat. + class Update::ChatVideoChat < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :video_chat, TD::Types::VideoChat + end +end diff --git a/lib/tdlib/types/update/chat_view_as_topics.rb b/lib/tdlib/types/update/chat_view_as_topics.rb new file mode 100644 index 00000000..58001b89 --- /dev/null +++ b/lib/tdlib/types/update/chat_view_as_topics.rb @@ -0,0 +1,10 @@ +module TD::Types + # A chat default appearance has changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr view_as_topics [Boolean] New value of view_as_topics. + class Update::ChatViewAsTopics < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :view_as_topics, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/update/chat_voice_chat.rb b/lib/tdlib/types/update/chat_voice_chat.rb deleted file mode 100644 index da215829..00000000 --- a/lib/tdlib/types/update/chat_voice_chat.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # A chat voice chat state has changed. - # - # @attr chat_id [Integer] Chat identifier. - # @attr voice_chat [TD::Types::VoiceChat] New value of voice_chat. - class Update::ChatVoiceChat < Update - attribute :chat_id, TD::Types::Coercible::Integer - attribute :voice_chat, TD::Types::VoiceChat - end -end diff --git a/lib/tdlib/types/update/contact_close_birthdays.rb b/lib/tdlib/types/update/contact_close_birthdays.rb new file mode 100644 index 00000000..b5689ffc --- /dev/null +++ b/lib/tdlib/types/update/contact_close_birthdays.rb @@ -0,0 +1,8 @@ +module TD::Types + # The list of contacts that had birthdays recently or will have birthday soon has changed. + # + # @attr close_birthday_users [Array] List of contact users with close birthday. + class Update::ContactCloseBirthdays < Update + attribute :close_birthday_users, TD::Types::Array.of(TD::Types::CloseBirthdayUser) + end +end diff --git a/lib/tdlib/types/update/default_background.rb b/lib/tdlib/types/update/default_background.rb new file mode 100644 index 00000000..a6ae1947 --- /dev/null +++ b/lib/tdlib/types/update/default_background.rb @@ -0,0 +1,10 @@ +module TD::Types + # The default background has changed. + # + # @attr for_dark_theme [Boolean] True, if default background for dark theme has changed. + # @attr background [TD::Types::Background, nil] The new default background; may be null. + class Update::DefaultBackground < Update + attribute :for_dark_theme, TD::Types::Bool + attribute :background, TD::Types::Background.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/default_reaction_type.rb b/lib/tdlib/types/update/default_reaction_type.rb new file mode 100644 index 00000000..75aec22e --- /dev/null +++ b/lib/tdlib/types/update/default_reaction_type.rb @@ -0,0 +1,8 @@ +module TD::Types + # The type of default reaction has changed. + # + # @attr reaction_type [TD::Types::ReactionType] The new type of the default reaction. + class Update::DefaultReactionType < Update + attribute :reaction_type, TD::Types::ReactionType + end +end diff --git a/lib/tdlib/types/update/file_added_to_downloads.rb b/lib/tdlib/types/update/file_added_to_downloads.rb new file mode 100644 index 00000000..32a5ad46 --- /dev/null +++ b/lib/tdlib/types/update/file_added_to_downloads.rb @@ -0,0 +1,11 @@ +module TD::Types + # A file was added to the file download list. + # This update is sent only after file download list is loaded for the first time. + # + # @attr file_download [TD::Types::FileDownload] The added file download. + # @attr counts [TD::Types::DownloadedFileCounts] New number of being downloaded and recently downloaded files found. + class Update::FileAddedToDownloads < Update + attribute :file_download, TD::Types::FileDownload + attribute :counts, TD::Types::DownloadedFileCounts + end +end diff --git a/lib/tdlib/types/update/file_download.rb b/lib/tdlib/types/update/file_download.rb new file mode 100644 index 00000000..98d65bf5 --- /dev/null +++ b/lib/tdlib/types/update/file_download.rb @@ -0,0 +1,16 @@ +module TD::Types + # A file download was changed. + # This update is sent only after file download list is loaded for the first time. + # + # @attr file_id [Integer] File identifier. + # @attr complete_date [Integer] Point in time (Unix timestamp) when the file downloading was completed; 0 if the file + # downloading isn't completed. + # @attr is_paused [Boolean] True, if downloading of the file is paused. + # @attr counts [TD::Types::DownloadedFileCounts] New number of being downloaded and recently downloaded files found. + class Update::FileDownload < Update + attribute :file_id, TD::Types::Coercible::Integer + attribute :complete_date, TD::Types::Coercible::Integer + attribute :is_paused, TD::Types::Bool + attribute :counts, TD::Types::DownloadedFileCounts + end +end diff --git a/lib/tdlib/types/update/file_downloads.rb b/lib/tdlib/types/update/file_downloads.rb new file mode 100644 index 00000000..d6dda208 --- /dev/null +++ b/lib/tdlib/types/update/file_downloads.rb @@ -0,0 +1,12 @@ +module TD::Types + # The state of the file download list has changed. + # + # @attr total_size [Integer] Total size of files in the file download list, in bytes. + # @attr total_count [Integer] Total number of files in the file download list. + # @attr downloaded_size [Integer] Total downloaded size of files in the file download list, in bytes. + class Update::FileDownloads < Update + attribute :total_size, TD::Types::Coercible::Integer + attribute :total_count, TD::Types::Coercible::Integer + attribute :downloaded_size, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/file_generation_start.rb b/lib/tdlib/types/update/file_generation_start.rb index 50f71ab9..9affc844 100644 --- a/lib/tdlib/types/update/file_generation_start.rb +++ b/lib/tdlib/types/update/file_generation_start.rb @@ -3,11 +3,11 @@ module TD::Types # # @attr generation_id [Integer] Unique identifier for the generation process. # @attr original_path [TD::Types::String, nil] The path to a file from which a new file is generated; may be empty. - # @attr destination_path [TD::Types::String] The path to a file that should be created and where the new file should - # be generated. + # @attr destination_path [TD::Types::String] The path to a file that must be created and where the new file is + # generated. # @attr conversion [TD::Types::String] String specifying the conversion applied to the original file. - # If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by - # the application. + # If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which must be downloaded by the + # application. class Update::FileGenerationStart < Update attribute :generation_id, TD::Types::Coercible::Integer attribute :original_path, TD::Types::String.optional.default(nil) diff --git a/lib/tdlib/types/update/file_removed_from_downloads.rb b/lib/tdlib/types/update/file_removed_from_downloads.rb new file mode 100644 index 00000000..de0ca678 --- /dev/null +++ b/lib/tdlib/types/update/file_removed_from_downloads.rb @@ -0,0 +1,11 @@ +module TD::Types + # A file was removed from the file download list. + # This update is sent only after file download list is loaded for the first time. + # + # @attr file_id [Integer] File identifier. + # @attr counts [TD::Types::DownloadedFileCounts] New number of being downloaded and recently downloaded files found. + class Update::FileRemovedFromDownloads < Update + attribute :file_id, TD::Types::Coercible::Integer + attribute :counts, TD::Types::DownloadedFileCounts + end +end diff --git a/lib/tdlib/types/update/forum_topic_info.rb b/lib/tdlib/types/update/forum_topic_info.rb new file mode 100644 index 00000000..13eab3d9 --- /dev/null +++ b/lib/tdlib/types/update/forum_topic_info.rb @@ -0,0 +1,10 @@ +module TD::Types + # Basic information about a topic in a forum chat was changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr info [TD::Types::ForumTopicInfo] New information about the topic. + class Update::ForumTopicInfo < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :info, TD::Types::ForumTopicInfo + end +end diff --git a/lib/tdlib/types/update/installed_sticker_sets.rb b/lib/tdlib/types/update/installed_sticker_sets.rb index 20a5aa86..d60d60de 100644 --- a/lib/tdlib/types/update/installed_sticker_sets.rb +++ b/lib/tdlib/types/update/installed_sticker_sets.rb @@ -1,10 +1,10 @@ module TD::Types # The list of installed sticker sets was updated. # - # @attr is_masks [Boolean] True, if the list of installed mask sticker sets was updated. + # @attr sticker_type [TD::Types::StickerType] Type of the affected stickers. # @attr sticker_set_ids [Array] The new list of installed ordinary sticker sets. class Update::InstalledStickerSets < Update - attribute :is_masks, TD::Types::Bool + attribute :sticker_type, TD::Types::StickerType attribute :sticker_set_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) end end diff --git a/lib/tdlib/types/update/language_pack_strings.rb b/lib/tdlib/types/update/language_pack_strings.rb index 7d0da65c..5ff08e8f 100644 --- a/lib/tdlib/types/update/language_pack_strings.rb +++ b/lib/tdlib/types/update/language_pack_strings.rb @@ -3,7 +3,8 @@ module TD::Types # # @attr localization_target [TD::Types::String] Localization target to which the language pack belongs. # @attr language_pack_id [TD::Types::String] Identifier of the updated language pack. - # @attr strings [Array] List of changed language pack strings. + # @attr strings [Array] List of changed language pack strings; empty if all strings + # have changed. class Update::LanguagePackStrings < Update attribute :localization_target, TD::Types::String attribute :language_pack_id, TD::Types::String diff --git a/lib/tdlib/types/update/message_content_opened.rb b/lib/tdlib/types/update/message_content_opened.rb index 3a3594e6..0cdd521f 100644 --- a/lib/tdlib/types/update/message_content_opened.rb +++ b/lib/tdlib/types/update/message_content_opened.rb @@ -1,7 +1,6 @@ module TD::Types # The message content was opened. - # Updates voice note messages to "listened", video note messages to "viewed" and starts the TTL timer for - # self-destructing messages. + # Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer. # # @attr chat_id [Integer] Chat identifier. # @attr message_id [Integer] Message identifier. diff --git a/lib/tdlib/types/update/message_fact_check.rb b/lib/tdlib/types/update/message_fact_check.rb new file mode 100644 index 00000000..9b8338e9 --- /dev/null +++ b/lib/tdlib/types/update/message_fact_check.rb @@ -0,0 +1,12 @@ +module TD::Types + # A fact-check added to a message was changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_id [Integer] Message identifier. + # @attr fact_check [TD::Types::FactCheck] The new fact-check. + class Update::MessageFactCheck < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :fact_check, TD::Types::FactCheck + end +end diff --git a/lib/tdlib/types/update/message_reaction.rb b/lib/tdlib/types/update/message_reaction.rb new file mode 100644 index 00000000..cb7deea3 --- /dev/null +++ b/lib/tdlib/types/update/message_reaction.rb @@ -0,0 +1,18 @@ +module TD::Types + # User changed its reactions on a message with public reactions; for bots only. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_id [Integer] Message identifier. + # @attr actor_id [TD::Types::MessageSender] Identifier of the user or chat that changed reactions. + # @attr date [Integer] Point in time (Unix timestamp) when the reactions were changed. + # @attr old_reaction_types [Array] Old list of chosen reactions. + # @attr new_reaction_types [Array] New list of chosen reactions. + class Update::MessageReaction < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :actor_id, TD::Types::MessageSender + attribute :date, TD::Types::Coercible::Integer + attribute :old_reaction_types, TD::Types::Array.of(TD::Types::ReactionType) + attribute :new_reaction_types, TD::Types::Array.of(TD::Types::ReactionType) + end +end diff --git a/lib/tdlib/types/update/message_reactions.rb b/lib/tdlib/types/update/message_reactions.rb new file mode 100644 index 00000000..fdb29ad2 --- /dev/null +++ b/lib/tdlib/types/update/message_reactions.rb @@ -0,0 +1,14 @@ +module TD::Types + # Reactions added to a message with anonymous reactions have changed; for bots only. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_id [Integer] Message identifier. + # @attr date [Integer] Point in time (Unix timestamp) when the reactions were changed. + # @attr reactions [Array] The list of reactions added to the message. + class Update::MessageReactions < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :date, TD::Types::Coercible::Integer + attribute :reactions, TD::Types::Array.of(TD::Types::MessageReaction) + end +end diff --git a/lib/tdlib/types/update/message_send_acknowledged.rb b/lib/tdlib/types/update/message_send_acknowledged.rb index 34b24cee..f4fb1f40 100644 --- a/lib/tdlib/types/update/message_send_acknowledged.rb +++ b/lib/tdlib/types/update/message_send_acknowledged.rb @@ -1,8 +1,7 @@ module TD::Types # A request to send a message has reached the Telegram server. - # This doesn't mean that the message will be sent successfully or even that the send message request will be - # processed. - # This update will be sent only if the option "use_quick_ack" is set to true. + # This doesn't mean that the message will be sent successfully. + # This update is sent only if the option "use_quick_ack" is set to true. # This update may be sent multiple times for the same message. # # @attr chat_id [Integer] The chat identifier of the sent message. diff --git a/lib/tdlib/types/update/message_send_failed.rb b/lib/tdlib/types/update/message_send_failed.rb index 12617abd..655550da 100644 --- a/lib/tdlib/types/update/message_send_failed.rb +++ b/lib/tdlib/types/update/message_send_failed.rb @@ -3,14 +3,12 @@ module TD::Types # Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be # received instead of this update. # - # @attr message [TD::Types::Message] Contains information about the message which failed to send. + # @attr message [TD::Types::Message] The failed to send message. # @attr old_message_id [Integer] The previous temporary message identifier. - # @attr error_code [Integer] An error code. - # @attr error_message [TD::Types::String] Error message. + # @attr error [TD::Types::Error] The cause of the message sending failure. class Update::MessageSendFailed < Update attribute :message, TD::Types::Message attribute :old_message_id, TD::Types::Coercible::Integer - attribute :error_code, TD::Types::Coercible::Integer - attribute :error_message, TD::Types::String + attribute :error, TD::Types::Error end end diff --git a/lib/tdlib/types/update/message_send_succeeded.rb b/lib/tdlib/types/update/message_send_succeeded.rb index 0e323731..3c681e3f 100644 --- a/lib/tdlib/types/update/message_send_succeeded.rb +++ b/lib/tdlib/types/update/message_send_succeeded.rb @@ -1,7 +1,7 @@ module TD::Types # A message has been successfully sent. # - # @attr message [TD::Types::Message] Information about the sent message. + # @attr message [TD::Types::Message] The sent message. # Usually only the message identifier, date, and content are changed, but almost all other fields can also change. # @attr old_message_id [Integer] The previous temporary message identifier. class Update::MessageSendSucceeded < Update diff --git a/lib/tdlib/types/update/message_unread_reactions.rb b/lib/tdlib/types/update/message_unread_reactions.rb new file mode 100644 index 00000000..0c874d1e --- /dev/null +++ b/lib/tdlib/types/update/message_unread_reactions.rb @@ -0,0 +1,14 @@ +module TD::Types + # The list of unread reactions added to a message was changed. + # + # @attr chat_id [Integer] Chat identifier. + # @attr message_id [Integer] Message identifier. + # @attr unread_reactions [Array] The new list of unread reactions. + # @attr unread_reaction_count [Integer] The new number of messages with unread reactions left in the chat. + class Update::MessageUnreadReactions < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :message_id, TD::Types::Coercible::Integer + attribute :unread_reactions, TD::Types::Array.of(TD::Types::UnreadReaction) + attribute :unread_reaction_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/new_business_callback_query.rb b/lib/tdlib/types/update/new_business_callback_query.rb new file mode 100644 index 00000000..11a7f6ad --- /dev/null +++ b/lib/tdlib/types/update/new_business_callback_query.rb @@ -0,0 +1,18 @@ +module TD::Types + # A new incoming callback query from a business message; for bots only. + # + # @attr id [Integer] Unique query identifier. + # @attr sender_user_id [Integer] Identifier of the user who sent the query. + # @attr connection_id [TD::Types::String] Unique identifier of the business connection. + # @attr message [TD::Types::BusinessMessage] The message from the business account from which the query originated. + # @attr chat_instance [Integer] An identifier uniquely corresponding to the chat a message was sent to. + # @attr payload [TD::Types::CallbackQueryPayload] Query payload. + class Update::NewBusinessCallbackQuery < Update + attribute :id, TD::Types::Coercible::Integer + attribute :sender_user_id, TD::Types::Coercible::Integer + attribute :connection_id, TD::Types::String + attribute :message, TD::Types::BusinessMessage + attribute :chat_instance, TD::Types::Coercible::Integer + attribute :payload, TD::Types::CallbackQueryPayload + end +end diff --git a/lib/tdlib/types/update/new_business_message.rb b/lib/tdlib/types/update/new_business_message.rb new file mode 100644 index 00000000..96120acd --- /dev/null +++ b/lib/tdlib/types/update/new_business_message.rb @@ -0,0 +1,10 @@ +module TD::Types + # A new message was added to a business account; for bots only. + # + # @attr connection_id [TD::Types::String] Unique identifier of the business connection. + # @attr message [TD::Types::BusinessMessage] The new message. + class Update::NewBusinessMessage < Update + attribute :connection_id, TD::Types::String + attribute :message, TD::Types::BusinessMessage + end +end diff --git a/lib/tdlib/types/update/new_callback_query.rb b/lib/tdlib/types/update/new_callback_query.rb index b52d0f26..63e2bdec 100644 --- a/lib/tdlib/types/update/new_callback_query.rb +++ b/lib/tdlib/types/update/new_callback_query.rb @@ -4,7 +4,7 @@ module TD::Types # @attr id [Integer] Unique query identifier. # @attr sender_user_id [Integer] Identifier of the user who sent the query. # @attr chat_id [Integer] Identifier of the chat where the query was sent. - # @attr message_id [Integer] Identifier of the message, from which the query originated. + # @attr message_id [Integer] Identifier of the message from which the query originated. # @attr chat_instance [Integer] Identifier that uniquely corresponds to the chat to which the message was sent. # @attr payload [TD::Types::CallbackQueryPayload] Query payload. class Update::NewCallbackQuery < Update diff --git a/lib/tdlib/types/update/new_chat_join_request.rb b/lib/tdlib/types/update/new_chat_join_request.rb new file mode 100644 index 00000000..5acca980 --- /dev/null +++ b/lib/tdlib/types/update/new_chat_join_request.rb @@ -0,0 +1,15 @@ +module TD::Types + # A user sent a join request to a chat; for bots only. + # + # @attr chat_id [Integer] Chat identifier. + # @attr request [TD::Types::ChatJoinRequest] Join request. + # @attr user_chat_id [Integer] Chat identifier of the private chat with the user. + # @attr invite_link [TD::Types::ChatInviteLink, nil] The invite link, which was used to send join request; may be + # null. + class Update::NewChatJoinRequest < Update + attribute :chat_id, TD::Types::Coercible::Integer + attribute :request, TD::Types::ChatJoinRequest + attribute :user_chat_id, TD::Types::Coercible::Integer + attribute :invite_link, TD::Types::ChatInviteLink.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/new_inline_callback_query.rb b/lib/tdlib/types/update/new_inline_callback_query.rb index dc1c1672..16129043 100644 --- a/lib/tdlib/types/update/new_inline_callback_query.rb +++ b/lib/tdlib/types/update/new_inline_callback_query.rb @@ -3,7 +3,7 @@ module TD::Types # # @attr id [Integer] Unique query identifier. # @attr sender_user_id [Integer] Identifier of the user who sent the query. - # @attr inline_message_id [TD::Types::String] Identifier of the inline message, from which the query originated. + # @attr inline_message_id [TD::Types::String] Identifier of the inline message from which the query originated. # @attr chat_instance [Integer] An identifier uniquely corresponding to the chat a message was sent to. # @attr payload [TD::Types::CallbackQueryPayload] Query payload. class Update::NewInlineCallbackQuery < Update diff --git a/lib/tdlib/types/update/new_inline_query.rb b/lib/tdlib/types/update/new_inline_query.rb index 29a580cb..f2c45bbe 100644 --- a/lib/tdlib/types/update/new_inline_query.rb +++ b/lib/tdlib/types/update/new_inline_query.rb @@ -4,8 +4,8 @@ module TD::Types # @attr id [Integer] Unique query identifier. # @attr sender_user_id [Integer] Identifier of the user who sent the query. # @attr user_location [TD::Types::Location, nil] User location; may be null. - # @attr chat_type [TD::Types::ChatType, nil] Contains information about the type of the chat, from which the query - # originated; may be null if unknown. + # @attr chat_type [TD::Types::ChatType, nil] The type of the chat from which the query originated; may be null if + # unknown. # @attr query [TD::Types::String] Text of the query. # @attr offset [TD::Types::String] Offset of the first entry to return. class Update::NewInlineQuery < Update diff --git a/lib/tdlib/types/update/notification_group.rb b/lib/tdlib/types/update/notification_group.rb index 3a70431a..bb6d59c5 100644 --- a/lib/tdlib/types/update/notification_group.rb +++ b/lib/tdlib/types/update/notification_group.rb @@ -6,19 +6,19 @@ module TD::Types # @attr chat_id [Integer] Identifier of a chat to which all notifications in the group belong. # @attr notification_settings_chat_id [Integer] Chat identifier, which notification settings must be applied to the # added notifications. - # @attr is_silent [Boolean] True, if the notifications should be shown without sound. + # @attr notification_sound_id [Integer] Identifier of the notification sound to be played; 0 if sound is disabled. # @attr total_count [Integer] Total number of unread notifications in the group, can be bigger than number of active # notifications. # @attr added_notifications [Array] List of added group notifications, sorted by - # notification ID. + # notification identifier. # @attr removed_notification_ids [Array] Identifiers of removed group notifications, sorted by notification - # ID. + # identifier. class Update::NotificationGroup < Update attribute :notification_group_id, TD::Types::Coercible::Integer attribute :type, TD::Types::NotificationGroupType attribute :chat_id, TD::Types::Coercible::Integer attribute :notification_settings_chat_id, TD::Types::Coercible::Integer - attribute :is_silent, TD::Types::Bool + attribute :notification_sound_id, TD::Types::Coercible::Integer attribute :total_count, TD::Types::Coercible::Integer attribute :added_notifications, TD::Types::Array.of(TD::Types::Notification) attribute :removed_notification_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) diff --git a/lib/tdlib/types/update/owned_star_count.rb b/lib/tdlib/types/update/owned_star_count.rb new file mode 100644 index 00000000..5d1e7b3d --- /dev/null +++ b/lib/tdlib/types/update/owned_star_count.rb @@ -0,0 +1,8 @@ +module TD::Types + # The number of Telegram Stars owned by the current user has changed. + # + # @attr star_count [Integer] The new number of Telegram Stars owned. + class Update::OwnedStarCount < Update + attribute :star_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/poll_answer.rb b/lib/tdlib/types/update/poll_answer.rb index 90103384..7f6a9c9d 100644 --- a/lib/tdlib/types/update/poll_answer.rb +++ b/lib/tdlib/types/update/poll_answer.rb @@ -2,11 +2,11 @@ module TD::Types # A user changed the answer to a poll; for bots only. # # @attr poll_id [Integer] Unique poll identifier. - # @attr user_id [Integer] The user, who changed the answer to the poll. + # @attr voter_id [TD::Types::MessageSender] Identifier of the message sender that changed the answer to the poll. # @attr option_ids [Array] 0-based identifiers of answer options, chosen by the user. class Update::PollAnswer < Update attribute :poll_id, TD::Types::Coercible::Integer - attribute :user_id, TD::Types::Coercible::Integer + attribute :voter_id, TD::Types::MessageSender attribute :option_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) end end diff --git a/lib/tdlib/types/update/profile_accent_colors.rb b/lib/tdlib/types/update/profile_accent_colors.rb new file mode 100644 index 00000000..993830a7 --- /dev/null +++ b/lib/tdlib/types/update/profile_accent_colors.rb @@ -0,0 +1,12 @@ +module TD::Types + # The list of supported accent colors for user profiles has changed. + # + # @attr colors [Array] Information about supported colors. + # @attr available_accent_color_ids [Array] The list of accent color identifiers, which can be set through + # setProfileAccentColor and setChatProfileAccentColor. + # The colors must be shown in the specififed order. + class Update::ProfileAccentColors < Update + attribute :colors, TD::Types::Array.of(TD::Types::ProfileAccentColor) + attribute :available_accent_color_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/update/quick_reply_shortcut.rb b/lib/tdlib/types/update/quick_reply_shortcut.rb new file mode 100644 index 00000000..ec2ad62c --- /dev/null +++ b/lib/tdlib/types/update/quick_reply_shortcut.rb @@ -0,0 +1,9 @@ +module TD::Types + # Basic information about a quick reply shortcut has changed. + # This update is guaranteed to come before the quick shortcut name is returned to the application. + # + # @attr shortcut [TD::Types::QuickReplyShortcut] New data about the shortcut. + class Update::QuickReplyShortcut < Update + attribute :shortcut, TD::Types::QuickReplyShortcut + end +end diff --git a/lib/tdlib/types/update/quick_reply_shortcut_deleted.rb b/lib/tdlib/types/update/quick_reply_shortcut_deleted.rb new file mode 100644 index 00000000..48cf123f --- /dev/null +++ b/lib/tdlib/types/update/quick_reply_shortcut_deleted.rb @@ -0,0 +1,8 @@ +module TD::Types + # A quick reply shortcut and all its messages were deleted. + # + # @attr shortcut_id [Integer] The identifier of the deleted shortcut. + class Update::QuickReplyShortcutDeleted < Update + attribute :shortcut_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/quick_reply_shortcut_messages.rb b/lib/tdlib/types/update/quick_reply_shortcut_messages.rb new file mode 100644 index 00000000..19b5448f --- /dev/null +++ b/lib/tdlib/types/update/quick_reply_shortcut_messages.rb @@ -0,0 +1,11 @@ +module TD::Types + # The list of quick reply shortcut messages has changed. + # + # @attr shortcut_id [Integer] The identifier of the shortcut. + # @attr messages [Array] The new list of quick reply messages for the shortcut in order + # from the first to the last sent. + class Update::QuickReplyShortcutMessages < Update + attribute :shortcut_id, TD::Types::Coercible::Integer + attribute :messages, TD::Types::Array.of(TD::Types::QuickReplyMessage) + end +end diff --git a/lib/tdlib/types/update/quick_reply_shortcuts.rb b/lib/tdlib/types/update/quick_reply_shortcuts.rb new file mode 100644 index 00000000..101a9f5a --- /dev/null +++ b/lib/tdlib/types/update/quick_reply_shortcuts.rb @@ -0,0 +1,8 @@ +module TD::Types + # The list of quick reply shortcuts has changed. + # + # @attr shortcut_ids [Array] The new list of identifiers of quick reply shortcuts. + class Update::QuickReplyShortcuts < Update + attribute :shortcut_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/update/reaction_notification_settings.rb b/lib/tdlib/types/update/reaction_notification_settings.rb new file mode 100644 index 00000000..9642356d --- /dev/null +++ b/lib/tdlib/types/update/reaction_notification_settings.rb @@ -0,0 +1,8 @@ +module TD::Types + # Notification settings for reactions were updated. + # + # @attr notification_settings [TD::Types::ReactionNotificationSettings] The new notification settings. + class Update::ReactionNotificationSettings < Update + attribute :notification_settings, TD::Types::ReactionNotificationSettings + end +end diff --git a/lib/tdlib/types/update/recent_stickers.rb b/lib/tdlib/types/update/recent_stickers.rb index 217b22b0..92ad69ce 100644 --- a/lib/tdlib/types/update/recent_stickers.rb +++ b/lib/tdlib/types/update/recent_stickers.rb @@ -1,7 +1,7 @@ module TD::Types # The list of recently used stickers was updated. # - # @attr is_attached [Boolean] True, if the list of stickers attached to photo or video files was updated, otherwise + # @attr is_attached [Boolean] True, if the list of stickers attached to photo or video files was updated; otherwise, # the list of sent stickers is updated. # @attr sticker_ids [Array] The new list of file identifiers of recently used stickers. class Update::RecentStickers < Update diff --git a/lib/tdlib/types/update/saved_messages_tags.rb b/lib/tdlib/types/update/saved_messages_tags.rb new file mode 100644 index 00000000..63a70166 --- /dev/null +++ b/lib/tdlib/types/update/saved_messages_tags.rb @@ -0,0 +1,11 @@ +module TD::Types + # Tags used in Saved Messages or a Saved Messages topic have changed. + # + # @attr saved_messages_topic_id [Integer] Identifier of Saved Messages topic which tags were changed; 0 if tags for + # the whole chat has changed. + # @attr tags [TD::Types::SavedMessagesTags] The new tags. + class Update::SavedMessagesTags < Update + attribute :saved_messages_topic_id, TD::Types::Coercible::Integer + attribute :tags, TD::Types::SavedMessagesTags + end +end diff --git a/lib/tdlib/types/update/saved_messages_topic.rb b/lib/tdlib/types/update/saved_messages_topic.rb new file mode 100644 index 00000000..9937f060 --- /dev/null +++ b/lib/tdlib/types/update/saved_messages_topic.rb @@ -0,0 +1,9 @@ +module TD::Types + # Basic information about a Saved Messages topic has changed. + # This update is guaranteed to come before the topic identifier is returned to the application. + # + # @attr topic [TD::Types::SavedMessagesTopic] New data about the topic. + class Update::SavedMessagesTopic < Update + attribute :topic, TD::Types::SavedMessagesTopic + end +end diff --git a/lib/tdlib/types/update/saved_messages_topic_count.rb b/lib/tdlib/types/update/saved_messages_topic_count.rb new file mode 100644 index 00000000..d11b392b --- /dev/null +++ b/lib/tdlib/types/update/saved_messages_topic_count.rb @@ -0,0 +1,8 @@ +module TD::Types + # Number of Saved Messages topics has changed. + # + # @attr topic_count [Integer] Approximate total number of Saved Messages topics. + class Update::SavedMessagesTopicCount < Update + attribute :topic_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/saved_notification_sounds.rb b/lib/tdlib/types/update/saved_notification_sounds.rb new file mode 100644 index 00000000..225c7aa1 --- /dev/null +++ b/lib/tdlib/types/update/saved_notification_sounds.rb @@ -0,0 +1,9 @@ +module TD::Types + # The list of saved notification sounds was updated. + # This update may not be sent until information about a notification sound was requested for the first time. + # + # @attr notification_sound_ids [Array] The new list of identifiers of saved notification sounds. + class Update::SavedNotificationSounds < Update + attribute :notification_sound_ids, TD::Types::Array.of(TD::Types::Coercible::Integer) + end +end diff --git a/lib/tdlib/types/update/selected_background.rb b/lib/tdlib/types/update/selected_background.rb deleted file mode 100644 index bff27d4c..00000000 --- a/lib/tdlib/types/update/selected_background.rb +++ /dev/null @@ -1,10 +0,0 @@ -module TD::Types - # The selected background has changed. - # - # @attr for_dark_theme [Boolean] True, if background for dark theme has changed. - # @attr background [TD::Types::Background, nil] The new selected background; may be null. - class Update::SelectedBackground < Update - attribute :for_dark_theme, TD::Types::Bool - attribute :background, TD::Types::Background.optional.default(nil) - end -end diff --git a/lib/tdlib/types/update/service_notification.rb b/lib/tdlib/types/update/service_notification.rb index f9ba714b..d22a482d 100644 --- a/lib/tdlib/types/update/service_notification.rb +++ b/lib/tdlib/types/update/service_notification.rb @@ -1,10 +1,10 @@ module TD::Types - # Service notification from the server. + # A service notification from the server was received. # Upon receiving this the application must show a popup with the content of the notification. # # @attr type [TD::Types::String] Notification type. - # If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" should be shown under notification; - # if user presses the second, all local data should be destroyed using Destroy method. + # If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; + # if user presses the second, all local data must be destroyed using Destroy method. # @attr content [TD::Types::MessageContent] Notification content. class Update::ServiceNotification < Update attribute :type, TD::Types::String diff --git a/lib/tdlib/types/update/speech_recognition_trial.rb b/lib/tdlib/types/update/speech_recognition_trial.rb new file mode 100644 index 00000000..5526b514 --- /dev/null +++ b/lib/tdlib/types/update/speech_recognition_trial.rb @@ -0,0 +1,16 @@ +module TD::Types + # The parameters of speech recognition without Telegram Premium subscription has changed. + # + # @attr max_media_duration [Integer] The maximum allowed duration of media for speech recognition without Telegram + # Premium subscription, in seconds. + # @attr weekly_count [Integer] The total number of allowed speech recognitions per week; 0 if none. + # @attr left_count [Integer] Number of left speech recognition attempts this week. + # @attr next_reset_date [Integer] Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if + # unknown. + class Update::SpeechRecognitionTrial < Update + attribute :max_media_duration, TD::Types::Coercible::Integer + attribute :weekly_count, TD::Types::Coercible::Integer + attribute :left_count, TD::Types::Coercible::Integer + attribute :next_reset_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/speed_limit_notification.rb b/lib/tdlib/types/update/speed_limit_notification.rb new file mode 100644 index 00000000..43d1ee00 --- /dev/null +++ b/lib/tdlib/types/update/speed_limit_notification.rb @@ -0,0 +1,11 @@ +module TD::Types + # Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. + # The notification can be postponed until a being downloaded or uploaded file is visible to the user Use + # getOption("premium_download_speedup") or getOption("premium_upload_speedup") to get expected speedup after subscription + # to Telegram Premium. + # + # @attr is_upload [Boolean] True, if upload speed was limited; false, if download speed was limited. + class Update::SpeedLimitNotification < Update + attribute :is_upload, TD::Types::Bool + end +end diff --git a/lib/tdlib/types/update/star_revenue_status.rb b/lib/tdlib/types/update/star_revenue_status.rb new file mode 100644 index 00000000..077b9dea --- /dev/null +++ b/lib/tdlib/types/update/star_revenue_status.rb @@ -0,0 +1,12 @@ +module TD::Types + # The Telegram Star revenue earned by a bot or a chat has changed. + # If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new + # transactions. + # + # @attr owner_id [TD::Types::MessageSender] Identifier of the owner of the Telegram Stars. + # @attr status [TD::Types::StarRevenueStatus] New Telegram Star revenue status. + class Update::StarRevenueStatus < Update + attribute :owner_id, TD::Types::MessageSender + attribute :status, TD::Types::StarRevenueStatus + end +end diff --git a/lib/tdlib/types/update/story.rb b/lib/tdlib/types/update/story.rb new file mode 100644 index 00000000..e9e6b5c7 --- /dev/null +++ b/lib/tdlib/types/update/story.rb @@ -0,0 +1,8 @@ +module TD::Types + # A story was changed. + # + # @attr story [TD::Types::Story] The new information about the story. + class Update::Story < Update + attribute :story, TD::Types::Story + end +end diff --git a/lib/tdlib/types/update/story_deleted.rb b/lib/tdlib/types/update/story_deleted.rb new file mode 100644 index 00000000..ab39fb1a --- /dev/null +++ b/lib/tdlib/types/update/story_deleted.rb @@ -0,0 +1,10 @@ +module TD::Types + # A story became inaccessible. + # + # @attr story_sender_chat_id [Integer] Identifier of the chat that posted the story. + # @attr story_id [Integer] Story identifier. + class Update::StoryDeleted < Update + attribute :story_sender_chat_id, TD::Types::Coercible::Integer + attribute :story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/story_list_chat_count.rb b/lib/tdlib/types/update/story_list_chat_count.rb new file mode 100644 index 00000000..4ac15fab --- /dev/null +++ b/lib/tdlib/types/update/story_list_chat_count.rb @@ -0,0 +1,10 @@ +module TD::Types + # Number of chats in a story list has changed. + # + # @attr story_list [TD::Types::StoryList] The story list. + # @attr chat_count [Integer] Approximate total number of chats with active stories in the list. + class Update::StoryListChatCount < Update + attribute :story_list, TD::Types::StoryList + attribute :chat_count, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/story_send_failed.rb b/lib/tdlib/types/update/story_send_failed.rb new file mode 100644 index 00000000..abb78e4b --- /dev/null +++ b/lib/tdlib/types/update/story_send_failed.rb @@ -0,0 +1,13 @@ +module TD::Types + # A story failed to send. + # If the story sending is canceled, then updateStoryDeleted will be received instead of this update. + # + # @attr story [TD::Types::Story] The failed to send story. + # @attr error [TD::Types::Error] The cause of the story sending failure. + # @attr error_type [TD::Types::CanSendStoryResult, nil] Type of the error; may be null if unknown. + class Update::StorySendFailed < Update + attribute :story, TD::Types::Story + attribute :error, TD::Types::Error + attribute :error_type, TD::Types::CanSendStoryResult.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/story_send_succeeded.rb b/lib/tdlib/types/update/story_send_succeeded.rb new file mode 100644 index 00000000..d10a0349 --- /dev/null +++ b/lib/tdlib/types/update/story_send_succeeded.rb @@ -0,0 +1,10 @@ +module TD::Types + # A story has been successfully sent. + # + # @attr story [TD::Types::Story] The sent story. + # @attr old_story_id [Integer] The previous temporary story identifier. + class Update::StorySendSucceeded < Update + attribute :story, TD::Types::Story + attribute :old_story_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/story_stealth_mode.rb b/lib/tdlib/types/update/story_stealth_mode.rb new file mode 100644 index 00000000..cde1926d --- /dev/null +++ b/lib/tdlib/types/update/story_stealth_mode.rb @@ -0,0 +1,11 @@ +module TD::Types + # Story stealth mode settings have changed. + # + # @attr active_until_date [Integer] Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled. + # @attr cooldown_until_date [Integer] Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if + # there is no active cooldown. + class Update::StoryStealthMode < Update + attribute :active_until_date, TD::Types::Coercible::Integer + attribute :cooldown_until_date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/update/supergroup_full_info.rb b/lib/tdlib/types/update/supergroup_full_info.rb index 17307918..5dbc367c 100644 --- a/lib/tdlib/types/update/supergroup_full_info.rb +++ b/lib/tdlib/types/update/supergroup_full_info.rb @@ -1,5 +1,5 @@ module TD::Types - # Some data from supergroupFullInfo has been changed. + # Some data in supergroupFullInfo has been changed. # # @attr supergroup_id [Integer] Identifier of the supergroup or channel. # @attr supergroup_full_info [TD::Types::SupergroupFullInfo] New full information about the supergroup. diff --git a/lib/tdlib/types/update/terms_of_service.rb b/lib/tdlib/types/update/terms_of_service.rb index 9d6fd5de..845fb8ed 100644 --- a/lib/tdlib/types/update/terms_of_service.rb +++ b/lib/tdlib/types/update/terms_of_service.rb @@ -1,6 +1,6 @@ module TD::Types # New terms of service must be accepted by the user. - # If the terms of service are declined, then the deleteAccount method should be called with the reason "Decline ToS + # If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS # update". # # @attr terms_of_service_id [TD::Types::String] Identifier of the terms of service. diff --git a/lib/tdlib/types/update/trending_sticker_sets.rb b/lib/tdlib/types/update/trending_sticker_sets.rb index 030f9a15..a0e5dc8c 100644 --- a/lib/tdlib/types/update/trending_sticker_sets.rb +++ b/lib/tdlib/types/update/trending_sticker_sets.rb @@ -1,9 +1,11 @@ module TD::Types # The list of trending sticker sets was updated or some of them were viewed. # - # @attr sticker_sets [TD::Types::StickerSets] The prefix of the list of trending sticker sets with the newest + # @attr sticker_type [TD::Types::StickerType] Type of the affected stickers. + # @attr sticker_sets [TD::Types::TrendingStickerSets] The prefix of the list of trending sticker sets with the newest # trending sticker sets. class Update::TrendingStickerSets < Update - attribute :sticker_sets, TD::Types::StickerSets + attribute :sticker_type, TD::Types::StickerType + attribute :sticker_sets, TD::Types::TrendingStickerSets end end diff --git a/lib/tdlib/types/update/unconfirmed_session.rb b/lib/tdlib/types/update/unconfirmed_session.rb new file mode 100644 index 00000000..6c8cb2c1 --- /dev/null +++ b/lib/tdlib/types/update/unconfirmed_session.rb @@ -0,0 +1,8 @@ +module TD::Types + # The first unconfirmed session has changed. + # + # @attr session [TD::Types::UnconfirmedSession, nil] The unconfirmed session; may be null if none. + class Update::UnconfirmedSession < Update + attribute :session, TD::Types::UnconfirmedSession.optional.default(nil) + end +end diff --git a/lib/tdlib/types/update/user_chat_action.rb b/lib/tdlib/types/update/user_chat_action.rb deleted file mode 100644 index c6f7963e..00000000 --- a/lib/tdlib/types/update/user_chat_action.rb +++ /dev/null @@ -1,14 +0,0 @@ -module TD::Types - # User activity in the chat has changed. - # - # @attr chat_id [Integer] Chat identifier. - # @attr message_thread_id [Integer] If not 0, a message thread identifier in which the action was performed. - # @attr user_id [Integer] Identifier of a user performing an action. - # @attr action [TD::Types::ChatAction] The action description. - class Update::UserChatAction < Update - attribute :chat_id, TD::Types::Coercible::Integer - attribute :message_thread_id, TD::Types::Coercible::Integer - attribute :user_id, TD::Types::Coercible::Integer - attribute :action, TD::Types::ChatAction - end -end diff --git a/lib/tdlib/types/update/user_full_info.rb b/lib/tdlib/types/update/user_full_info.rb index 41edc81e..e8beda1f 100644 --- a/lib/tdlib/types/update/user_full_info.rb +++ b/lib/tdlib/types/update/user_full_info.rb @@ -1,5 +1,5 @@ module TD::Types - # Some data from userFullInfo has been changed. + # Some data in userFullInfo has been changed. # # @attr user_id [Integer] User identifier. # @attr user_full_info [TD::Types::UserFullInfo] New full information about the user. diff --git a/lib/tdlib/types/update/web_app_message_sent.rb b/lib/tdlib/types/update/web_app_message_sent.rb new file mode 100644 index 00000000..23e8f058 --- /dev/null +++ b/lib/tdlib/types/update/web_app_message_sent.rb @@ -0,0 +1,8 @@ +module TD::Types + # A message was sent by an opened Web App, so the Web App needs to be closed. + # + # @attr web_app_launch_id [Integer] Identifier of Web App launch. + class Update::WebAppMessageSent < Update + attribute :web_app_launch_id, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/user.rb b/lib/tdlib/types/user.rb index 4263f4f3..6b554086 100644 --- a/lib/tdlib/types/user.rb +++ b/lib/tdlib/types/user.rb @@ -4,41 +4,76 @@ module TD::Types # @attr id [Integer] User identifier. # @attr first_name [TD::Types::String] First name of the user. # @attr last_name [TD::Types::String] Last name of the user. - # @attr username [TD::Types::String] Username of the user. + # @attr usernames [TD::Types::Usernames, nil] Usernames of the user; may be null. # @attr phone_number [TD::Types::String] Phone number of the user. # @attr status [TD::Types::UserStatus] Current online status of the user. # @attr profile_photo [TD::Types::ProfilePhoto, nil] Profile photo of the user; may be null. + # @attr accent_color_id [Integer] Identifier of the accent color for name, and backgrounds of profile photo, reply + # header, and link preview. + # For Telegram Premium users only. + # @attr background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the reply header and link + # preview background; 0 if none. + # For Telegram Premium users only. + # @attr profile_accent_color_id [Integer] Identifier of the accent color for the user's profile; -1 if none. + # For Telegram Premium users only. + # @attr profile_background_custom_emoji_id [Integer] Identifier of a custom emoji to be shown on the background of + # the user's profile; 0 if none. + # For Telegram Premium users only. + # @attr emoji_status [TD::Types::EmojiStatus, nil] Emoji status to be shown instead of the default Telegram Premium + # badge; may be null. + # For Telegram Premium users only. # @attr is_contact [Boolean] The user is a contact of the current user. # @attr is_mutual_contact [Boolean] The user is a contact of the current user and the current user is a contact of # the user. + # @attr is_close_friend [Boolean] The user is a close friend of the current user; implies that the user is a contact. # @attr is_verified [Boolean] True, if the user is verified. + # @attr is_premium [Boolean] True, if the user is a Telegram Premium user. # @attr is_support [Boolean] True, if the user is Telegram support account. # @attr restriction_reason [TD::Types::String] If non-empty, it contains a human-readable description of the reason # why access to this user must be restricted. # @attr is_scam [Boolean] True, if many users reported this user as a scam. # @attr is_fake [Boolean] True, if many users reported this user as a fake account. + # @attr has_active_stories [Boolean] True, if the user has non-expired stories available to the current user. + # @attr has_unread_active_stories [Boolean] True, if the user has unread non-expired stories available to the current + # user. + # @attr restricts_new_chats [Boolean] True, if the user may restrict new chats with non-contacts. + # Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with + # them. # @attr have_access [Boolean] If false, the user is inaccessible, and the only information known about the user is # inside this class. - # It can't be passed to any method except GetUser. + # Identifier of the user can't be passed to any method. # @attr type [TD::Types::UserType] Type of the user. # @attr language_code [TD::Types::String] IETF language tag of the user's language; only available to bots. + # @attr added_to_attachment_menu [Boolean] True, if the user added the current bot to attachment menu; only available + # to bots. class User < Base attribute :id, TD::Types::Coercible::Integer attribute :first_name, TD::Types::String attribute :last_name, TD::Types::String - attribute :username, TD::Types::String + attribute :usernames, TD::Types::Usernames.optional.default(nil) attribute :phone_number, TD::Types::String attribute :status, TD::Types::UserStatus attribute :profile_photo, TD::Types::ProfilePhoto.optional.default(nil) + attribute :accent_color_id, TD::Types::Coercible::Integer + attribute :background_custom_emoji_id, TD::Types::Coercible::Integer + attribute :profile_accent_color_id, TD::Types::Coercible::Integer + attribute :profile_background_custom_emoji_id, TD::Types::Coercible::Integer + attribute :emoji_status, TD::Types::EmojiStatus.optional.default(nil) attribute :is_contact, TD::Types::Bool attribute :is_mutual_contact, TD::Types::Bool + attribute :is_close_friend, TD::Types::Bool attribute :is_verified, TD::Types::Bool + attribute :is_premium, TD::Types::Bool attribute :is_support, TD::Types::Bool attribute :restriction_reason, TD::Types::String attribute :is_scam, TD::Types::Bool attribute :is_fake, TD::Types::Bool + attribute :has_active_stories, TD::Types::Bool + attribute :has_unread_active_stories, TD::Types::Bool + attribute :restricts_new_chats, TD::Types::Bool attribute :have_access, TD::Types::Bool attribute :type, TD::Types::UserType attribute :language_code, TD::Types::String + attribute :added_to_attachment_menu, TD::Types::Bool end end diff --git a/lib/tdlib/types/user_full_info.rb b/lib/tdlib/types/user_full_info.rb index b0092683..3351c371 100644 --- a/lib/tdlib/types/user_full_info.rb +++ b/lib/tdlib/types/user_full_info.rb @@ -1,28 +1,65 @@ module TD::Types # Contains full information about a user. # + # @attr personal_photo [TD::Types::ChatPhoto, nil] User profile photo set by the current user for the contact; may be + # null. + # If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. + # If non-null, then it is the same photo as in user.profile_photo and chat.photo. + # This photo isn't returned in the list of user photos. # @attr photo [TD::Types::ChatPhoto, nil] User profile photo; may be null. - # @attr is_blocked [Boolean] True, if the user is blocked by the current user. + # If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. + # If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo. + # @attr public_photo [TD::Types::ChatPhoto, nil] User profile photo visible if the main photo is hidden by privacy + # settings; may be null. + # If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. + # If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and + # chat.photo. + # This photo isn't returned in the list of user photos. + # @attr block_list [TD::Types::BlockList, nil] Block list to which the user is added; may be null if none. # @attr can_be_called [Boolean] True, if the user can be called. # @attr supports_video_calls [Boolean] True, if a video call can be created with the user. # @attr has_private_calls [Boolean] True, if the user can't be called due to their privacy settings. + # @attr has_private_forwards [Boolean] True, if the user can't be linked in forwarded messages due to their privacy + # settings. + # @attr has_restricted_voice_and_video_note_messages [Boolean] True, if voice and video notes can't be sent or + # forwarded to the user. + # @attr has_posted_to_profile_stories [Boolean] True, if the user has posted to profile stories. + # @attr has_sponsored_messages_enabled [Boolean] True, if the user always enabled sponsored messages; known only for + # the current user. # @attr need_phone_number_privacy_exception [Boolean] True, if the current user needs to explicitly allow to share # their phone number with the user when the method addContact is used. - # @attr bio [TD::Types::String] A short user bio. - # @attr share_text [TD::Types::String] For bots, the text that is included with the link when users share the bot. + # @attr set_chat_background [Boolean] True, if the user set chat background for both chat users and it wasn't + # reverted yet. + # @attr bio [TD::Types::FormattedText, nil] A short user bio; may be null for bots. + # @attr birthdate [TD::Types::Birthdate, nil] Birthdate of the user; may be null if unknown. + # @attr personal_chat_id [Integer] Identifier of the personal chat of the user; 0 if none. + # @attr premium_gift_options [Array] The list of available options for gifting + # Telegram Premium to the user. # @attr group_in_common_count [Integer] Number of group chats where both the other user and the current user are a # member; 0 for the current user. - # @attr bot_info [TD::Types::BotInfo, nil] If the user is a bot, information about the bot; may be null. + # @attr business_info [TD::Types::BusinessInfo, nil] Information about business settings for Telegram Business + # accounts; may be null if none. + # @attr bot_info [TD::Types::BotInfo, nil] For bots, information about the bot; may be null if the user isn't a bot. class UserFullInfo < Base + attribute :personal_photo, TD::Types::ChatPhoto.optional.default(nil) attribute :photo, TD::Types::ChatPhoto.optional.default(nil) - attribute :is_blocked, TD::Types::Bool + attribute :public_photo, TD::Types::ChatPhoto.optional.default(nil) + attribute :block_list, TD::Types::BlockList.optional.default(nil) attribute :can_be_called, TD::Types::Bool attribute :supports_video_calls, TD::Types::Bool attribute :has_private_calls, TD::Types::Bool + attribute :has_private_forwards, TD::Types::Bool + attribute :has_restricted_voice_and_video_note_messages, TD::Types::Bool + attribute :has_posted_to_profile_stories, TD::Types::Bool + attribute :has_sponsored_messages_enabled, TD::Types::Bool attribute :need_phone_number_privacy_exception, TD::Types::Bool - attribute :bio, TD::Types::String - attribute :share_text, TD::Types::String + attribute :set_chat_background, TD::Types::Bool + attribute :bio, TD::Types::FormattedText.optional.default(nil) + attribute :birthdate, TD::Types::Birthdate.optional.default(nil) + attribute :personal_chat_id, TD::Types::Coercible::Integer + attribute :premium_gift_options, TD::Types::Array.of(TD::Types::PremiumPaymentOption) attribute :group_in_common_count, TD::Types::Coercible::Integer + attribute :business_info, TD::Types::BusinessInfo.optional.default(nil) attribute :bot_info, TD::Types::BotInfo.optional.default(nil) end end diff --git a/lib/tdlib/types/user_link.rb b/lib/tdlib/types/user_link.rb new file mode 100644 index 00000000..9a38227b --- /dev/null +++ b/lib/tdlib/types/user_link.rb @@ -0,0 +1,11 @@ +module TD::Types + # Contains an HTTPS URL, which can be used to get information about a user. + # + # @attr url [TD::Types::String] The URL. + # @attr expires_in [Integer] Left time for which the link is valid, in seconds; 0 if the link is a public username + # link. + class UserLink < Base + attribute :url, TD::Types::String + attribute :expires_in, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/user_privacy_setting.rb b/lib/tdlib/types/user_privacy_setting.rb index f22d2a77..93657d41 100644 --- a/lib/tdlib/types/user_privacy_setting.rb +++ b/lib/tdlib/types/user_privacy_setting.rb @@ -6,10 +6,13 @@ class UserPrivacySetting < Base show_profile_photo show_link_in_forwarded_messages show_phone_number + show_bio + show_birthdate allow_chat_invites allow_calls allow_peer_to_peer_calls allow_finding_by_phone_number + allow_private_voice_and_video_note_messages ].each do |type| autoload TD::Types.camelize(type), "tdlib/types/user_privacy_setting/#{type}" end diff --git a/lib/tdlib/types/user_privacy_setting/allow_private_voice_and_video_note_messages.rb b/lib/tdlib/types/user_privacy_setting/allow_private_voice_and_video_note_messages.rb new file mode 100644 index 00000000..c9e62201 --- /dev/null +++ b/lib/tdlib/types/user_privacy_setting/allow_private_voice_and_video_note_messages.rb @@ -0,0 +1,6 @@ +module TD::Types + # A privacy setting for managing whether the user can receive voice and video messages in private chats; for Telegram + # Premium users only. + class UserPrivacySetting::AllowPrivateVoiceAndVideoNoteMessages < UserPrivacySetting + end +end diff --git a/lib/tdlib/types/user_privacy_setting/show_bio.rb b/lib/tdlib/types/user_privacy_setting/show_bio.rb new file mode 100644 index 00000000..75316fa7 --- /dev/null +++ b/lib/tdlib/types/user_privacy_setting/show_bio.rb @@ -0,0 +1,5 @@ +module TD::Types + # A privacy setting for managing whether the user's bio is visible. + class UserPrivacySetting::ShowBio < UserPrivacySetting + end +end diff --git a/lib/tdlib/types/user_privacy_setting/show_birthdate.rb b/lib/tdlib/types/user_privacy_setting/show_birthdate.rb new file mode 100644 index 00000000..ccb29b4a --- /dev/null +++ b/lib/tdlib/types/user_privacy_setting/show_birthdate.rb @@ -0,0 +1,5 @@ +module TD::Types + # A privacy setting for managing whether the user's birthdate is visible. + class UserPrivacySetting::ShowBirthdate < UserPrivacySetting + end +end diff --git a/lib/tdlib/types/user_privacy_setting_rule.rb b/lib/tdlib/types/user_privacy_setting_rule.rb index a1939c47..eff3b2de 100644 --- a/lib/tdlib/types/user_privacy_setting_rule.rb +++ b/lib/tdlib/types/user_privacy_setting_rule.rb @@ -1,9 +1,10 @@ module TD::Types - # Represents a single rule for managing privacy settings. + # Represents a single rule for managing user privacy settings. class UserPrivacySettingRule < Base %w[ allow_all allow_contacts + allow_premium_users allow_users allow_chat_members restrict_all diff --git a/lib/tdlib/types/user_privacy_setting_rule/allow_contacts.rb b/lib/tdlib/types/user_privacy_setting_rule/allow_contacts.rb index 97370bb3..15991bd7 100644 --- a/lib/tdlib/types/user_privacy_setting_rule/allow_contacts.rb +++ b/lib/tdlib/types/user_privacy_setting_rule/allow_contacts.rb @@ -1,5 +1,5 @@ module TD::Types - # A rule to allow all of a user's contacts to do something. + # A rule to allow all contacts of the user to do something. class UserPrivacySettingRule::AllowContacts < UserPrivacySettingRule end end diff --git a/lib/tdlib/types/user_privacy_setting_rule/allow_premium_users.rb b/lib/tdlib/types/user_privacy_setting_rule/allow_premium_users.rb new file mode 100644 index 00000000..f99f0934 --- /dev/null +++ b/lib/tdlib/types/user_privacy_setting_rule/allow_premium_users.rb @@ -0,0 +1,5 @@ +module TD::Types + # A rule to allow all Premium Users to do something; currently, allowed only for userPrivacySettingAllowChatInvites. + class UserPrivacySettingRule::AllowPremiumUsers < UserPrivacySettingRule + end +end diff --git a/lib/tdlib/types/user_privacy_setting_rule/restrict_contacts.rb b/lib/tdlib/types/user_privacy_setting_rule/restrict_contacts.rb index 89f341b2..c9428375 100644 --- a/lib/tdlib/types/user_privacy_setting_rule/restrict_contacts.rb +++ b/lib/tdlib/types/user_privacy_setting_rule/restrict_contacts.rb @@ -1,5 +1,5 @@ module TD::Types - # A rule to restrict all contacts of a user from doing something. + # A rule to restrict all contacts of the user from doing something. class UserPrivacySettingRule::RestrictContacts < UserPrivacySettingRule end end diff --git a/lib/tdlib/types/user_status/empty.rb b/lib/tdlib/types/user_status/empty.rb index 27fef8d7..78830424 100644 --- a/lib/tdlib/types/user_status/empty.rb +++ b/lib/tdlib/types/user_status/empty.rb @@ -1,5 +1,5 @@ module TD::Types - # The user status was never changed. + # The user's status has never been changed. class UserStatus::Empty < UserStatus end end diff --git a/lib/tdlib/types/user_status/last_month.rb b/lib/tdlib/types/user_status/last_month.rb index c9f74c22..b672d2e3 100644 --- a/lib/tdlib/types/user_status/last_month.rb +++ b/lib/tdlib/types/user_status/last_month.rb @@ -1,5 +1,9 @@ module TD::Types # The user is offline, but was online last month. + # + # @attr by_my_privacy_settings [Boolean] Exact user's status is hidden because the current user enabled + # {TD::Types::UserPrivacySetting::ShowStatus} privacy setting for the user and has no Telegram Premium. class UserStatus::LastMonth < UserStatus + attribute :by_my_privacy_settings, TD::Types::Bool end end diff --git a/lib/tdlib/types/user_status/last_week.rb b/lib/tdlib/types/user_status/last_week.rb index d2ee9bac..369fb18c 100644 --- a/lib/tdlib/types/user_status/last_week.rb +++ b/lib/tdlib/types/user_status/last_week.rb @@ -1,5 +1,9 @@ module TD::Types # The user is offline, but was online last week. + # + # @attr by_my_privacy_settings [Boolean] Exact user's status is hidden because the current user enabled + # {TD::Types::UserPrivacySetting::ShowStatus} privacy setting for the user and has no Telegram Premium. class UserStatus::LastWeek < UserStatus + attribute :by_my_privacy_settings, TD::Types::Bool end end diff --git a/lib/tdlib/types/user_status/recently.rb b/lib/tdlib/types/user_status/recently.rb index 59d8d24e..c04b2a5b 100644 --- a/lib/tdlib/types/user_status/recently.rb +++ b/lib/tdlib/types/user_status/recently.rb @@ -1,5 +1,9 @@ module TD::Types # The user was online recently. + # + # @attr by_my_privacy_settings [Boolean] Exact user's status is hidden because the current user enabled + # {TD::Types::UserPrivacySetting::ShowStatus} privacy setting for the user and has no Telegram Premium. class UserStatus::Recently < UserStatus + attribute :by_my_privacy_settings, TD::Types::Bool end end diff --git a/lib/tdlib/types/user_support_info.rb b/lib/tdlib/types/user_support_info.rb new file mode 100644 index 00000000..c0610e6b --- /dev/null +++ b/lib/tdlib/types/user_support_info.rb @@ -0,0 +1,12 @@ +module TD::Types + # Contains custom information about the user. + # + # @attr message [TD::Types::FormattedText] Information message. + # @attr author [TD::Types::String] Information author. + # @attr date [Integer] Information change date. + class UserSupportInfo < Base + attribute :message, TD::Types::FormattedText + attribute :author, TD::Types::String + attribute :date, TD::Types::Coercible::Integer + end +end diff --git a/lib/tdlib/types/user_type.rb b/lib/tdlib/types/user_type.rb index 1e0e376d..1af4c308 100644 --- a/lib/tdlib/types/user_type.rb +++ b/lib/tdlib/types/user_type.rb @@ -1,5 +1,5 @@ module TD::Types - # Represents the type of a user. + # Represents the type of user. # The following types are possible: regular users, deleted users and bots. class UserType < Base %w[ diff --git a/lib/tdlib/types/user_type/bot.rb b/lib/tdlib/types/user_type/bot.rb index 6a900a71..18f1d3b7 100644 --- a/lib/tdlib/types/user_type/bot.rb +++ b/lib/tdlib/types/user_type/bot.rb @@ -1,19 +1,32 @@ module TD::Types # A bot (see https://core.telegram.org/bots). # + # @attr can_be_edited [Boolean] True, if the bot is owned by the current user and can be edited using the methods + # toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and + # setBotInfoShortDescription. # @attr can_join_groups [Boolean] True, if the bot can be invited to basic group and supergroup chats. # @attr can_read_all_group_messages [Boolean] True, if the bot can read all messages in basic group or supergroup # chats and not just those addressed to the bot. # In private and channel chats a bot can always read all messages. + # @attr has_main_web_app [Boolean] True, if the bot has the main Web App. # @attr is_inline [Boolean] True, if the bot supports inline queries. # @attr inline_query_placeholder [TD::Types::String] Placeholder for inline queries (displayed on the application # input field). - # @attr need_location [Boolean] True, if the location of the user should be sent with every inline query to this bot. + # @attr need_location [Boolean] True, if the location of the user is expected to be sent with every inline query to + # this bot. + # @attr can_connect_to_business [Boolean] True, if the bot supports connection to Telegram Business accounts. + # @attr can_be_added_to_attachment_menu [Boolean] True, if the bot can be added to attachment or side menu. + # @attr active_user_count [Integer] The number of recently active users of the bot. class UserType::Bot < UserType + attribute :can_be_edited, TD::Types::Bool attribute :can_join_groups, TD::Types::Bool attribute :can_read_all_group_messages, TD::Types::Bool + attribute :has_main_web_app, TD::Types::Bool attribute :is_inline, TD::Types::Bool attribute :inline_query_placeholder, TD::Types::String attribute :need_location, TD::Types::Bool + attribute :can_connect_to_business, TD::Types::Bool + attribute :can_be_added_to_attachment_menu, TD::Types::Bool + attribute :active_user_count, TD::Types::Coercible::Integer end end diff --git a/lib/tdlib/types/usernames.rb b/lib/tdlib/types/usernames.rb new file mode 100644 index 00000000..19271d76 --- /dev/null +++ b/lib/tdlib/types/usernames.rb @@ -0,0 +1,18 @@ +module TD::Types + # Describes usernames assigned to a user, a supergroup, or a channel. + # + # @attr active_usernames [Array] List of active usernames; the first one must be shown as the + # primary username. + # The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or + # reorderSupergroupActiveUsernames. + # @attr disabled_usernames [Array] List of currently disabled usernames; the username can be + # activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive. + # @attr editable_username [TD::Types::String] The active username, which can be changed with setUsername or + # setSupergroupUsername. + # Information about other active usernames can be received using getCollectibleItemInfo. + class Usernames < Base + attribute :active_usernames, TD::Types::Array.of(TD::Types::String) + attribute :disabled_usernames, TD::Types::Array.of(TD::Types::String) + attribute :editable_username, TD::Types::String + end +end diff --git a/lib/tdlib/types/users.rb b/lib/tdlib/types/users.rb index ee49a29f..6a084d71 100644 --- a/lib/tdlib/types/users.rb +++ b/lib/tdlib/types/users.rb @@ -1,7 +1,7 @@ module TD::Types # Represents a list of users. # - # @attr total_count [Integer] Approximate total count of users found. + # @attr total_count [Integer] Approximate total number of users found. # @attr user_ids [Array] A list of user identifiers. class Users < Base attribute :total_count, TD::Types::Coercible::Integer diff --git a/lib/tdlib/types/validated_order_info.rb b/lib/tdlib/types/validated_order_info.rb index 37e7e527..ae3fb4d7 100644 --- a/lib/tdlib/types/validated_order_info.rb +++ b/lib/tdlib/types/validated_order_info.rb @@ -1,6 +1,6 @@ module TD::Types - # Contains a temporary identifier of validated order information, which is stored for one hour. - # Also contains the available shipping options. + # Contains a temporary identifier of validated order information, which is stored for one hour, and the available + # shipping options. # # @attr order_info_id [TD::Types::String] Temporary identifier of the order information. # @attr shipping_options [Array] Available shipping options. diff --git a/lib/tdlib/types/venue.rb b/lib/tdlib/types/venue.rb index bd0e9fb0..9416be24 100644 --- a/lib/tdlib/types/venue.rb +++ b/lib/tdlib/types/venue.rb @@ -5,7 +5,7 @@ module TD::Types # @attr title [TD::Types::String] Venue name; as defined by the sender. # @attr address [TD::Types::String] Venue address; as defined by the sender. # @attr provider [TD::Types::String] Provider of the venue database; as defined by the sender. - # Currently only "foursquare" and "gplaces" (Google Places) need to be supported. + # Currently, only "foursquare" and "gplaces" (Google Places) need to be supported. # @attr id [TD::Types::String] Identifier of the venue in the provider database; as defined by the sender. # @attr type [TD::Types::String] Type of the venue in the provider database; as defined by the sender. class Venue < Base diff --git a/lib/tdlib/types/video.rb b/lib/tdlib/types/video.rb index 407455cf..0ea7b2cb 100644 --- a/lib/tdlib/types/video.rb +++ b/lib/tdlib/types/video.rb @@ -8,7 +8,7 @@ module TD::Types # @attr mime_type [TD::Types::String] MIME type of the file; as defined by the sender. # @attr has_stickers [Boolean] True, if stickers were added to the video. # The list of corresponding sticker sets can be received using getAttachedStickerSets. - # @attr supports_streaming [Boolean] True, if the video should be tried to be streamed. + # @attr supports_streaming [Boolean] True, if the video is supposed to be streamed. # @attr minithumbnail [TD::Types::Minithumbnail, nil] Video minithumbnail; may be null. # @attr thumbnail [TD::Types::Thumbnail, nil] Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may # be null. diff --git a/lib/tdlib/types/voice_chat.rb b/lib/tdlib/types/video_chat.rb similarity index 61% rename from lib/tdlib/types/voice_chat.rb rename to lib/tdlib/types/video_chat.rb index 72994363..4df51129 100644 --- a/lib/tdlib/types/voice_chat.rb +++ b/lib/tdlib/types/video_chat.rb @@ -1,12 +1,12 @@ module TD::Types - # Describes a voice chat. + # Describes a video chat. # - # @attr group_call_id [Integer] Group call identifier of an active voice chat; 0 if none. - # Full informationa about the voice chat can be received through the method getGroupCall. - # @attr has_participants [Boolean] True, if the voice chat has participants. + # @attr group_call_id [Integer] Group call identifier of an active video chat; 0 if none. + # Full information about the video chat can be received through the method getGroupCall. + # @attr has_participants [Boolean] True, if the video chat has participants. # @attr default_participant_id [TD::Types::MessageSender, nil] Default group call participant identifier to join the - # voice chat; may be null. - class VoiceChat < Base + # video chat; may be null. + class VideoChat < Base attribute :group_call_id, TD::Types::Coercible::Integer attribute :has_participants, TD::Types::Bool attribute :default_participant_id, TD::Types::MessageSender.optional.default(nil) diff --git a/lib/tdlib/types/video_note.rb b/lib/tdlib/types/video_note.rb index 5a447e19..ccb7c7c5 100644 --- a/lib/tdlib/types/video_note.rb +++ b/lib/tdlib/types/video_note.rb @@ -3,15 +3,21 @@ module TD::Types # The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format. # # @attr duration [Integer] Duration of the video, in seconds; as defined by the sender. + # @attr waveform [String, nil] A waveform representation of the video note's audio in 5-bit format; may be empty if + # unknown. # @attr length [Integer] Video width and height; as defined by the sender. # @attr minithumbnail [TD::Types::Minithumbnail, nil] Video minithumbnail; may be null. # @attr thumbnail [TD::Types::Thumbnail, nil] Video thumbnail in JPEG format; as defined by the sender; may be null. + # @attr speech_recognition_result [TD::Types::SpeechRecognitionResult, nil] Result of speech recognition in the video + # note; may be null. # @attr video [TD::Types::File] File containing the video. class VideoNote < Base attribute :duration, TD::Types::Coercible::Integer + attribute :waveform, TD::Types::Coercible::String.optional.default(nil) attribute :length, TD::Types::Coercible::Integer attribute :minithumbnail, TD::Types::Minithumbnail.optional.default(nil) attribute :thumbnail, TD::Types::Thumbnail.optional.default(nil) + attribute :speech_recognition_result, TD::Types::SpeechRecognitionResult.optional.default(nil) attribute :video, TD::Types::File end end diff --git a/lib/tdlib/types/voice_note.rb b/lib/tdlib/types/voice_note.rb index 448d0680..5952b46f 100644 --- a/lib/tdlib/types/voice_note.rb +++ b/lib/tdlib/types/voice_note.rb @@ -1,16 +1,19 @@ module TD::Types # Describes a voice note. - # The voice note must be encoded with the Opus codec, and stored inside an OGG container. - # Voice notes can have only a single audio channel. # # @attr duration [Integer] Duration of the voice note, in seconds; as defined by the sender. # @attr waveform [String] A waveform representation of the voice note in 5-bit format. # @attr mime_type [TD::Types::String] MIME type of the file; as defined by the sender. + # Usually, one of "audio/ogg" for Opus in an OGG container, "audio/mpeg" for an MP3 audio, or "audio/mp4" for an + # M4A audio. + # @attr speech_recognition_result [TD::Types::SpeechRecognitionResult, nil] Result of speech recognition in the voice + # note; may be null. # @attr voice [TD::Types::File] File containing the voice note. class VoiceNote < Base attribute :duration, TD::Types::Coercible::Integer attribute :waveform, TD::Types::Coercible::String attribute :mime_type, TD::Types::String + attribute :speech_recognition_result, TD::Types::SpeechRecognitionResult.optional.default(nil) attribute :voice, TD::Types::File end end diff --git a/lib/tdlib/types/web_app.rb b/lib/tdlib/types/web_app.rb new file mode 100644 index 00000000..10163e8b --- /dev/null +++ b/lib/tdlib/types/web_app.rb @@ -0,0 +1,17 @@ +module TD::Types + # Describes a Web App. + # Use getInternalLink with internalLinkTypeWebApp to share the Web App. + # + # @attr short_name [TD::Types::String] Web App short name. + # @attr title [TD::Types::String] Web App title. + # @attr description [TD::Types::String] Web App description. + # @attr photo [TD::Types::Photo] Web App photo. + # @attr animation [TD::Types::Animation, nil] Web App animation; may be null. + class WebApp < Base + attribute :short_name, TD::Types::String + attribute :title, TD::Types::String + attribute :description, TD::Types::String + attribute :photo, TD::Types::Photo + attribute :animation, TD::Types::Animation.optional.default(nil) + end +end diff --git a/lib/tdlib/types/web_app_info.rb b/lib/tdlib/types/web_app_info.rb new file mode 100644 index 00000000..3c8ff870 --- /dev/null +++ b/lib/tdlib/types/web_app_info.rb @@ -0,0 +1,10 @@ +module TD::Types + # Contains information about a Web App. + # + # @attr launch_id [Integer] Unique identifier for the Web App launch. + # @attr url [TD::Types::String] A Web App URL to open in a web view. + class WebAppInfo < Base + attribute :launch_id, TD::Types::Coercible::Integer + attribute :url, TD::Types::String + end +end diff --git a/lib/tdlib/types/web_page.rb b/lib/tdlib/types/web_page.rb deleted file mode 100644 index a8705dbc..00000000 --- a/lib/tdlib/types/web_page.rb +++ /dev/null @@ -1,52 +0,0 @@ -module TD::Types - # Describes a web page preview. - # - # @attr url [TD::Types::String] Original URL of the link. - # @attr display_url [TD::Types::String] URL to display. - # @attr type [TD::Types::String] Type of the web page. - # Can be: article, photo, audio, video, document, profile, app, or something else. - # @attr site_name [TD::Types::String] Short name of the site (e.g., Google Docs, App Store). - # @attr title [TD::Types::String] Title of the content. - # @attr description [TD::Types::FormattedText] Description of the content. - # @attr photo [TD::Types::Photo, nil] Image representing the content; may be null. - # @attr embed_url [TD::Types::String] URL to show in the embedded preview. - # @attr embed_type [TD::Types::String] MIME type of the embedded preview, (e.g., text/html or video/mp4). - # @attr embed_width [Integer] Width of the embedded preview. - # @attr embed_height [Integer] Height of the embedded preview. - # @attr duration [Integer] Duration of the content, in seconds. - # @attr author [TD::Types::String] Author of the content. - # @attr animation [TD::Types::Animation, nil] Preview of the content as an animation, if available; may be null. - # @attr audio [TD::Types::Audio, nil] Preview of the content as an audio file, if available; may be null. - # @attr document [TD::Types::Document, nil] Preview of the content as a document, if available (currently only - # available for small PDF files and ZIP archives); may be null. - # @attr sticker [TD::Types::Sticker, nil] Preview of the content as a sticker for small WEBP files, if available; may - # be null. - # @attr video [TD::Types::Video, nil] Preview of the content as a video, if available; may be null. - # @attr video_note [TD::Types::VideoNote, nil] Preview of the content as a video note, if available; may be null. - # @attr voice_note [TD::Types::VoiceNote, nil] Preview of the content as a voice note, if available; may be null. - # @attr instant_view_version [Integer] Version of instant view, available for the web page (currently can be 1 or 2), - # 0 if none. - class WebPage < Base - attribute :url, TD::Types::String - attribute :display_url, TD::Types::String - attribute :type, TD::Types::String - attribute :site_name, TD::Types::String - attribute :title, TD::Types::String - attribute :description, TD::Types::FormattedText - attribute :photo, TD::Types::Photo.optional.default(nil) - attribute :embed_url, TD::Types::String - attribute :embed_type, TD::Types::String - attribute :embed_width, TD::Types::Coercible::Integer - attribute :embed_height, TD::Types::Coercible::Integer - attribute :duration, TD::Types::Coercible::Integer - attribute :author, TD::Types::String - attribute :animation, TD::Types::Animation.optional.default(nil) - attribute :audio, TD::Types::Audio.optional.default(nil) - attribute :document, TD::Types::Document.optional.default(nil) - attribute :sticker, TD::Types::Sticker.optional.default(nil) - attribute :video, TD::Types::Video.optional.default(nil) - attribute :video_note, TD::Types::VideoNote.optional.default(nil) - attribute :voice_note, TD::Types::VoiceNote.optional.default(nil) - attribute :instant_view_version, TD::Types::Coercible::Integer - end -end diff --git a/lib/tdlib/types/web_page_instant_view.rb b/lib/tdlib/types/web_page_instant_view.rb index 05d07558..a408d80f 100644 --- a/lib/tdlib/types/web_page_instant_view.rb +++ b/lib/tdlib/types/web_page_instant_view.rb @@ -1,17 +1,20 @@ module TD::Types # Describes an instant view page for a web page. # - # @attr page_blocks [Array] Content of the web page. + # @attr page_blocks [Array] Content of the instant view page. # @attr view_count [Integer] Number of the instant view views; 0 if unknown. - # @attr version [Integer] Version of the instant view, currently can be 1 or 2. + # @attr version [Integer] Version of the instant view; currently, can be 1 or 2. # @attr is_rtl [Boolean] True, if the instant view must be shown from right to left. # @attr is_full [Boolean] True, if the instant view contains the full page. - # A network request might be needed to get the full web page instant view. + # A network request might be needed to get the full instant view. + # @attr feedback_link [TD::Types::InternalLinkType] An internal link to be opened to leave feedback about the instant + # view. class WebPageInstantView < Base attribute :page_blocks, TD::Types::Array.of(TD::Types::PageBlock) attribute :view_count, TD::Types::Coercible::Integer attribute :version, TD::Types::Coercible::Integer attribute :is_rtl, TD::Types::Bool attribute :is_full, TD::Types::Bool + attribute :feedback_link, TD::Types::InternalLinkType end end diff --git a/td b/td index e1ebf743..9b6ff586 160000 --- a/td +++ b/td @@ -1 +1 @@ -Subproject commit e1ebf743988edfcf4400cd5d33a664ff941dc13e +Subproject commit 9b6ff5863e5d0b2a07b50f4aa1a3344a51a1f80f