2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +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,
*,
client: "pyrogram.Client",
client: "pyrogram.client.ext.BaseClient",
id: str,
from_user: User,
chat_instance: str,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -210,11 +210,11 @@ class Message(PyrogramType):
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.
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
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.
E.g.: "/start 1 2 3" would produce ["start", "1", "2", "3"].
Only applicable when using :obj:`Filters.command <pyrogram.Filters.command>`.
@ -228,7 +228,7 @@ class Message(PyrogramType):
def __init__(self,
*,
client: "pyrogram.Client",
client: "pyrogram.client.ext.BaseClient",
message_id: int,
date: int = None,
chat: Chat = None,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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