2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 05:18:10 +00:00

Replace Client with BaseClient type hint

This commit is contained in:
Dan 2018-12-19 14:45:16 +01:00
parent 5035daa9d7
commit 4fb9969470
26 changed files with 28 additions and 28 deletions

View File

@ -59,7 +59,7 @@ class CallbackQuery(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
id: str, id: str,
from_user: User, from_user: User,
chat_instance: str, chat_instance: str,

View File

@ -59,7 +59,7 @@ class Animation(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
file_id: str, file_id: str,
width: int, width: int,
height: int, height: int,

View File

@ -59,7 +59,7 @@ class Audio(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
file_id: str, file_id: str,
duration: int, duration: int,
thumb: PhotoSize = None, thumb: PhotoSize = None,

View File

@ -44,7 +44,7 @@ class Contact(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
phone_number: str, phone_number: str,
first_name: str, first_name: str,
last_name: str = None, last_name: str = None,

View File

@ -50,7 +50,7 @@ class Document(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
file_id: str, file_id: str,
thumb: PhotoSize = None, thumb: PhotoSize = None,
file_name: str = None, file_name: str = None,

View File

@ -35,7 +35,7 @@ class Location(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
longitude: float, longitude: float,
latitude: float): latitude: float):
super().__init__(client) super().__init__(client)

View File

@ -210,11 +210,11 @@ class Message(PyrogramType):
Messages sent from yourself to other chats are outgoing (*outgoing* is True). Messages sent from yourself to other chats are outgoing (*outgoing* is True).
An exception is made for your own personal chat; messages sent there will be incoming. An exception is made for your own personal chat; messages sent there will be incoming.
matches (``List of regex Matches``, *optional*): matches (List of regex Matches, *optional*):
A list containing all `Match Objects <https://docs.python.org/3/library/re.html#match-objects>`_ that match A list containing all `Match Objects <https://docs.python.org/3/library/re.html#match-objects>`_ that match
the text of this message. Only applicable when using :obj:`Filters.regex <pyrogram.Filters.regex>`. the text of this message. Only applicable when using :obj:`Filters.regex <pyrogram.Filters.regex>`.
command (``List of strings``, *optional*): command (List of ``str``, *optional*):
A list containing the command and its arguments, if any. A list containing the command and its arguments, if any.
E.g.: "/start 1 2 3" would produce ["start", "1", "2", "3"]. E.g.: "/start 1 2 3" would produce ["start", "1", "2", "3"].
Only applicable when using :obj:`Filters.command <pyrogram.Filters.command>`. Only applicable when using :obj:`Filters.command <pyrogram.Filters.command>`.
@ -228,7 +228,7 @@ class Message(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
message_id: int, message_id: int,
date: int = None, date: int = None,
chat: Chat = None, chat: Chat = None,

View File

@ -65,7 +65,7 @@ class MessageEntity(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
type: str, type: str,
offset: int, offset: int,
length: int, length: int,

View File

@ -38,7 +38,7 @@ class Messages(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
total_count: int, total_count: int,
messages: List[Message]): messages: List[Message]):
super().__init__(client) super().__init__(client)

View File

@ -43,7 +43,7 @@ class Photo(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
id: str, id: str,
date: int, date: int,
sizes: List[PhotoSize]): sizes: List[PhotoSize]):

View File

@ -43,7 +43,7 @@ class PhotoSize(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
file_id: str, file_id: str,
width: int, width: int,
height: int, height: int,

View File

@ -66,7 +66,7 @@ class Sticker(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
file_id: str, file_id: str,
width: int, width: int,
height: int, height: int,

View File

@ -36,7 +36,7 @@ class UserProfilePhotos(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
total_count: int, total_count: int,
photos: List[Photo]): photos: List[Photo]):
super().__init__(client) super().__init__(client)

View File

@ -46,7 +46,7 @@ class Venue(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
location: Location, location: Location,
title: str, title: str,
address: str, address: str,

View File

@ -59,7 +59,7 @@ class Video(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
file_id: str, file_id: str,
width: int, width: int,
height: int, height: int,

View File

@ -53,7 +53,7 @@ class VideoNote(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
file_id: str, file_id: str,
length: int, length: int,
duration: int, duration: int,

View File

@ -49,7 +49,7 @@ class Voice(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
file_id: str, file_id: str,
duration: int, duration: int,
waveform: bytes = None, waveform: bytes = None,

View File

@ -52,7 +52,7 @@ class Encoder(JSONEncoder):
return remove_none( return remove_none(
OrderedDict( OrderedDict(
[("_", "pyrogram:" + o.__class__.__name__)] [("_", "pyrogram." + o.__class__.__name__)]
+ [i for i in content.items()] + [i for i in content.items()]
) )
) )

View File

@ -79,7 +79,7 @@ class Chat(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
id: int, id: int,
type: str, type: str,
title: str = None, title: str = None,

View File

@ -83,7 +83,7 @@ class ChatMember(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
user: "pyrogram.User", user: "pyrogram.User",
status: str, status: str,
until_date: int = None, until_date: int = None,

View File

@ -38,7 +38,7 @@ class ChatMembers(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
total_count: int, total_count: int,
chat_members: List[ChatMember]): chat_members: List[ChatMember]):
super().__init__(client) super().__init__(client)

View File

@ -37,7 +37,7 @@ class ChatPhoto(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
small_file_id: str, small_file_id: str,
big_file_id: str): big_file_id: str):
super().__init__(client) super().__init__(client)

View File

@ -48,7 +48,7 @@ class Dialog(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
chat: Chat, chat: Chat,
top_message: "pyrogram.Message", top_message: "pyrogram.Message",
unread_messages_count: int, unread_messages_count: int,

View File

@ -38,7 +38,7 @@ class Dialogs(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
total_count: int, total_count: int,
dialogs: List[Dialog]): dialogs: List[Dialog]):
super().__init__(client) super().__init__(client)

View File

@ -72,7 +72,7 @@ class User(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
id: int, id: int,
is_self: bool, is_self: bool,
is_contact: bool, is_contact: bool,

View File

@ -66,7 +66,7 @@ class UserStatus(PyrogramType):
def __init__(self, def __init__(self,
*, *,
client: "pyrogram.Client", client: "pyrogram.client.ext.BaseClient",
user_id: int, user_id: int,
online: bool = None, online: bool = None,
offline: bool = None, offline: bool = None,