From 9a44c79a82080de0ecb11728f4f4259c30db9577 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 3 Jun 2019 16:56:37 +0200 Subject: [PATCH] Rename PyrogramType to Object --- .../client/types/inline_mode/inline_query.py | 4 +- .../types/inline_mode/inline_query_result.py | 4 +- .../todo/inline_query_result_audio.py | 4 +- .../todo/inline_query_result_cached_audio.py | 4 +- .../inline_query_result_cached_document.py | 4 +- .../todo/inline_query_result_cached_gif.py | 4 +- .../inline_query_result_cached_mpeg4_gif.py | 4 +- .../todo/inline_query_result_cached_photo.py | 4 +- .../inline_query_result_cached_sticker.py | 4 +- .../todo/inline_query_result_cached_video.py | 4 +- .../todo/inline_query_result_cached_voice.py | 4 +- .../todo/inline_query_result_contact.py | 4 +- .../todo/inline_query_result_document.py | 4 +- .../todo/inline_query_result_game.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 | 4 +- .../todo/inline_query_result_venue.py | 4 +- .../todo/inline_query_result_video.py | 4 +- .../todo/inline_query_result_voice.py | 4 +- .../client/types/input_media/input_media.py | 4 +- .../types/input_media/input_phone_contact.py | 4 +- .../input_message_content.py | 4 +- .../client/types/keyboards/callback_game.py | 4 +- .../client/types/keyboards/callback_query.py | 4 +- .../client/types/keyboards/force_reply.py | 4 +- .../client/types/keyboards/game_high_score.py | 4 +- .../types/keyboards/game_high_scores.py | 4 +- .../types/keyboards/inline_keyboard_button.py | 4 +- .../types/keyboards/inline_keyboard_markup.py | 4 +- .../client/types/keyboards/keyboard_button.py | 4 +- .../types/keyboards/reply_keyboard_markup.py | 4 +- .../types/keyboards/reply_keyboard_remove.py | 4 +- .../types/{pyrogram_list.py => list.py} | 8 +-- .../types/messages_and_media/animation.py | 4 +- .../client/types/messages_and_media/audio.py | 4 +- .../types/messages_and_media/contact.py | 4 +- .../types/messages_and_media/document.py | 4 +- .../client/types/messages_and_media/game.py | 4 +- .../types/messages_and_media/location.py | 4 +- .../types/messages_and_media/message.py | 4 +- .../messages_and_media/message_entity.py | 4 +- .../types/messages_and_media/messages.py | 4 +- .../client/types/messages_and_media/photo.py | 4 +- .../client/types/messages_and_media/photos.py | 4 +- .../client/types/messages_and_media/poll.py | 4 +- .../types/messages_and_media/poll_option.py | 4 +- .../types/messages_and_media/sticker.py | 4 +- .../messages_and_media/stripped_thumbnail.py | 4 +- .../types/messages_and_media/thumbnail.py | 4 +- .../client/types/messages_and_media/venue.py | 4 +- .../client/types/messages_and_media/video.py | 4 +- .../types/messages_and_media/video_note.py | 4 +- .../client/types/messages_and_media/voice.py | 4 +- .../types/{pyrogram_type.py => object.py} | 63 +++++++++++-------- pyrogram/client/types/user_and_chats/chat.py | 4 +- .../types/user_and_chats/chat_member.py | 4 +- .../types/user_and_chats/chat_members.py | 4 +- .../types/user_and_chats/chat_permissions.py | 4 +- .../client/types/user_and_chats/chat_photo.py | 4 +- .../types/user_and_chats/chat_preview.py | 4 +- .../client/types/user_and_chats/dialog.py | 4 +- .../client/types/user_and_chats/dialogs.py | 4 +- pyrogram/client/types/user_and_chats/user.py | 4 +- .../types/user_and_chats/user_status.py | 4 +- 66 files changed, 168 insertions(+), 159 deletions(-) rename pyrogram/client/types/{pyrogram_list.py => list.py} (85%) rename pyrogram/client/types/{pyrogram_type.py => object.py} (63%) diff --git a/pyrogram/client/types/inline_mode/inline_query.py b/pyrogram/client/types/inline_mode/inline_query.py index 1985a0c0..6bfc58c3 100644 --- a/pyrogram/client/types/inline_mode/inline_query.py +++ b/pyrogram/client/types/inline_mode/inline_query.py @@ -22,12 +22,12 @@ import pyrogram from pyrogram.api import types from .inline_query_result import InlineQueryResult from ..messages_and_media import Location -from ..pyrogram_type import PyrogramType +from ..object import Object from ..update import Update from ..user_and_chats import User -class InlineQuery(PyrogramType, Update): +class InlineQuery(Object, Update): """An incoming inline query. When the user sends an empty query, your bot could return some default or trending results. diff --git a/pyrogram/client/types/inline_mode/inline_query_result.py b/pyrogram/client/types/inline_mode/inline_query_result.py index 4b7f7ca3..74fe77d3 100644 --- a/pyrogram/client/types/inline_mode/inline_query_result.py +++ b/pyrogram/client/types/inline_mode/inline_query_result.py @@ -16,7 +16,7 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from ..pyrogram_type import PyrogramType +from ..object import Object """- :obj:`InlineQueryResultCachedAudio` - :obj:`InlineQueryResultCachedDocument` @@ -39,7 +39,7 @@ from ..pyrogram_type import PyrogramType - :obj:`InlineQueryResultVoice`""" -class InlineQueryResult(PyrogramType): +class InlineQueryResult(Object): """One result of an inline query. Pyrogram currently supports results of the following 20 types: 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 6ca0478a..dbda676d 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultAudio(PyrogramType): +class InlineQueryResultAudio(Object): """Represents a link to an mp3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio. Attributes: 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 dc51139b..a4ac1ec8 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 @@ -23,10 +23,10 @@ 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.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultCachedAudio(PyrogramType): +class InlineQueryResultCachedAudio(Object): """Represents a link to an audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use *input_message_content* to send a message with the specified content instead of the audio. 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 ad6cb9af..0dfde1c4 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultCachedDocument(PyrogramType): +class InlineQueryResultCachedDocument(Object): """Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Attributes: 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 1c836f20..819b383f 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultCachedGif(PyrogramType): +class InlineQueryResultCachedGif(Object): """Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation. Attributes: 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 2082150d..9856af66 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultCachedMpeg4Gif(PyrogramType): +class InlineQueryResultCachedMpeg4Gif(Object): """Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. Attributes: 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 20c1adbc..53b479f9 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultCachedPhoto(PyrogramType): +class InlineQueryResultCachedPhoto(Object): """Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo. Attributes: diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_sticker.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_sticker.py index 4711cd72..6b2b37c9 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_sticker.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_cached_sticker.py @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultCachedSticker(PyrogramType): +class InlineQueryResultCachedSticker(Object): """Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker. Attributes: 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 e47cae1b..3a04a766 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultCachedVideo(PyrogramType): +class InlineQueryResultCachedVideo(Object): """Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video. Attributes: 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 3091cf65..fbdf6c19 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultCachedVoice(PyrogramType): +class InlineQueryResultCachedVoice(Object): """Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message. Attributes: 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 60512f0d..a64d6ace 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultContact(PyrogramType): +class InlineQueryResultContact(Object): """Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact. Attributes: 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 a95dd2e9..007f237b 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultDocument(PyrogramType): +class InlineQueryResultDocument(Object): """Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method. Attributes: diff --git a/pyrogram/client/types/inline_mode/todo/inline_query_result_game.py b/pyrogram/client/types/inline_mode/todo/inline_query_result_game.py index 98654463..bd6f25d2 100644 --- a/pyrogram/client/types/inline_mode/todo/inline_query_result_game.py +++ b/pyrogram/client/types/inline_mode/todo/inline_query_result_game.py @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultGame(PyrogramType): +class InlineQueryResultGame(Object): """Represents a Game. Attributes: 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 d84e098b..7273b79a 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultGif(PyrogramType): +class InlineQueryResultGif(Object): """Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. Attributes: 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 cd05c832..a32fc93d 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultLocation(PyrogramType): +class InlineQueryResultLocation(Object): """Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location. Attributes: 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 cb704eeb..04c68cf7 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultMpeg4Gif(PyrogramType): +class InlineQueryResultMpeg4Gif(Object): """Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation. Attributes: 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 db6b9090..57f36fae 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 @@ -18,10 +18,10 @@ from pyrogram.api import types from pyrogram.client.style import HTML, Markdown -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultPhoto(PyrogramType): +class InlineQueryResultPhoto(Object): """Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo. 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 51ee8ae7..3343ccf9 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultVenue(PyrogramType): +class InlineQueryResultVenue(Object): """Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue. Attributes: 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 c8e27f79..ebfe2047 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultVideo(PyrogramType): +class InlineQueryResultVideo(Object): """Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video. Attributes: 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 23cc741f..4e2bbb09 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 @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object -class InlineQueryResultVoice(PyrogramType): +class InlineQueryResultVoice(Object): """Represents a link to a voice recording in an .ogg container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message. Attributes: diff --git a/pyrogram/client/types/input_media/input_media.py b/pyrogram/client/types/input_media/input_media.py index 8360862f..2b5d7f0f 100644 --- a/pyrogram/client/types/input_media/input_media.py +++ b/pyrogram/client/types/input_media/input_media.py @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from ..pyrogram_type import PyrogramType +from ..object import Object -class InputMedia(PyrogramType): +class InputMedia(Object): """Content of a media message to be sent. It should be one of: diff --git a/pyrogram/client/types/input_media/input_phone_contact.py b/pyrogram/client/types/input_media/input_phone_contact.py index c1627516..e49cee30 100644 --- a/pyrogram/client/types/input_media/input_phone_contact.py +++ b/pyrogram/client/types/input_media/input_phone_contact.py @@ -18,10 +18,10 @@ from pyrogram.api.types import InputPhoneContact as RawInputPhoneContact from pyrogram.session.internals import MsgId -from ..pyrogram_type import PyrogramType +from ..object import Object -class InputPhoneContact(PyrogramType): +class InputPhoneContact(Object): """A Phone Contact to be added in your Telegram address book. It is intended to be used with :meth:`~Client.add_contacts() ` 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 50e068b7..1941ffb5 100644 --- a/pyrogram/client/types/input_message_content/input_message_content.py +++ b/pyrogram/client/types/input_message_content/input_message_content.py @@ -16,14 +16,14 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from ..pyrogram_type import PyrogramType +from ..object import Object """- :obj:`InputLocationMessageContent` - :obj:`InputVenueMessageContent` - :obj:`InputContactMessageContent`""" -class InputMessageContent(PyrogramType): +class InputMessageContent(Object): """Content of a message to be sent as a result of an inline query. Pyrogram currently supports the following 4 types: diff --git a/pyrogram/client/types/keyboards/callback_game.py b/pyrogram/client/types/keyboards/callback_game.py index 4fa43a30..acf6df60 100644 --- a/pyrogram/client/types/keyboards/callback_game.py +++ b/pyrogram/client/types/keyboards/callback_game.py @@ -16,10 +16,10 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from ..pyrogram_type import PyrogramType +from ..object import Object -class CallbackGame(PyrogramType): +class CallbackGame(Object): """Placeholder, currently holds no information. Use BotFather to set up your game. diff --git a/pyrogram/client/types/keyboards/callback_query.py b/pyrogram/client/types/keyboards/callback_query.py index fe6a2175..fa0d8be2 100644 --- a/pyrogram/client/types/keyboards/callback_query.py +++ b/pyrogram/client/types/keyboards/callback_query.py @@ -22,12 +22,12 @@ from typing import Union import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object from ..update import Update from ..user_and_chats import User -class CallbackQuery(PyrogramType, Update): +class CallbackQuery(Object, Update): """An incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field *message* diff --git a/pyrogram/client/types/keyboards/force_reply.py b/pyrogram/client/types/keyboards/force_reply.py index 5b263d03..59405529 100644 --- a/pyrogram/client/types/keyboards/force_reply.py +++ b/pyrogram/client/types/keyboards/force_reply.py @@ -17,10 +17,10 @@ # along with Pyrogram. If not, see . from pyrogram.api.types import ReplyKeyboardForceReply -from ..pyrogram_type import PyrogramType +from ..object import Object -class ForceReply(PyrogramType): +class ForceReply(Object): """Object used to force clients to show a reply interface. Upon receiving a message with this object, Telegram clients will display a reply interface to the user. diff --git a/pyrogram/client/types/keyboards/game_high_score.py b/pyrogram/client/types/keyboards/game_high_score.py index 56389b17..5d576ad4 100644 --- a/pyrogram/client/types/keyboards/game_high_score.py +++ b/pyrogram/client/types/keyboards/game_high_score.py @@ -19,11 +19,11 @@ import pyrogram from pyrogram.api import types -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object from pyrogram.client.types.user_and_chats import User -class GameHighScore(PyrogramType): +class GameHighScore(Object): """One row of the high scores table for a game. Parameters: diff --git a/pyrogram/client/types/keyboards/game_high_scores.py b/pyrogram/client/types/keyboards/game_high_scores.py index 8183b9b0..ea557cd5 100644 --- a/pyrogram/client/types/keyboards/game_high_scores.py +++ b/pyrogram/client/types/keyboards/game_high_scores.py @@ -20,11 +20,11 @@ from typing import List import pyrogram from pyrogram.api import types -from pyrogram.client.types.pyrogram_type import PyrogramType +from pyrogram.client.types.object import Object from .game_high_score import GameHighScore -class GameHighScores(PyrogramType): +class GameHighScores(Object): """The high scores table for a game. Parameters: diff --git a/pyrogram/client/types/keyboards/inline_keyboard_button.py b/pyrogram/client/types/keyboards/inline_keyboard_button.py index 08ad0f35..54aa7802 100644 --- a/pyrogram/client/types/keyboards/inline_keyboard_button.py +++ b/pyrogram/client/types/keyboards/inline_keyboard_button.py @@ -23,10 +23,10 @@ from pyrogram.api.types import ( KeyboardButtonSwitchInline, KeyboardButtonGame ) from .callback_game import CallbackGame -from ..pyrogram_type import PyrogramType +from ..object import Object -class InlineKeyboardButton(PyrogramType): +class InlineKeyboardButton(Object): """One button of an inline keyboard. You must use exactly one of the optional fields. diff --git a/pyrogram/client/types/keyboards/inline_keyboard_markup.py b/pyrogram/client/types/keyboards/inline_keyboard_markup.py index c7230eaf..7b811f88 100644 --- a/pyrogram/client/types/keyboards/inline_keyboard_markup.py +++ b/pyrogram/client/types/keyboards/inline_keyboard_markup.py @@ -20,10 +20,10 @@ from typing import List from pyrogram.api.types import ReplyInlineMarkup, KeyboardButtonRow from . import InlineKeyboardButton -from ..pyrogram_type import PyrogramType +from ..object import Object -class InlineKeyboardMarkup(PyrogramType): +class InlineKeyboardMarkup(Object): """An inline keyboard that appears right next to the message it belongs to. Parameters: diff --git a/pyrogram/client/types/keyboards/keyboard_button.py b/pyrogram/client/types/keyboards/keyboard_button.py index 93d2e5ef..2dc09f5d 100644 --- a/pyrogram/client/types/keyboards/keyboard_button.py +++ b/pyrogram/client/types/keyboards/keyboard_button.py @@ -18,10 +18,10 @@ from pyrogram.api.types import KeyboardButton as RawKeyboardButton from pyrogram.api.types import KeyboardButtonRequestPhone, KeyboardButtonRequestGeoLocation -from ..pyrogram_type import PyrogramType +from ..object import Object -class KeyboardButton(PyrogramType): +class KeyboardButton(Object): """One button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields are mutually exclusive. diff --git a/pyrogram/client/types/keyboards/reply_keyboard_markup.py b/pyrogram/client/types/keyboards/reply_keyboard_markup.py index c4b37b7c..4e666d1f 100644 --- a/pyrogram/client/types/keyboards/reply_keyboard_markup.py +++ b/pyrogram/client/types/keyboards/reply_keyboard_markup.py @@ -21,10 +21,10 @@ from typing import List, Union from pyrogram.api.types import KeyboardButtonRow from pyrogram.api.types import ReplyKeyboardMarkup as RawReplyKeyboardMarkup from . import KeyboardButton -from ..pyrogram_type import PyrogramType +from ..object import Object -class ReplyKeyboardMarkup(PyrogramType): +class ReplyKeyboardMarkup(Object): """A custom keyboard with reply options. Parameters: diff --git a/pyrogram/client/types/keyboards/reply_keyboard_remove.py b/pyrogram/client/types/keyboards/reply_keyboard_remove.py index 9d6eb7d5..8dd84f72 100644 --- a/pyrogram/client/types/keyboards/reply_keyboard_remove.py +++ b/pyrogram/client/types/keyboards/reply_keyboard_remove.py @@ -17,10 +17,10 @@ # along with Pyrogram. If not, see . from pyrogram.api.types import ReplyKeyboardHide -from ..pyrogram_type import PyrogramType +from ..object import Object -class ReplyKeyboardRemove(PyrogramType): +class ReplyKeyboardRemove(Object): """Object used to tell clients to remove a bot keyboard. Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display diff --git a/pyrogram/client/types/pyrogram_list.py b/pyrogram/client/types/list.py similarity index 85% rename from pyrogram/client/types/pyrogram_list.py rename to pyrogram/client/types/list.py index cb802e51..cec2d8a2 100644 --- a/pyrogram/client/types/pyrogram_list.py +++ b/pyrogram/client/types/list.py @@ -16,17 +16,17 @@ # You should have received a copy of the GNU Lesser General Public License # along with Pyrogram. If not, see . -from .pyrogram_type import PyrogramType +from .object import Object -class PyrogramList(list): +class List(list): __slots__ = [] def __str__(self): # noinspection PyCallByClass - return PyrogramType.__str__(self) + return Object.__str__(self) def __repr__(self): return "pyrogram.client.types.pyrogram_list.PyrogramList([{}])".format( - ",".join(PyrogramType.__repr__(i) for i in self) + ",".join(Object.__repr__(i) for i in self) ) diff --git a/pyrogram/client/types/messages_and_media/animation.py b/pyrogram/client/types/messages_and_media/animation.py index d729c3ac..0dfbed17 100644 --- a/pyrogram/client/types/messages_and_media/animation.py +++ b/pyrogram/client/types/messages_and_media/animation.py @@ -22,11 +22,11 @@ from typing import List import pyrogram from pyrogram.api import types from .thumbnail import Thumbnail -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class Animation(PyrogramType): +class Animation(Object): """An animation file (GIF or H.264/MPEG-4 AVC video without sound). Parameters: diff --git a/pyrogram/client/types/messages_and_media/audio.py b/pyrogram/client/types/messages_and_media/audio.py index ccea2f3c..64e450f4 100644 --- a/pyrogram/client/types/messages_and_media/audio.py +++ b/pyrogram/client/types/messages_and_media/audio.py @@ -22,11 +22,11 @@ from typing import List import pyrogram from pyrogram.api import types from .thumbnail import Thumbnail -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class Audio(PyrogramType): +class Audio(Object): """An audio file to be treated as music by the Telegram clients. Parameters: diff --git a/pyrogram/client/types/messages_and_media/contact.py b/pyrogram/client/types/messages_and_media/contact.py index 9205304e..d18f5e18 100644 --- a/pyrogram/client/types/messages_and_media/contact.py +++ b/pyrogram/client/types/messages_and_media/contact.py @@ -19,10 +19,10 @@ import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object -class Contact(PyrogramType): +class Contact(Object): """A phone contact. Parameters: diff --git a/pyrogram/client/types/messages_and_media/document.py b/pyrogram/client/types/messages_and_media/document.py index a8838531..ad48a847 100644 --- a/pyrogram/client/types/messages_and_media/document.py +++ b/pyrogram/client/types/messages_and_media/document.py @@ -22,11 +22,11 @@ from typing import List import pyrogram from pyrogram.api import types from .thumbnail import Thumbnail -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class Document(PyrogramType): +class Document(Object): """A generic file (as opposed to photos, voice messages, audio files, ...). Parameters: diff --git a/pyrogram/client/types/messages_and_media/game.py b/pyrogram/client/types/messages_and_media/game.py index 1377173a..2b400e65 100644 --- a/pyrogram/client/types/messages_and_media/game.py +++ b/pyrogram/client/types/messages_and_media/game.py @@ -20,10 +20,10 @@ import pyrogram from pyrogram.api import types from .animation import Animation from .photo import Photo -from ..pyrogram_type import PyrogramType +from ..object import Object -class Game(PyrogramType): +class Game(Object): """A game. Use BotFather to create and edit games, their short names will act as unique identifiers. diff --git a/pyrogram/client/types/messages_and_media/location.py b/pyrogram/client/types/messages_and_media/location.py index 55def7a0..5af55f0f 100644 --- a/pyrogram/client/types/messages_and_media/location.py +++ b/pyrogram/client/types/messages_and_media/location.py @@ -19,10 +19,10 @@ import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object -class Location(PyrogramType): +class Location(Object): """A point on the map. Parameters: diff --git a/pyrogram/client/types/messages_and_media/message.py b/pyrogram/client/types/messages_and_media/message.py index c3a12f3e..f7dff7b5 100644 --- a/pyrogram/client/types/messages_and_media/message.py +++ b/pyrogram/client/types/messages_and_media/message.py @@ -27,7 +27,7 @@ from .contact import Contact from .location import Location from .message_entity import MessageEntity from ..messages_and_media.photo import Photo -from ..pyrogram_type import PyrogramType +from ..object import Object from ..update import Update from ..user_and_chats.chat import Chat from ..user_and_chats.user import User @@ -59,7 +59,7 @@ class Str(str): return self._client.html.unparse(self, self._entities) -class Message(PyrogramType, Update): +class Message(Object, Update): """A message. Parameters: diff --git a/pyrogram/client/types/messages_and_media/message_entity.py b/pyrogram/client/types/messages_and_media/message_entity.py index e369e74e..5f3483ee 100644 --- a/pyrogram/client/types/messages_and_media/message_entity.py +++ b/pyrogram/client/types/messages_and_media/message_entity.py @@ -19,11 +19,11 @@ import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object from ..user_and_chats.user import User -class MessageEntity(PyrogramType): +class MessageEntity(Object): """One special entity in a text message. For example, hashtags, usernames, URLs, etc. diff --git a/pyrogram/client/types/messages_and_media/messages.py b/pyrogram/client/types/messages_and_media/messages.py index f94f1951..ee516f20 100644 --- a/pyrogram/client/types/messages_and_media/messages.py +++ b/pyrogram/client/types/messages_and_media/messages.py @@ -21,12 +21,12 @@ from typing import List, Union import pyrogram from pyrogram.api import types from .message import Message -from ..pyrogram_type import PyrogramType +from ..object import Object from ..update import Update from ..user_and_chats import Chat -class Messages(PyrogramType, Update): +class Messages(Object, Update): """Contains a chat's messages. Parameters: diff --git a/pyrogram/client/types/messages_and_media/photo.py b/pyrogram/client/types/messages_and_media/photo.py index ca42c3eb..b5d80b82 100644 --- a/pyrogram/client/types/messages_and_media/photo.py +++ b/pyrogram/client/types/messages_and_media/photo.py @@ -22,11 +22,11 @@ from typing import List import pyrogram from pyrogram.api import types from .thumbnail import Thumbnail -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class Photo(PyrogramType): +class Photo(Object): """A Photo. Parameters: diff --git a/pyrogram/client/types/messages_and_media/photos.py b/pyrogram/client/types/messages_and_media/photos.py index 1d5b193e..a1803923 100644 --- a/pyrogram/client/types/messages_and_media/photos.py +++ b/pyrogram/client/types/messages_and_media/photos.py @@ -20,10 +20,10 @@ from typing import List import pyrogram from .photo import Photo -from ..pyrogram_type import PyrogramType +from ..object import Object -class Photos(PyrogramType): +class Photos(Object): """Contains a user's profile pictures. Parameters: diff --git a/pyrogram/client/types/messages_and_media/poll.py b/pyrogram/client/types/messages_and_media/poll.py index e6c97bfb..2570fdf1 100644 --- a/pyrogram/client/types/messages_and_media/poll.py +++ b/pyrogram/client/types/messages_and_media/poll.py @@ -21,11 +21,11 @@ from typing import List, Union import pyrogram from pyrogram.api import types from .poll_option import PollOption -from ..pyrogram_type import PyrogramType +from ..object import Object from ..update import Update -class Poll(PyrogramType, Update): +class Poll(Object, Update): """A Poll. Parameters: diff --git a/pyrogram/client/types/messages_and_media/poll_option.py b/pyrogram/client/types/messages_and_media/poll_option.py index e7eb1f5f..35f6b071 100644 --- a/pyrogram/client/types/messages_and_media/poll_option.py +++ b/pyrogram/client/types/messages_and_media/poll_option.py @@ -17,10 +17,10 @@ # along with Pyrogram. If not, see . import pyrogram -from ..pyrogram_type import PyrogramType +from ..object import Object -class PollOption(PyrogramType): +class PollOption(Object): """Contains information about one answer option in a poll. Parameters: diff --git a/pyrogram/client/types/messages_and_media/sticker.py b/pyrogram/client/types/messages_and_media/sticker.py index d133b31b..9e528dd8 100644 --- a/pyrogram/client/types/messages_and_media/sticker.py +++ b/pyrogram/client/types/messages_and_media/sticker.py @@ -24,11 +24,11 @@ import pyrogram from pyrogram.api import types, functions from pyrogram.errors import StickersetInvalid from .thumbnail import Thumbnail -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class Sticker(PyrogramType): +class Sticker(Object): """A sticker. Parameters: diff --git a/pyrogram/client/types/messages_and_media/stripped_thumbnail.py b/pyrogram/client/types/messages_and_media/stripped_thumbnail.py index 31638fc2..4dbeb7d1 100644 --- a/pyrogram/client/types/messages_and_media/stripped_thumbnail.py +++ b/pyrogram/client/types/messages_and_media/stripped_thumbnail.py @@ -18,10 +18,10 @@ import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object -class StrippedThumbnail(PyrogramType): +class StrippedThumbnail(Object): """A stripped thumbnail Parameters: diff --git a/pyrogram/client/types/messages_and_media/thumbnail.py b/pyrogram/client/types/messages_and_media/thumbnail.py index 0ff15e66..ee173b1c 100644 --- a/pyrogram/client/types/messages_and_media/thumbnail.py +++ b/pyrogram/client/types/messages_and_media/thumbnail.py @@ -23,10 +23,10 @@ import pyrogram from pyrogram.api import types from pyrogram.client.ext.utils import encode from .stripped_thumbnail import StrippedThumbnail -from ..pyrogram_type import PyrogramType +from ..object import Object -class Thumbnail(PyrogramType): +class Thumbnail(Object): """One size of a photo or a file/sticker thumbnail. Parameters: diff --git a/pyrogram/client/types/messages_and_media/venue.py b/pyrogram/client/types/messages_and_media/venue.py index e54a812e..45d9368f 100644 --- a/pyrogram/client/types/messages_and_media/venue.py +++ b/pyrogram/client/types/messages_and_media/venue.py @@ -19,10 +19,10 @@ import pyrogram from pyrogram.api import types from .location import Location -from ..pyrogram_type import PyrogramType +from ..object import Object -class Venue(PyrogramType): +class Venue(Object): """A venue. Parameters: diff --git a/pyrogram/client/types/messages_and_media/video.py b/pyrogram/client/types/messages_and_media/video.py index 7a20283f..feda9711 100644 --- a/pyrogram/client/types/messages_and_media/video.py +++ b/pyrogram/client/types/messages_and_media/video.py @@ -22,11 +22,11 @@ from typing import List import pyrogram from pyrogram.api import types from .thumbnail import Thumbnail -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class Video(PyrogramType): +class Video(Object): """A video file. Parameters: diff --git a/pyrogram/client/types/messages_and_media/video_note.py b/pyrogram/client/types/messages_and_media/video_note.py index 34f5972f..b1d9bcdb 100644 --- a/pyrogram/client/types/messages_and_media/video_note.py +++ b/pyrogram/client/types/messages_and_media/video_note.py @@ -22,11 +22,11 @@ from typing import List import pyrogram from pyrogram.api import types from .thumbnail import Thumbnail -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class VideoNote(PyrogramType): +class VideoNote(Object): """A video note. Parameters: diff --git a/pyrogram/client/types/messages_and_media/voice.py b/pyrogram/client/types/messages_and_media/voice.py index 3e08d57a..e4256197 100644 --- a/pyrogram/client/types/messages_and_media/voice.py +++ b/pyrogram/client/types/messages_and_media/voice.py @@ -20,11 +20,11 @@ from struct import pack import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class Voice(PyrogramType): +class Voice(Object): """A voice note. Parameters: diff --git a/pyrogram/client/types/pyrogram_type.py b/pyrogram/client/types/object.py similarity index 63% rename from pyrogram/client/types/pyrogram_type.py rename to pyrogram/client/types/object.py index 9a04c636..4d482e63 100644 --- a/pyrogram/client/types/pyrogram_type.py +++ b/pyrogram/client/types/object.py @@ -23,7 +23,12 @@ from json import dumps import pyrogram -class PyrogramType: +class Meta(type, metaclass=type("", (type,), {"__str__": lambda _: "~hi"})): + def __str__(self): + return "".format(self.__name__) + + +class Object(metaclass=Meta): __slots__ = ["_client"] def __init__(self, client: "pyrogram.BaseClient" = None): @@ -32,35 +37,26 @@ class PyrogramType: if self._client is None: del self._client - def __eq__(self, other: "PyrogramType") -> bool: - for attr in self.__slots__: - try: - if getattr(self, attr) != getattr(other, attr): - return False - except AttributeError: - return False + @staticmethod + def default(obj: "Object"): + if isinstance(obj, bytes): + return repr(obj) - return True + return OrderedDict( + [("_", "pyrogram." + obj.__class__.__name__)] + + [ + (attr, "*" * len(getattr(obj, attr))) + if attr == "phone_number" + else (attr, str(datetime.fromtimestamp(getattr(obj, attr)))) + if attr.endswith("date") + else (attr, getattr(obj, attr)) + for attr in obj.__slots__ + if getattr(obj, attr) is not None + ] + ) def __str__(self) -> str: - def default(obj: PyrogramType): - try: - return OrderedDict( - [("_", "pyrogram." + obj.__class__.__name__)] - + [ - (attr, "*" * len(getattr(obj, attr))) - if attr == "phone_number" - else (attr, str(datetime.fromtimestamp(getattr(obj, attr)))) - if attr.endswith("date") - else (attr, getattr(obj, attr)) - for attr in obj.__slots__ - if getattr(obj, attr) is not None - ] - ) - except AttributeError: - return repr(obj) - - return dumps(self, indent=4, default=default, ensure_ascii=False) + return dumps(self, indent=4, default=Object.default, ensure_ascii=False) def __repr__(self) -> str: return "pyrogram.{}({})".format( @@ -72,5 +68,18 @@ class PyrogramType: ) ) + def __eq__(self, other: "Object") -> bool: + for attr in self.__slots__: + try: + if getattr(self, attr) != getattr(other, attr): + return False + except AttributeError: + return False + + return True + def __getitem__(self, item): return getattr(self, item) + + def __setitem__(self, key, value): + setattr(self, key, value) diff --git a/pyrogram/client/types/user_and_chats/chat.py b/pyrogram/client/types/user_and_chats/chat.py index e260d8cd..ca9acd65 100644 --- a/pyrogram/client/types/user_and_chats/chat.py +++ b/pyrogram/client/types/user_and_chats/chat.py @@ -22,10 +22,10 @@ import pyrogram from pyrogram.api import types from .chat_permissions import ChatPermissions from .chat_photo import ChatPhoto -from ..pyrogram_type import PyrogramType +from ..object import Object -class Chat(PyrogramType): +class Chat(Object): """A chat. Parameters: diff --git a/pyrogram/client/types/user_and_chats/chat_member.py b/pyrogram/client/types/user_and_chats/chat_member.py index 536f9526..7451012c 100644 --- a/pyrogram/client/types/user_and_chats/chat_member.py +++ b/pyrogram/client/types/user_and_chats/chat_member.py @@ -19,10 +19,10 @@ import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object -class ChatMember(PyrogramType): +class ChatMember(Object): """Contains information about one member of a chat. Parameters: diff --git a/pyrogram/client/types/user_and_chats/chat_members.py b/pyrogram/client/types/user_and_chats/chat_members.py index f57b8b46..6abdd719 100644 --- a/pyrogram/client/types/user_and_chats/chat_members.py +++ b/pyrogram/client/types/user_and_chats/chat_members.py @@ -21,10 +21,10 @@ from typing import List import pyrogram from pyrogram.api import types from .chat_member import ChatMember -from ..pyrogram_type import PyrogramType +from ..object import Object -class ChatMembers(PyrogramType): +class ChatMembers(Object): """Contains information about the members list of a chat. Parameters: diff --git a/pyrogram/client/types/user_and_chats/chat_permissions.py b/pyrogram/client/types/user_and_chats/chat_permissions.py index 6fa1a2a8..84099955 100644 --- a/pyrogram/client/types/user_and_chats/chat_permissions.py +++ b/pyrogram/client/types/user_and_chats/chat_permissions.py @@ -19,10 +19,10 @@ from typing import Union from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object -class ChatPermissions(PyrogramType): +class ChatPermissions(Object): """A chat default permissions and a single member permissions within a chat. Some permissions make sense depending on the context: default chat permissions, restricted/kicked member or diff --git a/pyrogram/client/types/user_and_chats/chat_photo.py b/pyrogram/client/types/user_and_chats/chat_photo.py index 1885eff2..1584a286 100644 --- a/pyrogram/client/types/user_and_chats/chat_photo.py +++ b/pyrogram/client/types/user_and_chats/chat_photo.py @@ -20,11 +20,11 @@ from struct import pack import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object from ...ext.utils import encode -class ChatPhoto(PyrogramType): +class ChatPhoto(Object): """A chat photo. Parameters: diff --git a/pyrogram/client/types/user_and_chats/chat_preview.py b/pyrogram/client/types/user_and_chats/chat_preview.py index 38dda6b6..312bdfe6 100644 --- a/pyrogram/client/types/user_and_chats/chat_preview.py +++ b/pyrogram/client/types/user_and_chats/chat_preview.py @@ -21,11 +21,11 @@ from typing import List import pyrogram from pyrogram.api import types from .chat_photo import ChatPhoto -from ..pyrogram_type import PyrogramType +from ..object import Object from ..user_and_chats.user import User -class ChatPreview(PyrogramType): +class ChatPreview(Object): """A chat preview. Parameters: diff --git a/pyrogram/client/types/user_and_chats/dialog.py b/pyrogram/client/types/user_and_chats/dialog.py index 4b900012..4ea82184 100644 --- a/pyrogram/client/types/user_and_chats/dialog.py +++ b/pyrogram/client/types/user_and_chats/dialog.py @@ -19,11 +19,11 @@ import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object from ..user_and_chats import Chat -class Dialog(PyrogramType): +class Dialog(Object): """A user's dialog. Parameters: diff --git a/pyrogram/client/types/user_and_chats/dialogs.py b/pyrogram/client/types/user_and_chats/dialogs.py index 862fcf22..56cdfc72 100644 --- a/pyrogram/client/types/user_and_chats/dialogs.py +++ b/pyrogram/client/types/user_and_chats/dialogs.py @@ -22,10 +22,10 @@ import pyrogram from pyrogram.api import types from .dialog import Dialog from ..messages_and_media import Message -from ..pyrogram_type import PyrogramType +from ..object import Object -class Dialogs(PyrogramType): +class Dialogs(Object): """Contains a user's dialogs chunk. Parameters: diff --git a/pyrogram/client/types/user_and_chats/user.py b/pyrogram/client/types/user_and_chats/user.py index ae631df1..50dd8361 100644 --- a/pyrogram/client/types/user_and_chats/user.py +++ b/pyrogram/client/types/user_and_chats/user.py @@ -20,10 +20,10 @@ import pyrogram from pyrogram.api import types from .chat_photo import ChatPhoto from .user_status import UserStatus -from ..pyrogram_type import PyrogramType +from ..object import Object -class User(PyrogramType): +class User(Object): """A Telegram user or bot. Parameters: diff --git a/pyrogram/client/types/user_and_chats/user_status.py b/pyrogram/client/types/user_and_chats/user_status.py index e6f5b134..4d12afc1 100644 --- a/pyrogram/client/types/user_and_chats/user_status.py +++ b/pyrogram/client/types/user_and_chats/user_status.py @@ -19,11 +19,11 @@ import pyrogram from pyrogram.api import types -from ..pyrogram_type import PyrogramType +from ..object import Object from ..update import Update -class UserStatus(PyrogramType, Update): +class UserStatus(Object, Update): """A User status (Last Seen privacy). .. note::