From dc469296759a688882b4304eaac3179d58b7f976 Mon Sep 17 00:00:00 2001 From: pylakey Date: Tue, 14 Sep 2021 14:26:32 +0300 Subject: [PATCH] * Removed unnecessary dev-requirements file * API types and functions regenerated --- aiotdlib/api/__init__.py | 6 +- aiotdlib/api/api.py | 57 ++++++++++++------- aiotdlib/api/functions/__init__.py | 4 +- aiotdlib/api/functions/edit_message_media.py | 2 +- aiotdlib/api/functions/get_chat_themes.py | 23 -------- .../get_file_downloaded_prefix_size.py | 2 +- aiotdlib/api/functions/optimize_storage.py | 2 +- aiotdlib/api/functions/set_chat_theme.py | 2 +- .../api/functions/view_sponsored_message.py | 6 +- aiotdlib/api/types/__init__.py | 4 +- aiotdlib/api/types/auto_download_settings.py | 6 +- aiotdlib/api/types/background_type.py | 6 +- aiotdlib/api/types/chat.py | 2 +- aiotdlib/api/types/chat_event_action.py | 6 +- aiotdlib/api/types/chat_themes.py | 29 ---------- aiotdlib/api/types/file.py | 4 +- aiotdlib/api/types/input_file.py | 2 +- aiotdlib/api/types/internal_link_type.py | 4 ++ aiotdlib/api/types/local_file.py | 4 +- aiotdlib/api/types/log_stream.py | 2 +- aiotdlib/api/types/message_content.py | 2 +- aiotdlib/api/types/photo_size.py | 2 +- aiotdlib/api/types/push_message_content.py | 2 +- aiotdlib/api/types/remote_file.py | 2 +- aiotdlib/api/types/sponsored_message.py | 4 +- aiotdlib/api/types/storage_statistics.py | 2 +- .../api/types/storage_statistics_by_chat.py | 2 +- .../types/storage_statistics_by_file_type.py | 2 +- aiotdlib/api/types/storage_statistics_fast.py | 2 +- aiotdlib/api/types/update.py | 21 ++++++- dev-requirements.txt | 2 - 31 files changed, 102 insertions(+), 114 deletions(-) delete mode 100644 aiotdlib/api/functions/get_chat_themes.py delete mode 100644 aiotdlib/api/types/chat_themes.py delete mode 100644 dev-requirements.txt diff --git a/aiotdlib/api/__init__.py b/aiotdlib/api/__init__.py index 3aa324df..ad7c4cbb 100644 --- a/aiotdlib/api/__init__.py +++ b/aiotdlib/api/__init__.py @@ -222,7 +222,6 @@ 'chatStatisticsMessageInteractionInfo': ChatStatisticsMessageInteractionInfo, 'chatStatisticsMessageSenderInfo': ChatStatisticsMessageSenderInfo, 'chatTheme': ChatTheme, - 'chatThemes': ChatThemes, 'chatType': ChatType, 'chatTypeBasicGroup': ChatTypeBasicGroup, 'chatTypePrivate': ChatTypePrivate, @@ -919,6 +918,7 @@ 'updateChatReadOutbox': UpdateChatReadOutbox, 'updateChatReplyMarkup': UpdateChatReplyMarkup, 'updateChatTheme': UpdateChatTheme, + 'updateChatThemes': UpdateChatThemes, 'updateChatTitle': UpdateChatTitle, 'updateChatUnreadMentionCount': UpdateChatUnreadMentionCount, 'updateChatVoiceChat': UpdateChatVoiceChat, @@ -1278,7 +1278,6 @@ 'ChatStatisticsMessageInteractionInfo', 'ChatStatisticsMessageSenderInfo', 'ChatTheme', - 'ChatThemes', 'ChatType', 'ChatTypeBasicGroup', 'ChatTypePrivate', @@ -1480,7 +1479,6 @@ 'GetChatSponsoredMessages', 'GetChatStatistics', 'GetChatStatisticsUrl', - 'GetChatThemes', 'GetChats', 'GetCommands', 'GetConnectedWebsites', @@ -1554,6 +1552,7 @@ 'GetPushReceiverId', 'GetRecentInlineBots', 'GetRecentStickers', + 'GetRecentlyOpenedChats', 'GetRecentlyVisitedTMeUrls', 'GetRecommendedChatFilters', 'GetRecoveryEmailAddress', @@ -2388,6 +2387,7 @@ 'UpdateChatReadOutbox', 'UpdateChatReplyMarkup', 'UpdateChatTheme', + 'UpdateChatThemes', 'UpdateChatTitle', 'UpdateChatUnreadMentionCount', 'UpdateChatVoiceChat', diff --git a/aiotdlib/api/api.py b/aiotdlib/api/api.py index a2389e48..29b4ecaa 100644 --- a/aiotdlib/api/api.py +++ b/aiotdlib/api/api.py @@ -261,7 +261,6 @@ class Types: CHAT_STATISTICS_MESSAGE_INTERACTION_INFO = 'chatStatisticsMessageInteractionInfo' CHAT_STATISTICS_MESSAGE_SENDER_INFO = 'chatStatisticsMessageSenderInfo' CHAT_THEME = 'chatTheme' - CHAT_THEMES = 'chatThemes' CHAT_TYPE = 'chatType' CHAT_TYPE_BASIC_GROUP = 'chatTypeBasicGroup' CHAT_TYPE_PRIVATE = 'chatTypePrivate' @@ -463,7 +462,6 @@ class Types: GET_CHAT_SPONSORED_MESSAGES = 'getChatSponsoredMessages' GET_CHAT_STATISTICS = 'getChatStatistics' GET_CHAT_STATISTICS_URL = 'getChatStatisticsUrl' - GET_CHAT_THEMES = 'getChatThemes' GET_CHATS = 'getChats' GET_COMMANDS = 'getCommands' GET_CONNECTED_WEBSITES = 'getConnectedWebsites' @@ -537,6 +535,7 @@ class Types: GET_PUSH_RECEIVER_ID = 'getPushReceiverId' GET_RECENT_INLINE_BOTS = 'getRecentInlineBots' GET_RECENT_STICKERS = 'getRecentStickers' + GET_RECENTLY_OPENED_CHATS = 'getRecentlyOpenedChats' GET_RECENTLY_VISITED_T_ME_URLS = 'getRecentlyVisitedTMeUrls' GET_RECOMMENDED_CHAT_FILTERS = 'getRecommendedChatFilters' GET_RECOVERY_EMAIL_ADDRESS = 'getRecoveryEmailAddress' @@ -1371,6 +1370,7 @@ class Types: UPDATE_CHAT_READ_OUTBOX = 'updateChatReadOutbox' UPDATE_CHAT_REPLY_MARKUP = 'updateChatReplyMarkup' UPDATE_CHAT_THEME = 'updateChatTheme' + UPDATE_CHAT_THEMES = 'updateChatThemes' UPDATE_CHAT_TITLE = 'updateChatTitle' UPDATE_CHAT_UNREAD_MENTION_COUNT = 'updateChatUnreadMentionCount' UPDATE_CHAT_VOICE_CHAT = 'updateChatVoiceChat' @@ -4493,7 +4493,7 @@ async def edit_message_media( skip_validation: bool = False ) -> Message: """ - 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. Returns the edited message after the edit is completed on the server side + 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 Params: chat_id (:class:`int`) @@ -5914,17 +5914,6 @@ async def get_chat_statistics_url( request_timeout=request_timeout, ) - async def get_chat_themes(self, *, request_id: str = None, request_timeout: int = None) -> ChatThemes: - """ - Returns the list of available chat themes - - """ - return await self.client.request( - GetChatThemes(), - request_id=request_id, - request_timeout=request_timeout, - ) - async def get_chats( self, chat_list: ChatList, @@ -6240,7 +6229,7 @@ async def get_file_downloaded_prefix_size( skip_validation: bool = False ) -> Count: """ - Returns file downloaded prefix size from a given offset + Returns file downloaded prefix size from a given offset, in bytes Params: file_id (:class:`int`) @@ -7913,6 +7902,32 @@ async def get_recent_stickers( request_timeout=request_timeout, ) + async def get_recently_opened_chats( + self, + limit: int, + *, + request_id: str = None, + request_timeout: int = None, + skip_validation: bool = False + ) -> Chats: + """ + Returns recently opened chats, this is an offline request. Returns chats in the order of last opening + + Params: + limit (:class:`int`) + The maximum number of chats to be returned + + """ + _constructor = GetRecentlyOpenedChats.construct if skip_validation else GetRecentlyOpenedChats + + return await self.client.request( + _constructor( + limit=limit, + ), + request_id=request_id, + request_timeout=request_timeout, + ) + async def get_recently_visited_t_me_urls( self, referrer: str, @@ -9181,7 +9196,7 @@ async def optimize_storage( Params: size (:class:`int`) - Limit on the total size of files after deletion. Pass -1 to use the default limit + Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit ttl (:class:`int`) 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 @@ -12245,7 +12260,7 @@ async def set_chat_theme( skip_validation: bool = False ) -> Ok: """ - Changes the chat theme. Requires can_change_info administrator right in groups, supergroups and channels + Changes the chat theme. Supported only in private and secret chats Params: chat_id (:class:`int`) @@ -14601,7 +14616,7 @@ async def view_messages( async def view_sponsored_message( self, chat_id: int, - message_id: str, + sponsored_message_id: int, *, request_id: str = None, request_timeout: int = None, @@ -14612,9 +14627,9 @@ async def view_sponsored_message( Params: chat_id (:class:`int`) - Chat identifier + Identifier of the chat with the sponsored message - message_id (:class:`str`) + sponsored_message_id (:class:`int`) The identifier of the sponsored message being viewed """ @@ -14623,7 +14638,7 @@ async def view_sponsored_message( return await self.client.request( _constructor( chat_id=chat_id, - message_id=message_id, + sponsored_message_id=sponsored_message_id, ), request_id=request_id, request_timeout=request_timeout, diff --git a/aiotdlib/api/functions/__init__.py b/aiotdlib/api/functions/__init__.py index d05cf9c1..9e99fbdb 100644 --- a/aiotdlib/api/functions/__init__.py +++ b/aiotdlib/api/functions/__init__.py @@ -153,7 +153,6 @@ from .get_chat_sponsored_messages import GetChatSponsoredMessages from .get_chat_statistics import GetChatStatistics from .get_chat_statistics_url import GetChatStatisticsUrl -from .get_chat_themes import GetChatThemes from .get_chats import GetChats from .get_commands import GetCommands from .get_connected_websites import GetConnectedWebsites @@ -227,6 +226,7 @@ from .get_push_receiver_id import GetPushReceiverId from .get_recent_inline_bots import GetRecentInlineBots from .get_recent_stickers import GetRecentStickers +from .get_recently_opened_chats import GetRecentlyOpenedChats from .get_recently_visited_t_me_urls import GetRecentlyVisitedTMeUrls from .get_recommended_chat_filters import GetRecommendedChatFilters from .get_recovery_email_address import GetRecoveryEmailAddress @@ -606,7 +606,6 @@ "GetChatSponsoredMessages", "GetChatStatistics", "GetChatStatisticsUrl", - "GetChatThemes", "GetChats", "GetCommands", "GetConnectedWebsites", @@ -680,6 +679,7 @@ "GetPushReceiverId", "GetRecentInlineBots", "GetRecentStickers", + "GetRecentlyOpenedChats", "GetRecentlyVisitedTMeUrls", "GetRecommendedChatFilters", "GetRecoveryEmailAddress", diff --git a/aiotdlib/api/functions/edit_message_media.py b/aiotdlib/api/functions/edit_message_media.py index c3b349c2..e8adb069 100644 --- a/aiotdlib/api/functions/edit_message_media.py +++ b/aiotdlib/api/functions/edit_message_media.py @@ -14,7 +14,7 @@ class EditMessageMedia(BaseObject): """ - 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. Returns the edited message after the edit is completed on the server side + 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 Params: chat_id (:class:`int`) diff --git a/aiotdlib/api/functions/get_chat_themes.py b/aiotdlib/api/functions/get_chat_themes.py deleted file mode 100644 index 74201556..00000000 --- a/aiotdlib/api/functions/get_chat_themes.py +++ /dev/null @@ -1,23 +0,0 @@ -# =============================================================================== # -# # -# This file has been generated automatically!! Do not change this manually! # -# # -# =============================================================================== # -from __future__ import annotations - -from pydantic import Field - -from ..base_object import BaseObject - - -class GetChatThemes(BaseObject): - """ - Returns the list of available chat themes - - """ - - ID: str = Field("getChatThemes", alias="@type") - - @staticmethod - def read(q: dict) -> GetChatThemes: - return GetChatThemes.construct(**q) diff --git a/aiotdlib/api/functions/get_file_downloaded_prefix_size.py b/aiotdlib/api/functions/get_file_downloaded_prefix_size.py index 1c690ab8..6967f00f 100644 --- a/aiotdlib/api/functions/get_file_downloaded_prefix_size.py +++ b/aiotdlib/api/functions/get_file_downloaded_prefix_size.py @@ -12,7 +12,7 @@ class GetFileDownloadedPrefixSize(BaseObject): """ - Returns file downloaded prefix size from a given offset + Returns file downloaded prefix size from a given offset, in bytes Params: file_id (:class:`int`) diff --git a/aiotdlib/api/functions/optimize_storage.py b/aiotdlib/api/functions/optimize_storage.py index 690fa39a..0302a26c 100644 --- a/aiotdlib/api/functions/optimize_storage.py +++ b/aiotdlib/api/functions/optimize_storage.py @@ -17,7 +17,7 @@ class OptimizeStorage(BaseObject): Params: size (:class:`int`) - Limit on the total size of files after deletion. Pass -1 to use the default limit + Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit ttl (:class:`int`) 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 diff --git a/aiotdlib/api/functions/set_chat_theme.py b/aiotdlib/api/functions/set_chat_theme.py index 4699f127..939f1440 100644 --- a/aiotdlib/api/functions/set_chat_theme.py +++ b/aiotdlib/api/functions/set_chat_theme.py @@ -12,7 +12,7 @@ class SetChatTheme(BaseObject): """ - Changes the chat theme. Requires can_change_info administrator right in groups, supergroups and channels + Changes the chat theme. Supported only in private and secret chats Params: chat_id (:class:`int`) diff --git a/aiotdlib/api/functions/view_sponsored_message.py b/aiotdlib/api/functions/view_sponsored_message.py index 4e18af39..17c18e60 100644 --- a/aiotdlib/api/functions/view_sponsored_message.py +++ b/aiotdlib/api/functions/view_sponsored_message.py @@ -16,16 +16,16 @@ class ViewSponsoredMessage(BaseObject): Params: chat_id (:class:`int`) - Chat identifier + Identifier of the chat with the sponsored message - message_id (:class:`str`) + sponsored_message_id (:class:`int`) The identifier of the sponsored message being viewed """ ID: str = Field("viewSponsoredMessage", alias="@type") chat_id: int - message_id: str + sponsored_message_id: int @staticmethod def read(q: dict) -> ViewSponsoredMessage: diff --git a/aiotdlib/api/types/__init__.py b/aiotdlib/api/types/__init__.py index 7fc55921..93e07bc7 100644 --- a/aiotdlib/api/types/__init__.py +++ b/aiotdlib/api/types/__init__.py @@ -255,7 +255,6 @@ from .chat_statistics_message_interaction_info import ChatStatisticsMessageInteractionInfo from .chat_statistics_message_sender_info import ChatStatisticsMessageSenderInfo from .chat_theme import ChatTheme -from .chat_themes import ChatThemes from .chat_type import ( ChatType, ChatTypeBasicGroup, @@ -1077,6 +1076,7 @@ UpdateChatReadOutbox, UpdateChatReplyMarkup, UpdateChatTheme, + UpdateChatThemes, UpdateChatTitle, UpdateChatUnreadMentionCount, UpdateChatVoiceChat, @@ -1408,7 +1408,6 @@ "ChatStatisticsMessageInteractionInfo", "ChatStatisticsMessageSenderInfo", "ChatTheme", - "ChatThemes", "ChatType", "ChatTypeBasicGroup", "ChatTypePrivate", @@ -2107,6 +2106,7 @@ "UpdateChatReadOutbox", "UpdateChatReplyMarkup", "UpdateChatTheme", + "UpdateChatThemes", "UpdateChatTitle", "UpdateChatUnreadMentionCount", "UpdateChatVoiceChat", diff --git a/aiotdlib/api/types/auto_download_settings.py b/aiotdlib/api/types/auto_download_settings.py index cd8bf4cd..85571888 100644 --- a/aiotdlib/api/types/auto_download_settings.py +++ b/aiotdlib/api/types/auto_download_settings.py @@ -19,13 +19,13 @@ class AutoDownloadSettings(BaseObject): True, if the auto-download is enabled max_photo_file_size (:class:`int`) - The maximum size of a photo file to be auto-downloaded + The maximum size of a photo file to be auto-downloaded, in bytes max_video_file_size (:class:`int`) - The maximum size of a video file to be auto-downloaded + The maximum size of a video file to be auto-downloaded, in bytes max_other_file_size (:class:`int`) - The maximum size of other file types to be auto-downloaded + The maximum size of other file types to be auto-downloaded, in bytes video_upload_bitrate (:class:`int`) The maximum suggested bitrate for uploaded videos, in kbit/s diff --git a/aiotdlib/api/types/background_type.py b/aiotdlib/api/types/background_type.py index ec794f7d..cc36ac69 100644 --- a/aiotdlib/api/types/background_type.py +++ b/aiotdlib/api/types/background_type.py @@ -47,7 +47,10 @@ class BackgroundTypePattern(BackgroundType): Description of the background fill intensity (:class:`int`) - Intensity of the pattern when it is shown above the filled background; -100-100. If negative, the pattern color and the filled background colors needs to be inverted + Intensity of the pattern when it is shown above the filled background; 0-100. + + is_inverted (:class:`bool`) + 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 is_moving (:class:`bool`) True, if the background needs to be slightly moved when device is tilted @@ -57,6 +60,7 @@ class BackgroundTypePattern(BackgroundType): ID: str = Field("backgroundTypePattern", alias="@type") fill: BackgroundFill intensity: int + is_inverted: bool is_moving: bool @staticmethod diff --git a/aiotdlib/api/types/chat.py b/aiotdlib/api/types/chat.py index f2fa8d24..8da5543a 100644 --- a/aiotdlib/api/types/chat.py +++ b/aiotdlib/api/types/chat.py @@ -87,7 +87,7 @@ class Chat(BaseObject): 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 theme_name (:class:`str`) - If non-empty, name of the theme set for the chat + If non-empty, name of a theme set for the chat action_bar (:class:`ChatActionBar`) Describes actions which should be possible to do through a chat action bar; may be null diff --git a/aiotdlib/api/types/chat_event_action.py b/aiotdlib/api/types/chat_event_action.py index 6b896669..77dd4c84 100644 --- a/aiotdlib/api/types/chat_event_action.py +++ b/aiotdlib/api/types/chat_event_action.py @@ -530,14 +530,14 @@ def read(q: dict) -> ChatEventStickerSetChanged: class ChatEventThemeChanged(ChatEventAction): """ - The chat theme was changed + The chat theme was changed. This event shouldn't be received until chat themes would be supported in supergroups Params: old_theme_name (:class:`str`) - Previous chat theme name; empty if none + Previous chat theme name; empty if the previous theme was default one new_theme_name (:class:`str`) - New chat theme name; empty if none + New chat theme name; empty if the new theme is default one """ diff --git a/aiotdlib/api/types/chat_themes.py b/aiotdlib/api/types/chat_themes.py deleted file mode 100644 index 9bffd377..00000000 --- a/aiotdlib/api/types/chat_themes.py +++ /dev/null @@ -1,29 +0,0 @@ -# =============================================================================== # -# # -# This file has been generated automatically!! Do not change this manually! # -# # -# =============================================================================== # -from __future__ import annotations - -from pydantic import Field - -from .chat_theme import ChatTheme -from ..base_object import BaseObject - - -class ChatThemes(BaseObject): - """ - Contains a list of chat themes - - Params: - chat_themes (:obj:`list[ChatTheme]`) - A list of chat themes - - """ - - ID: str = Field("chatThemes", alias="@type") - chat_themes: list[ChatTheme] - - @staticmethod - def read(q: dict) -> ChatThemes: - return ChatThemes.construct(**q) diff --git a/aiotdlib/api/types/file.py b/aiotdlib/api/types/file.py index 71b9f402..f9945728 100644 --- a/aiotdlib/api/types/file.py +++ b/aiotdlib/api/types/file.py @@ -21,10 +21,10 @@ class File(BaseObject): Unique file identifier size (:class:`int`) - File size; 0 if unknown + File size, in bytes; 0 if unknown expected_size (:class:`int`) - Expected file size in case the exact file size is unknown, but an approximate size is known. Can be used to show download/upload progress + Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress local (:class:`LocalFile`) Information about the local copy of the file diff --git a/aiotdlib/api/types/input_file.py b/aiotdlib/api/types/input_file.py index a1879843..1c50b060 100644 --- a/aiotdlib/api/types/input_file.py +++ b/aiotdlib/api/types/input_file.py @@ -31,7 +31,7 @@ class InputFileGenerated(InputFile): String specifying the conversion applied to the original file; should be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage expected_size (:class:`int`) - Expected size of the generated file; 0 if unknown + Expected size of the generated file, in bytes; 0 if unknown """ diff --git a/aiotdlib/api/types/internal_link_type.py b/aiotdlib/api/types/internal_link_type.py index 2871eaf5..779295ef 100644 --- a/aiotdlib/api/types/internal_link_type.py +++ b/aiotdlib/api/types/internal_link_type.py @@ -442,11 +442,15 @@ class InternalLinkTypeVoiceChat(InternalLinkType): invite_hash (:class:`str`) If non-empty, invite hash to be used to join the voice chat without being muted by administrators + is_live_stream (:class:`bool`) + True, if the voice chat is expected to be a live stream in a channel or a broadcast group + """ ID: str = Field("internalLinkTypeVoiceChat", alias="@type") chat_username: str invite_hash: str + is_live_stream: bool @staticmethod def read(q: dict) -> InternalLinkTypeVoiceChat: diff --git a/aiotdlib/api/types/local_file.py b/aiotdlib/api/types/local_file.py index 53db3a38..a1d0bd14 100644 --- a/aiotdlib/api/types/local_file.py +++ b/aiotdlib/api/types/local_file.py @@ -34,10 +34,10 @@ class LocalFile(BaseObject): Download will be started from this offset. downloaded_prefix_size is calculated from this offset downloaded_prefix_size (:class:`int`) - 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 + 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 in bytes downloaded_size (:class:`int`) - Total downloaded file bytes. Should be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage + Total downloaded file size, in bytes. Should be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage """ diff --git a/aiotdlib/api/types/log_stream.py b/aiotdlib/api/types/log_stream.py index 78b2bf9b..8c7ca6ca 100644 --- a/aiotdlib/api/types/log_stream.py +++ b/aiotdlib/api/types/log_stream.py @@ -54,7 +54,7 @@ class LogStreamFile(LogStream): Path to the file to where the internal TDLib log will be written max_file_size (:class:`int`) - The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated + The maximum size of the file to where the internal TDLib log is written before the file will be auto-rotated, in bytes redirect_stderr (:class:`bool`) Pass true to additionally redirect stderr to the log file. Ignored on Windows diff --git a/aiotdlib/api/types/message_content.py b/aiotdlib/api/types/message_content.py index a634a50d..49b95ab8 100644 --- a/aiotdlib/api/types/message_content.py +++ b/aiotdlib/api/types/message_content.py @@ -244,7 +244,7 @@ class MessageChatSetTheme(MessageContent): Params: theme_name (:class:`str`) - If non-empty, name of the new theme set for the chat. Otherwise theme was deleted in the chat + If non-empty, name of a new theme set for the chat. Otherwise chat theme was reset to the default one """ diff --git a/aiotdlib/api/types/photo_size.py b/aiotdlib/api/types/photo_size.py index fb89567a..bd97e54f 100644 --- a/aiotdlib/api/types/photo_size.py +++ b/aiotdlib/api/types/photo_size.py @@ -29,7 +29,7 @@ class PhotoSize(BaseObject): Image height progressive_sizes (:obj:`list[int]`) - Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image + Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes """ diff --git a/aiotdlib/api/types/push_message_content.py b/aiotdlib/api/types/push_message_content.py index 7c966136..2108ad46 100644 --- a/aiotdlib/api/types/push_message_content.py +++ b/aiotdlib/api/types/push_message_content.py @@ -135,7 +135,7 @@ class PushMessageContentChatChangeTheme(PushMessageContent): Params: theme_name (:class:`str`) - Name of the new chat theme + If non-empty, name of a new theme set for the chat. Otherwise chat theme was reset to the default one """ diff --git a/aiotdlib/api/types/remote_file.py b/aiotdlib/api/types/remote_file.py index a0191cc8..7eb1b96f 100644 --- a/aiotdlib/api/types/remote_file.py +++ b/aiotdlib/api/types/remote_file.py @@ -28,7 +28,7 @@ class RemoteFile(BaseObject): True, if a remote copy is fully available uploaded_size (:class:`int`) - Size of the remote available part of the file; 0 if unknown + Size of the remote available part of the file, in bytes; 0 if unknown """ diff --git a/aiotdlib/api/types/sponsored_message.py b/aiotdlib/api/types/sponsored_message.py index d01b99b7..c90f408f 100644 --- a/aiotdlib/api/types/sponsored_message.py +++ b/aiotdlib/api/types/sponsored_message.py @@ -16,7 +16,7 @@ class SponsoredMessage(BaseObject): Describes a sponsored message Params: - id (:class:`str`) + id (:class:`int`) Unique sponsored message identifier sponsor_chat_id (:class:`int`) @@ -31,7 +31,7 @@ class SponsoredMessage(BaseObject): """ ID: str = Field("sponsoredMessage", alias="@type") - id: str + id: int sponsor_chat_id: int start_parameter: str content: MessageContent diff --git a/aiotdlib/api/types/storage_statistics.py b/aiotdlib/api/types/storage_statistics.py index 26d5c0b7..1c7ae7fa 100644 --- a/aiotdlib/api/types/storage_statistics.py +++ b/aiotdlib/api/types/storage_statistics.py @@ -17,7 +17,7 @@ class StorageStatistics(BaseObject): Params: size (:class:`int`) - Total size of files + Total size of files, in bytes count (:class:`int`) Total number of files diff --git a/aiotdlib/api/types/storage_statistics_by_chat.py b/aiotdlib/api/types/storage_statistics_by_chat.py index 86d921af..48fbef70 100644 --- a/aiotdlib/api/types/storage_statistics_by_chat.py +++ b/aiotdlib/api/types/storage_statistics_by_chat.py @@ -20,7 +20,7 @@ class StorageStatisticsByChat(BaseObject): Chat identifier; 0 if none size (:class:`int`) - Total size of the files in the chat + Total size of the files in the chat, in bytes count (:class:`int`) Total number of files in the chat diff --git a/aiotdlib/api/types/storage_statistics_by_file_type.py b/aiotdlib/api/types/storage_statistics_by_file_type.py index 16def960..a99ddc33 100644 --- a/aiotdlib/api/types/storage_statistics_by_file_type.py +++ b/aiotdlib/api/types/storage_statistics_by_file_type.py @@ -20,7 +20,7 @@ class StorageStatisticsByFileType(BaseObject): File type size (:class:`int`) - Total size of the files + Total size of the files, in bytes count (:class:`int`) Total number of files diff --git a/aiotdlib/api/types/storage_statistics_fast.py b/aiotdlib/api/types/storage_statistics_fast.py index 7b3b698e..2bd8b4a0 100644 --- a/aiotdlib/api/types/storage_statistics_fast.py +++ b/aiotdlib/api/types/storage_statistics_fast.py @@ -16,7 +16,7 @@ class StorageStatisticsFast(BaseObject): Params: files_size (:class:`int`) - Approximate total size of files + Approximate total size of files, in bytes file_count (:class:`int`) Approximate number of files diff --git a/aiotdlib/api/types/update.py b/aiotdlib/api/types/update.py index 32c0b7e0..78b96057 100644 --- a/aiotdlib/api/types/update.py +++ b/aiotdlib/api/types/update.py @@ -28,6 +28,7 @@ from .chat_permissions import ChatPermissions from .chat_photo_info import ChatPhotoInfo from .chat_position import ChatPosition +from .chat_theme import ChatTheme from .chat_type import ChatType from .connection_state import ConnectionState from .draft_message import DraftMessage @@ -618,7 +619,7 @@ class UpdateChatTheme(Update): Chat identifier theme_name (:class:`str`) - The new name of the chat theme; may be empty if none + The new name of the chat theme; may be empty if theme was reset to default """ @@ -631,6 +632,24 @@ def read(q: dict) -> UpdateChatTheme: return UpdateChatTheme.construct(**q) +class UpdateChatThemes(Update): + """ + The list of available chat themes has changed + + Params: + chat_themes (:obj:`list[ChatTheme]`) + The new list of chat themes + + """ + + ID: str = Field("updateChatThemes", alias="@type") + chat_themes: list[ChatTheme] + + @staticmethod + def read(q: dict) -> UpdateChatThemes: + return UpdateChatThemes.construct(**q) + + class UpdateChatTitle(Update): """ The title of a chat was changed diff --git a/dev-requirements.txt b/dev-requirements.txt deleted file mode 100644 index 5bfec36f..00000000 --- a/dev-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -# For types and functions generation -jinja2==2.11.3 \ No newline at end of file