From 17ddb0d1b7f172d6f032fd08ae474b421c7cb38d Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 5 Jun 2019 13:58:32 +0200 Subject: [PATCH 1/5] Update get_chat_member docstrings --- pyrogram/client/methods/chats/get_chat_member.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/client/methods/chats/get_chat_member.py b/pyrogram/client/methods/chats/get_chat_member.py index c77e46b6..4deab9ec 100644 --- a/pyrogram/client/methods/chats/get_chat_member.py +++ b/pyrogram/client/methods/chats/get_chat_member.py @@ -37,8 +37,8 @@ class GetChatMember(BaseClient): Unique identifier (int) or username (str) of the target chat. user_id (``int`` | ``str``):: - Unique identifier (int) or username (str) of the target chat. - For your personal cloud (Saved Messages) you can simply use "me" or "self". + Unique identifier (int) or username (str) of the target user. + For you yourself you can simply use "me" or "self". For a contact that exists in your Telegram address book you can use his phone number (str). Returns: From 6bebe2297ee8852b7fada2915c12386a9cfb9bac Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 5 Jun 2019 21:03:46 +0200 Subject: [PATCH 2/5] Rename "thumbnails" to "thumbs" --- .../client/types/messages_and_media/animation.py | 10 +++++----- pyrogram/client/types/messages_and_media/audio.py | 10 +++++----- pyrogram/client/types/messages_and_media/document.py | 10 +++++----- pyrogram/client/types/messages_and_media/photo.py | 12 ++++++------ pyrogram/client/types/messages_and_media/sticker.py | 10 +++++----- pyrogram/client/types/messages_and_media/video.py | 10 +++++----- .../client/types/messages_and_media/video_note.py | 10 +++++----- 7 files changed, 36 insertions(+), 36 deletions(-) diff --git a/pyrogram/client/types/messages_and_media/animation.py b/pyrogram/client/types/messages_and_media/animation.py index 0dfbed17..2a9c9e66 100644 --- a/pyrogram/client/types/messages_and_media/animation.py +++ b/pyrogram/client/types/messages_and_media/animation.py @@ -54,11 +54,11 @@ class Animation(Object): date (``int``, *optional*): Date the animation was sent in Unix time. - thumbnails (List of :obj:`Thumbnail`, *optional*): + thumbs (List of :obj:`Thumbnail`, *optional*): Animation thumbnails. """ - __slots__ = ["file_id", "file_name", "mime_type", "file_size", "date", "width", "height", "duration", "thumbnails"] + __slots__ = ["file_id", "file_name", "mime_type", "file_size", "date", "width", "height", "duration", "thumbs"] def __init__( self, @@ -72,7 +72,7 @@ class Animation(Object): mime_type: str = None, file_size: int = None, date: int = None, - thumbnails: List[Thumbnail] = None, + thumbs: List[Thumbnail] = None, ): super().__init__(client) @@ -84,7 +84,7 @@ class Animation(Object): self.width = width self.height = height self.duration = duration - self.thumbnails = thumbnails + self.thumbs = thumbs @staticmethod def _parse( @@ -110,6 +110,6 @@ class Animation(Object): file_size=animation.size, file_name=file_name, date=animation.date, - thumbnails=Thumbnail._parse(client, animation), + thumbs=Thumbnail._parse(client, animation), client=client ) diff --git a/pyrogram/client/types/messages_and_media/audio.py b/pyrogram/client/types/messages_and_media/audio.py index 64e450f4..d6324e83 100644 --- a/pyrogram/client/types/messages_and_media/audio.py +++ b/pyrogram/client/types/messages_and_media/audio.py @@ -54,12 +54,12 @@ class Audio(Object): title (``str``, *optional*): Title of the audio as defined by sender or by audio tags. - thumbnails (List of :obj:`Thumbnail`, *optional*): + thumbs (List of :obj:`Thumbnail`, *optional*): Thumbnails of the music file album cover. """ __slots__ = [ - "file_id", "file_name", "mime_type", "file_size", "date", "duration", "performer", "title", "thumbnails" + "file_id", "file_name", "mime_type", "file_size", "date", "duration", "performer", "title", "thumbs" ] def __init__( @@ -74,7 +74,7 @@ class Audio(Object): date: int = None, performer: str = None, title: str = None, - thumbnails: List[Thumbnail] = None, + thumbs: List[Thumbnail] = None, ): super().__init__(client) @@ -86,7 +86,7 @@ class Audio(Object): self.duration = duration self.performer = performer self.title = title - self.thumbnails = thumbnails + self.thumbs = thumbs @staticmethod def _parse( @@ -112,6 +112,6 @@ class Audio(Object): file_size=audio.size, file_name=file_name, date=audio.date, - thumbnails=Thumbnail._parse(client, audio), + thumbs=Thumbnail._parse(client, audio), client=client ) diff --git a/pyrogram/client/types/messages_and_media/document.py b/pyrogram/client/types/messages_and_media/document.py index ad48a847..023e4204 100644 --- a/pyrogram/client/types/messages_and_media/document.py +++ b/pyrogram/client/types/messages_and_media/document.py @@ -45,11 +45,11 @@ class Document(Object): date (``int``, *optional*): Date the document was sent in Unix time. - thumbnails (List of :obj:`Thumbnail`, *optional*): + thumbs (List of :obj:`Thumbnail`, *optional*): Document thumbnails as defined by sender. """ - __slots__ = ["file_id", "file_name", "mime_type", "file_size", "date", "thumbnails"] + __slots__ = ["file_id", "file_name", "mime_type", "file_size", "date", "thumbs"] def __init__( self, @@ -60,7 +60,7 @@ class Document(Object): mime_type: str = None, file_size: int = None, date: int = None, - thumbnails: List[Thumbnail] = None, + thumbs: List[Thumbnail] = None, ): super().__init__(client) @@ -69,7 +69,7 @@ class Document(Object): self.mime_type = mime_type self.file_size = file_size self.date = date - self.thumbnails = thumbnails + self.thumbs = thumbs @staticmethod def _parse(client, document: types.Document, file_name: str) -> "Document": @@ -87,6 +87,6 @@ class Document(Object): mime_type=document.mime_type, file_size=document.size, date=document.date, - thumbnails=Thumbnail._parse(client, document), + thumbs=Thumbnail._parse(client, document), client=client ) diff --git a/pyrogram/client/types/messages_and_media/photo.py b/pyrogram/client/types/messages_and_media/photo.py index b5d80b82..653fe4c0 100644 --- a/pyrogram/client/types/messages_and_media/photo.py +++ b/pyrogram/client/types/messages_and_media/photo.py @@ -45,11 +45,11 @@ class Photo(Object): date (``int``): Date the photo was sent in Unix time. - thumbnails (List of :obj:`Thumbnail`): - Available sizes of this photo. + thumbs (List of :obj:`Thumbnail`, *optional*): + Available thumbnails of this photo. """ - __slots__ = ["file_id", "width", "height", "file_size", "date", "thumbnails"] + __slots__ = ["file_id", "width", "height", "file_size", "date", "thumbs"] def __init__( self, @@ -60,7 +60,7 @@ class Photo(Object): height: int, file_size: int, date: int, - thumbnails: List[Thumbnail] + thumbs: List[Thumbnail] ): super().__init__(client) @@ -69,7 +69,7 @@ class Photo(Object): self.height = height self.file_size = file_size self.date = date - self.thumbnails = thumbnails + self.thumbs = thumbs @staticmethod def _parse(client, photo: types.Photo) -> "Photo": @@ -89,6 +89,6 @@ class Photo(Object): height=big.h, file_size=big.size, date=photo.date, - thumbnails=Thumbnail._parse(client, photo), + thumbs=Thumbnail._parse(client, photo), client=client ) diff --git a/pyrogram/client/types/messages_and_media/sticker.py b/pyrogram/client/types/messages_and_media/sticker.py index 9e528dd8..3c171543 100644 --- a/pyrogram/client/types/messages_and_media/sticker.py +++ b/pyrogram/client/types/messages_and_media/sticker.py @@ -59,14 +59,14 @@ class Sticker(Object): set_name (``str``, *optional*): Name of the sticker set to which the sticker belongs. - thumbnails (List of :obj:`Thumbnail`, *optional*): + thumbs (List of :obj:`Thumbnail`, *optional*): Sticker thumbnails in the .webp or .jpg format. """ # TODO: Add mask position __slots__ = [ - "file_id", "file_name", "mime_type", "file_size", "date", "width", "height", "emoji", "set_name", "thumbnails" + "file_id", "file_name", "mime_type", "file_size", "date", "width", "height", "emoji", "set_name", "thumbs" ] def __init__( @@ -82,7 +82,7 @@ class Sticker(Object): date: int = None, emoji: str = None, set_name: str = None, - thumbnails: List[Thumbnail] = None + thumbs: List[Thumbnail] = None ): super().__init__(client) @@ -95,7 +95,7 @@ class Sticker(Object): self.height = height self.emoji = emoji self.set_name = set_name, - self.thumbnails = thumbnails + self.thumbs = thumbs # self.mask_position = mask_position @staticmethod @@ -143,6 +143,6 @@ class Sticker(Object): mime_type=sticker.mime_type, file_name=file_name, date=sticker.date, - thumbnails=Thumbnail._parse(client, sticker), + thumbs=Thumbnail._parse(client, sticker), client=client ) diff --git a/pyrogram/client/types/messages_and_media/video.py b/pyrogram/client/types/messages_and_media/video.py index feda9711..0a7f47cd 100644 --- a/pyrogram/client/types/messages_and_media/video.py +++ b/pyrogram/client/types/messages_and_media/video.py @@ -57,13 +57,13 @@ class Video(Object): date (``int``, *optional*): Date the video was sent in Unix time. - thumbnails (List of :obj:`Thumbnail`, *optional*): + thumbs (List of :obj:`Thumbnail`, *optional*): Video thumbnails. """ __slots__ = [ "file_id", "width", "height", "duration", "file_name", "mime_type", "supports_streaming", "file_size", "date", - "thumbnails" + "thumbs" ] def __init__( @@ -79,7 +79,7 @@ class Video(Object): supports_streaming: bool = None, file_size: int = None, date: int = None, - thumbnails: List[Thumbnail] = None + thumbs: List[Thumbnail] = None ): super().__init__(client) @@ -92,7 +92,7 @@ class Video(Object): self.supports_streaming = supports_streaming self.file_size = file_size self.date = date - self.thumbnails = thumbnails + self.thumbs = thumbs @staticmethod def _parse( @@ -119,6 +119,6 @@ class Video(Object): supports_streaming=video_attributes.supports_streaming, file_size=video.size, date=video.date, - thumbnails=Thumbnail._parse(client, video), + thumbs=Thumbnail._parse(client, video), client=client ) diff --git a/pyrogram/client/types/messages_and_media/video_note.py b/pyrogram/client/types/messages_and_media/video_note.py index b1d9bcdb..54c9ec8d 100644 --- a/pyrogram/client/types/messages_and_media/video_note.py +++ b/pyrogram/client/types/messages_and_media/video_note.py @@ -48,11 +48,11 @@ class VideoNote(Object): date (``int``, *optional*): Date the video note was sent in Unix time. - thumbnails (List of :obj:`Thumbnail`, *optional*): + thumbs (List of :obj:`Thumbnail`, *optional*): Video thumbnails. """ - __slots__ = ["file_id", "mime_type", "file_size", "date", "length", "duration", "thumbnails"] + __slots__ = ["file_id", "mime_type", "file_size", "date", "length", "duration", "thumbs"] def __init__( self, @@ -61,7 +61,7 @@ class VideoNote(Object): file_id: str, length: int, duration: int, - thumbnails: List[Thumbnail] = None, + thumbs: List[Thumbnail] = None, mime_type: str = None, file_size: int = None, date: int = None @@ -74,7 +74,7 @@ class VideoNote(Object): self.date = date self.length = length self.duration = duration - self.thumbnails = thumbnails + self.thumbs = thumbs @staticmethod def _parse(client, video_note: types.Document, video_attributes: types.DocumentAttributeVideo) -> "VideoNote": @@ -93,6 +93,6 @@ class VideoNote(Object): file_size=video_note.size, mime_type=video_note.mime_type, date=video_note.date, - thumbnails=Thumbnail._parse(client, video_note), + thumbs=Thumbnail._parse(client, video_note), client=client ) From 8151270a94df19eb5e40f7d93fd1975185adb201 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 6 Jun 2019 18:25:23 +0200 Subject: [PATCH 3/5] Update docs --- docs/releases.py | 9 +++++++-- docs/source/faq.rst | 2 +- docs/source/index.rst | 4 ++-- docs/source/start/auth.rst | 4 ++-- pyrogram/client/types/inline_mode/inline_query_result.py | 2 +- .../types/input_message_content/input_message_content.py | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/releases.py b/docs/releases.py index 98563ccd..0c284f0b 100644 --- a/docs/releases.py +++ b/docs/releases.py @@ -58,7 +58,7 @@ with open(DEST / "index.rst", "w") as index: date = datetime.strptime( release["published_at"], "%Y-%m-%dT%H:%M:%SZ" - ).strftime("%b %d, %Y - %H:%M:%S (UTC)") + ).strftime("%b %d, %Y") body = pypandoc.convert_text( release["body"].replace(r"\r\n", "\n"), @@ -67,12 +67,17 @@ with open(DEST / "index.rst", "w") as index: extra_args=["--wrap=none"] ) + tarball_url = release["tarball_url"] + zipball_url = release["zipball_url"] + index.write("- :doc:`{} <{}>`\n".format(title, tag)) tags.append(tag) with open(DEST / "{}.rst".format(tag), "w") as page: page.write("Pyrogram " + tag + "\n" + "=" * (len(tag) + 9) + "\n\n") - page.write("--- *Released on " + str(date) + "*\n\n") + page.write("\t\tReleased on " + str(date) + "\n\n") + page.write("- :download:`Source Code (zip) <{}>`\n".format(zipball_url)) + page.write("- :download:`Source Code (tar.gz) <{}>`\n\n".format(tarball_url)) page.write(name + "\n" + "-" * len(name) + "\n\n") page.write(body + "\n\n") diff --git a/docs/source/faq.rst b/docs/source/faq.rst index 6c3cc1ab..1800a032 100644 --- a/docs/source/faq.rst +++ b/docs/source/faq.rst @@ -197,7 +197,7 @@ And here's a good explanation of how, probably, the system works: data-width="100%"> -.. centered:: Join the discussion at `@PyrogramChat `_ +.. centered:: Join the discussion at `@Pyrogram `_ However, you might be right, and your account was deactivated/limited without any good reason. This could happen because of mistakes by either the automatic systems or a moderator. In such cases you can kindly email Telegram at diff --git a/docs/source/index.rst b/docs/source/index.rst index a2e08cd0..0bc175ee 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -50,8 +50,8 @@ How the Documentation is Organized ---------------------------------- Contents are organized into self-contained topics and can be all accessed from the sidebar, or by following them in -order using the Next button at the end of each page. Here below you can, instead, find a list of the most relevant -pages for a quick access. +order using the :guilabel:`Next` button at the end of each page. Here below you can, instead, find a list of the most +relevant pages for a quick access. First Steps ----------- diff --git a/docs/source/start/auth.rst b/docs/source/start/auth.rst index 79264bfa..ca1ddd8f 100644 --- a/docs/source/start/auth.rst +++ b/docs/source/start/auth.rst @@ -39,8 +39,8 @@ keep the session alive, Pyrogram won't ask you again to enter your phone number. .. note:: - The code above does nothing except asking for credentials and keeping the client online, hit ``CTRL+C`` now to stop - your application and keep reading. + The code above does nothing except asking for credentials and keeping the client online, hit :guilabel:`CTRL+C` now + to stop your application and keep reading. Bot Authorization ----------------- diff --git a/pyrogram/client/types/inline_mode/inline_query_result.py b/pyrogram/client/types/inline_mode/inline_query_result.py index 74fe77d3..3fc70885 100644 --- a/pyrogram/client/types/inline_mode/inline_query_result.py +++ b/pyrogram/client/types/inline_mode/inline_query_result.py @@ -42,7 +42,7 @@ from ..object import Object class InlineQueryResult(Object): """One result of an inline query. - Pyrogram currently supports results of the following 20 types: + Pyrogram currently supports results of the following types: - :obj:`InlineQueryResultArticle` """ diff --git a/pyrogram/client/types/input_message_content/input_message_content.py b/pyrogram/client/types/input_message_content/input_message_content.py index 1941ffb5..fe11ef7a 100644 --- a/pyrogram/client/types/input_message_content/input_message_content.py +++ b/pyrogram/client/types/input_message_content/input_message_content.py @@ -26,7 +26,7 @@ from ..object import Object class InputMessageContent(Object): """Content of a message to be sent as a result of an inline query. - Pyrogram currently supports the following 4 types: + Pyrogram currently supports the following types: - :obj:`InputTextMessageContent` """ From b205c6cce08ef5866310b3572118d0b3866f3f31 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 6 Jun 2019 19:09:52 +0200 Subject: [PATCH 4/5] Rename Photos to ProfilePhotos --- docs/source/api/types.rst | 4 ++-- .../client/methods/users/get_profile_photos.py | 10 +++++----- .../client/types/messages_and_media/__init__.py | 5 +++-- .../{photos.py => profile_photos.py} | 16 ++++++++-------- 4 files changed, 18 insertions(+), 17 deletions(-) rename pyrogram/client/types/messages_and_media/{photos.py => profile_photos.py} (79%) diff --git a/docs/source/api/types.rst b/docs/source/api/types.rst index 15f81ae7..4eef9638 100644 --- a/docs/source/api/types.rst +++ b/docs/source/api/types.rst @@ -45,7 +45,7 @@ Messages & Media - :class:`Messages` - :class:`MessageEntity` - :class:`Photo` - - :class:`Photos` + - :class:`ProfilePhotos` - :class:`Thumbnail` - :class:`Audio` - :class:`Document` @@ -133,7 +133,7 @@ Details .. autoclass:: Messages() .. autoclass:: MessageEntity() .. autoclass:: Photo() -.. autoclass:: Photos() +.. autoclass:: ProfilePhotos() .. autoclass:: Thumbnail() .. autoclass:: Audio() .. autoclass:: Document() diff --git a/pyrogram/client/methods/users/get_profile_photos.py b/pyrogram/client/methods/users/get_profile_photos.py index d45bd5b6..e4e202e0 100644 --- a/pyrogram/client/methods/users/get_profile_photos.py +++ b/pyrogram/client/methods/users/get_profile_photos.py @@ -29,7 +29,7 @@ class GetProfilePhotos(BaseClient): chat_id: Union[int, str], offset: int = 0, limit: int = 100 - ) -> "pyrogram.Photos": + ) -> "pyrogram.ProfilePhotos": """Get a list of profile pictures for a user or a chat. Parameters: @@ -47,7 +47,7 @@ class GetProfilePhotos(BaseClient): Values between 1—100 are accepted. Defaults to 100. Returns: - :obj:`Photos`: On success, an object containing a list of the profile photos is returned. + :obj:`ProfilePhotos`: On success, an object containing a list of the profile photos is returned. Raises: RPCError: In case of a Telegram RPC error. @@ -55,7 +55,7 @@ class GetProfilePhotos(BaseClient): peer_id = self.resolve_peer(chat_id) if isinstance(peer_id, types.InputPeerUser): - return pyrogram.Photos._parse( + return pyrogram.ProfilePhotos._parse( self, self.send( functions.photos.GetUserPhotos( @@ -86,7 +86,7 @@ class GetProfilePhotos(BaseClient): ) ) - return pyrogram.Photos( + return pyrogram.ProfilePhotos( total_count=new_chat_photos.total_count, - photos=[m.new_chat_photo for m in new_chat_photos.messages][:limit] + profile_photos=[m.new_chat_photo for m in new_chat_photos.messages][:limit] ) diff --git a/pyrogram/client/types/messages_and_media/__init__.py b/pyrogram/client/types/messages_and_media/__init__.py index d312611b..17a6e36a 100644 --- a/pyrogram/client/types/messages_and_media/__init__.py +++ b/pyrogram/client/types/messages_and_media/__init__.py @@ -28,10 +28,10 @@ from .messages import Messages from .photo import Photo from .poll import Poll from .poll_option import PollOption +from .profile_photos import ProfilePhotos from .sticker import Sticker from .stripped_thumbnail import StrippedThumbnail from .thumbnail import Thumbnail -from .photos import Photos from .venue import Venue from .video import Video from .video_note import VideoNote @@ -39,5 +39,6 @@ from .voice import Voice __all__ = [ "Animation", "Audio", "Contact", "Document", "Game", "Location", "Message", "MessageEntity", "Messages", "Photo", - "Thumbnail", "StrippedThumbnail", "Poll", "PollOption", "Sticker", "Photos", "Venue", "Video", "VideoNote", "Voice" + "Thumbnail", "StrippedThumbnail", "Poll", "PollOption", "Sticker", "ProfilePhotos", "Venue", "Video", "VideoNote", + "Voice" ] diff --git a/pyrogram/client/types/messages_and_media/photos.py b/pyrogram/client/types/messages_and_media/profile_photos.py similarity index 79% rename from pyrogram/client/types/messages_and_media/photos.py rename to pyrogram/client/types/messages_and_media/profile_photos.py index a1803923..11b8e4dd 100644 --- a/pyrogram/client/types/messages_and_media/photos.py +++ b/pyrogram/client/types/messages_and_media/profile_photos.py @@ -23,35 +23,35 @@ from .photo import Photo from ..object import Object -class Photos(Object): +class ProfilePhotos(Object): """Contains a user's profile pictures. Parameters: total_count (``int``): Total number of profile pictures the target user has. - photos (List of :obj:`Photo`): + profile_photos (List of :obj:`Photo`): Requested profile pictures. """ - __slots__ = ["total_count", "photos"] + __slots__ = ["total_count", "profile_photos"] def __init__( self, *, client: "pyrogram.BaseClient" = None, total_count: int, - photos: List[Photo] + profile_photos: List[Photo] ): super().__init__(client) self.total_count = total_count - self.photos = photos + self.profile_photos = profile_photos @staticmethod - def _parse(client, photos) -> "Photos": - return Photos( + def _parse(client, photos) -> "ProfilePhotos": + return ProfilePhotos( total_count=getattr(photos, "count", len(photos.photos)), - photos=[Photo._parse(client, photo) for photo in photos.photos], + profile_photos=[Photo._parse(client, photo) for photo in photos.photos], client=client ) From da515af9597f9533d9315ace6096c7cb22fe122c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 6 Jun 2019 19:29:44 +0200 Subject: [PATCH 5/5] Rearrange code --- compiler/api/compiler.py | 6 ++--- pyrogram/api/core/__init__.py | 2 +- pyrogram/api/core/future_salt.py | 2 +- pyrogram/api/core/future_salts.py | 2 +- pyrogram/api/core/gzip_packed.py | 2 +- pyrogram/api/core/message.py | 2 +- pyrogram/api/core/msg_container.py | 2 +- .../methods/bots/get_inline_bot_results.py | 2 +- pyrogram/client/methods/chats/__init__.py | 2 +- pyrogram/client/methods/users/get_user_dc.py | 1 - .../todo/inline_query_result_audio.py | 3 ++- .../todo/inline_query_result_cached_audio.py | 2 +- .../inline_query_result_cached_document.py | 3 ++- .../todo/inline_query_result_cached_gif.py | 3 ++- .../inline_query_result_cached_mpeg4_gif.py | 3 ++- .../todo/inline_query_result_cached_photo.py | 3 ++- .../todo/inline_query_result_cached_video.py | 3 ++- .../todo/inline_query_result_cached_voice.py | 3 ++- .../todo/inline_query_result_contact.py | 4 +++- .../todo/inline_query_result_document.py | 4 +++- .../todo/inline_query_result_gif.py | 4 +++- .../todo/inline_query_result_location.py | 4 +++- .../todo/inline_query_result_mpeg4_gif.py | 4 +++- .../todo/inline_query_result_photo.py | 24 +++++++++---------- .../todo/inline_query_result_venue.py | 4 +++- .../todo/inline_query_result_video.py | 4 +++- .../todo/inline_query_result_voice.py | 3 ++- .../types/input_media/input_phone_contact.py | 1 + .../client/types/keyboards/force_reply.py | 1 + .../client/types/keyboards/keyboard_button.py | 1 + .../types/keyboards/reply_keyboard_remove.py | 1 + 31 files changed, 65 insertions(+), 40 deletions(-) diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index 0ecc9212..3995fd5f 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -288,9 +288,9 @@ def start(): sorted_args = sort_args(c.args) arguments = ( - ", " - + ("*, " if c.args else "") - + (", ".join([get_argument_type(i) for i in sorted_args if i != ("flags", "#")]) if c.args else "") + ", " + + ("*, " if c.args else "") + + (", ".join([get_argument_type(i) for i in sorted_args if i != ("flags", "#")]) if c.args else "") ) fields = "\n ".join( diff --git a/pyrogram/api/core/__init__.py b/pyrogram/api/core/__init__.py index f27a26a5..aaf5a324 100644 --- a/pyrogram/api/core/__init__.py +++ b/pyrogram/api/core/__init__.py @@ -22,8 +22,8 @@ from .gzip_packed import GzipPacked from .list import List from .message import Message from .msg_container import MsgContainer -from .tl_object import TLObject from .primitives import ( Bool, BoolTrue, BoolFalse, Bytes, Double, Int, Long, Int128, Int256, Null, String, Vector ) +from .tl_object import TLObject diff --git a/pyrogram/api/core/future_salt.py b/pyrogram/api/core/future_salt.py index 699a416f..ab387f6c 100644 --- a/pyrogram/api/core/future_salt.py +++ b/pyrogram/api/core/future_salt.py @@ -18,8 +18,8 @@ from io import BytesIO -from .tl_object import TLObject from .primitives import Int, Long +from .tl_object import TLObject class FutureSalt(TLObject): diff --git a/pyrogram/api/core/future_salts.py b/pyrogram/api/core/future_salts.py index c749c569..a97b9d2a 100644 --- a/pyrogram/api/core/future_salts.py +++ b/pyrogram/api/core/future_salts.py @@ -19,8 +19,8 @@ from io import BytesIO from . import FutureSalt -from .tl_object import TLObject from .primitives import Int, Long +from .tl_object import TLObject class FutureSalts(TLObject): diff --git a/pyrogram/api/core/gzip_packed.py b/pyrogram/api/core/gzip_packed.py index 4b212184..5a8e76da 100644 --- a/pyrogram/api/core/gzip_packed.py +++ b/pyrogram/api/core/gzip_packed.py @@ -19,8 +19,8 @@ from gzip import compress, decompress from io import BytesIO -from .tl_object import TLObject from .primitives import Int, Bytes +from .tl_object import TLObject class GzipPacked(TLObject): diff --git a/pyrogram/api/core/message.py b/pyrogram/api/core/message.py index db123db3..1b9b55f1 100644 --- a/pyrogram/api/core/message.py +++ b/pyrogram/api/core/message.py @@ -18,8 +18,8 @@ from io import BytesIO -from .tl_object import TLObject from .primitives import Int, Long +from .tl_object import TLObject class Message(TLObject): diff --git a/pyrogram/api/core/msg_container.py b/pyrogram/api/core/msg_container.py index 7a17087e..58732403 100644 --- a/pyrogram/api/core/msg_container.py +++ b/pyrogram/api/core/msg_container.py @@ -19,8 +19,8 @@ from io import BytesIO from .message import Message -from .tl_object import TLObject from .primitives import Int +from .tl_object import TLObject class MsgContainer(TLObject): diff --git a/pyrogram/client/methods/bots/get_inline_bot_results.py b/pyrogram/client/methods/bots/get_inline_bot_results.py index 307238e3..cc0fc1b1 100644 --- a/pyrogram/client/methods/bots/get_inline_bot_results.py +++ b/pyrogram/client/methods/bots/get_inline_bot_results.py @@ -19,8 +19,8 @@ from typing import Union from pyrogram.api import functions, types -from pyrogram.errors import UnknownError from pyrogram.client.ext import BaseClient +from pyrogram.errors import UnknownError class GetInlineBotResults(BaseClient): diff --git a/pyrogram/client/methods/chats/__init__.py b/pyrogram/client/methods/chats/__init__.py index 698255f5..c0176939 100644 --- a/pyrogram/client/methods/chats/__init__.py +++ b/pyrogram/client/methods/chats/__init__.py @@ -23,6 +23,7 @@ from .get_chat_member import GetChatMember from .get_chat_members import GetChatMembers from .get_chat_members_count import GetChatMembersCount from .get_dialogs import GetDialogs +from .get_dialogs_count import GetDialogsCount from .iter_chat_members import IterChatMembers from .iter_dialogs import IterDialogs from .join_chat import JoinChat @@ -38,7 +39,6 @@ from .set_chat_title import SetChatTitle from .unban_chat_member import UnbanChatMember from .unpin_chat_message import UnpinChatMessage from .update_chat_username import UpdateChatUsername -from .get_dialogs_count import GetDialogsCount class Chats( diff --git a/pyrogram/client/methods/users/get_user_dc.py b/pyrogram/client/methods/users/get_user_dc.py index 49596c11..89e97526 100644 --- a/pyrogram/client/methods/users/get_user_dc.py +++ b/pyrogram/client/methods/users/get_user_dc.py @@ -19,7 +19,6 @@ from typing import Union from pyrogram.api import functions, types - from ...ext import BaseClient diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_audio.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_audio.py index dbda676d..d5fb954a 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_audio.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_audio.py @@ -58,7 +58,8 @@ class InlineQueryResultAudio(Object): """ - def __init__(self, type: str, id: str, audio_url: str, title: str, caption: str = None, parse_mode: str = None, performer: str = None, audio_duration: int = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, audio_url: str, title: str, caption: str = None, parse_mode: str = None, + performer: str = None, audio_duration: int = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.audio_url = audio_url # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_audio.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_audio.py index a4ac1ec8..47b9bbe2 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_audio.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_audio.py @@ -20,10 +20,10 @@ import binascii import struct from pyrogram.api import types -from pyrogram.errors import FileIdInvalid from pyrogram.client.ext import utils, BaseClient from pyrogram.client.style import HTML, Markdown from pyrogram.client.types.object import Object +from pyrogram.errors import FileIdInvalid class InlineQueryResultCachedAudio(Object): diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_document.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_document.py index 0dfde1c4..d3b3d0dc 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_document.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_document.py @@ -56,7 +56,8 @@ class InlineQueryResultCachedDocument(Object): """ ID = 0xb0700015 - def __init__(self, type: str, id: str, title: str, document_file_id: str, description: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, title: str, document_file_id: str, description: str = None, + caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.title = title # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_gif.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_gif.py index 819b383f..28a3595b 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_gif.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_gif.py @@ -53,7 +53,8 @@ class InlineQueryResultCachedGif(Object): """ ID = 0xb0700012 - def __init__(self, type: str, id: str, gif_file_id: str, title: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, gif_file_id: str, title: str = None, caption: str = None, + parse_mode: str = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.gif_file_id = gif_file_id # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_mpeg4_gif.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_mpeg4_gif.py index 9856af66..95ab03a0 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_mpeg4_gif.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_mpeg4_gif.py @@ -53,7 +53,8 @@ class InlineQueryResultCachedMpeg4Gif(Object): """ ID = 0xb0700013 - def __init__(self, type: str, id: str, mpeg4_file_id: str, title: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, mpeg4_file_id: str, title: str = None, caption: str = None, + parse_mode: str = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.mpeg4_file_id = mpeg4_file_id # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_photo.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_photo.py index 53b479f9..22793cef 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_photo.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_photo.py @@ -56,7 +56,8 @@ class InlineQueryResultCachedPhoto(Object): """ ID = 0xb0700011 - def __init__(self, type: str, id: str, photo_file_id: str, title: str = None, description: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, photo_file_id: str, title: str = None, description: str = None, + caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.photo_file_id = photo_file_id # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_video.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_video.py index 3a04a766..77dcd6dd 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_video.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_video.py @@ -56,7 +56,8 @@ class InlineQueryResultCachedVideo(Object): """ ID = 0xb0700016 - def __init__(self, type: str, id: str, video_file_id: str, title: str, description: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, video_file_id: str, title: str, description: str = None, caption: str = None, + parse_mode: str = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.video_file_id = video_file_id # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_voice.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_voice.py index fbdf6c19..a80d5a20 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_voice.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_voice.py @@ -53,7 +53,8 @@ class InlineQueryResultCachedVoice(Object): """ ID = 0xb0700017 - def __init__(self, type: str, id: str, voice_file_id: str, title: str, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, voice_file_id: str, title: str, caption: str = None, parse_mode: str = None, + reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.voice_file_id = voice_file_id # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_contact.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_contact.py index a64d6ace..afddb9ec 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_contact.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_contact.py @@ -62,7 +62,9 @@ class InlineQueryResultContact(Object): """ ID = 0xb0700009 - def __init__(self, type: str, id: str, phone_number: str, first_name: str, last_name: str = None, vcard: str = None, reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, thumb_height: int = None): + def __init__(self, type: str, id: str, phone_number: str, first_name: str, last_name: str = None, vcard: str = None, + reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, + thumb_height: int = None): self.type = type # string self.id = id # string self.phone_number = phone_number # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_document.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_document.py index 007f237b..370dc3c6 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_document.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_document.py @@ -68,7 +68,9 @@ class InlineQueryResultDocument(Object): """ ID = 0xb0700006 - def __init__(self, type: str, id: str, title: str, document_url: str, mime_type: str, caption: str = None, parse_mode: str = None, description: str = None, reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, thumb_height: int = None): + def __init__(self, type: str, id: str, title: str, document_url: str, mime_type: str, caption: str = None, + parse_mode: str = None, description: str = None, reply_markup=None, input_message_content=None, + thumb_url: str = None, thumb_width: int = None, thumb_height: int = None): self.type = type # string self.id = id # string self.title = title # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_gif.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_gif.py index 7273b79a..56817d76 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_gif.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_gif.py @@ -65,7 +65,9 @@ class InlineQueryResultGif(Object): """ ID = 0xb0700001 - def __init__(self, type: str, id: str, gif_url: str, thumb_url: str, gif_width: int = None, gif_height: int = None, gif_duration: int = None, title: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, gif_url: str, thumb_url: str, gif_width: int = None, gif_height: int = None, + gif_duration: int = None, title: str = None, caption: str = None, parse_mode: str = None, + reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.gif_url = gif_url # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_location.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_location.py index a32fc93d..74c63ede 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_location.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_location.py @@ -62,7 +62,9 @@ class InlineQueryResultLocation(Object): """ ID = 0xb0700007 - def __init__(self, type: str, id: str, latitude: float, longitude: float, title: str, live_period: int = None, reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, thumb_height: int = None): + def __init__(self, type: str, id: str, latitude: float, longitude: float, title: str, live_period: int = None, + reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, + thumb_height: int = None): self.type = type # string self.id = id # string self.latitude = latitude # double diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_mpeg4_gif.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_mpeg4_gif.py index 04c68cf7..e4da6b89 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_mpeg4_gif.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_mpeg4_gif.py @@ -65,7 +65,9 @@ class InlineQueryResultMpeg4Gif(Object): """ ID = 0xb0700002 - def __init__(self, type: str, id: str, mpeg4_url: str, thumb_url: str, mpeg4_width: int = None, mpeg4_height: int = None, mpeg4_duration: int = None, title: str = None, caption: str = None, parse_mode: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, mpeg4_url: str, thumb_url: str, mpeg4_width: int = None, + mpeg4_height: int = None, mpeg4_duration: int = None, title: str = None, caption: str = None, + parse_mode: str = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.mpeg4_url = mpeg4_url # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_photo.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_photo.py index 57f36fae..570bd55d 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_photo.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_photo.py @@ -63,18 +63,18 @@ class InlineQueryResultPhoto(Object): """ def __init__( - self, - id: str, - photo_url: str, - thumb_url: str, - photo_width: int = 0, - photo_height: int = 0, - title: str = None, - description: str = None, - caption: str = "", - parse_mode: str = "", - reply_markup=None, - input_message_content=None + self, + id: str, + photo_url: str, + thumb_url: str, + photo_width: int = 0, + photo_height: int = 0, + title: str = None, + description: str = None, + caption: str = "", + parse_mode: str = "", + reply_markup=None, + input_message_content=None ): self.id = id # string self.photo_url = photo_url # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_venue.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_venue.py index 3343ccf9..29eb86a6 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_venue.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_venue.py @@ -68,7 +68,9 @@ class InlineQueryResultVenue(Object): """ ID = 0xb0700008 - def __init__(self, type: str, id: str, latitude: float, longitude: float, title: str, address: str, foursquare_id: str = None, foursquare_type: str = None, reply_markup=None, input_message_content=None, thumb_url: str = None, thumb_width: int = None, thumb_height: int = None): + def __init__(self, type: str, id: str, latitude: float, longitude: float, title: str, address: str, + foursquare_id: str = None, foursquare_type: str = None, reply_markup=None, input_message_content=None, + thumb_url: str = None, thumb_width: int = None, thumb_height: int = None): self.type = type # string self.id = id # string self.latitude = latitude # double diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_video.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_video.py index ebfe2047..61984d48 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_video.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_video.py @@ -71,7 +71,9 @@ class InlineQueryResultVideo(Object): """ ID = 0xb0700003 - def __init__(self, type: str, id: str, video_url: str, mime_type: str, thumb_url: str, title: str, caption: str = None, parse_mode: str = None, video_width: int = None, video_height: int = None, video_duration: int = None, description: str = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, video_url: str, mime_type: str, thumb_url: str, title: str, + caption: str = None, parse_mode: str = None, video_width: int = None, video_height: int = None, + video_duration: int = None, description: str = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.video_url = video_url # string diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_voice.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_voice.py index 4e2bbb09..7a5f3cd1 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_voice.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_voice.py @@ -56,7 +56,8 @@ class InlineQueryResultVoice(Object): """ ID = 0xb0700005 - def __init__(self, type: str, id: str, voice_url: str, title: str, caption: str = None, parse_mode: str = None, voice_duration: int = None, reply_markup=None, input_message_content=None): + def __init__(self, type: str, id: str, voice_url: str, title: str, caption: str = None, parse_mode: str = None, + voice_duration: int = None, reply_markup=None, input_message_content=None): self.type = type # string self.id = id # string self.voice_url = voice_url # string diff --git a/pyrogram/client/types/input_media/input_phone_contact.py b/pyrogram/client/types/input_media/input_phone_contact.py index e49cee30..f60dd39d 100644 --- a/pyrogram/client/types/input_media/input_phone_contact.py +++ b/pyrogram/client/types/input_media/input_phone_contact.py @@ -17,6 +17,7 @@ # along with Pyrogram. If not, see . from pyrogram.api.types import InputPhoneContact as RawInputPhoneContact + from pyrogram.session.internals import MsgId from ..object import Object diff --git a/pyrogram/client/types/keyboards/force_reply.py b/pyrogram/client/types/keyboards/force_reply.py index 59405529..6c542aa8 100644 --- a/pyrogram/client/types/keyboards/force_reply.py +++ b/pyrogram/client/types/keyboards/force_reply.py @@ -17,6 +17,7 @@ # along with Pyrogram. If not, see . from pyrogram.api.types import ReplyKeyboardForceReply + from ..object import Object diff --git a/pyrogram/client/types/keyboards/keyboard_button.py b/pyrogram/client/types/keyboards/keyboard_button.py index 2dc09f5d..8374db1b 100644 --- a/pyrogram/client/types/keyboards/keyboard_button.py +++ b/pyrogram/client/types/keyboards/keyboard_button.py @@ -18,6 +18,7 @@ from pyrogram.api.types import KeyboardButton as RawKeyboardButton from pyrogram.api.types import KeyboardButtonRequestPhone, KeyboardButtonRequestGeoLocation + from ..object import Object diff --git a/pyrogram/client/types/keyboards/reply_keyboard_remove.py b/pyrogram/client/types/keyboards/reply_keyboard_remove.py index 8dd84f72..d451a8e8 100644 --- a/pyrogram/client/types/keyboards/reply_keyboard_remove.py +++ b/pyrogram/client/types/keyboards/reply_keyboard_remove.py @@ -17,6 +17,7 @@ # along with Pyrogram. If not, see . from pyrogram.api.types import ReplyKeyboardHide + from ..object import Object