mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-23 18:37:26 +00:00
Fix method signatures
This commit is contained in:
parent
29ef38df89
commit
055367fe9c
@ -32,7 +32,7 @@ class FutureSalt(Object):
|
|||||||
self.salt = salt
|
self.salt = salt
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read(b: BytesIO) -> "FutureSalt":
|
def read(b: BytesIO, *args) -> "FutureSalt":
|
||||||
valid_since = datetime.fromtimestamp(Int.read(b))
|
valid_since = datetime.fromtimestamp(Int.read(b))
|
||||||
valid_until = datetime.fromtimestamp(Int.read(b))
|
valid_until = datetime.fromtimestamp(Int.read(b))
|
||||||
salt = Long.read(b)
|
salt = Long.read(b)
|
||||||
|
@ -33,7 +33,7 @@ class FutureSalts(Object):
|
|||||||
self.salts = salts
|
self.salts = salts
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read(b: BytesIO) -> "FutureSalts":
|
def read(b: BytesIO, *args) -> "FutureSalts":
|
||||||
req_msg_id = Long.read(b)
|
req_msg_id = Long.read(b)
|
||||||
now = datetime.fromtimestamp(Int.read(b))
|
now = datetime.fromtimestamp(Int.read(b))
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class GzipPacked(Object):
|
|||||||
self.packed_data = packed_data
|
self.packed_data = packed_data
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read(b: BytesIO) -> "GzipPacked":
|
def read(b: BytesIO, *args) -> "GzipPacked":
|
||||||
# Return the Object itself instead of a GzipPacked wrapping it
|
# Return the Object itself instead of a GzipPacked wrapping it
|
||||||
return Object.read(
|
return Object.read(
|
||||||
BytesIO(
|
BytesIO(
|
||||||
|
@ -32,7 +32,7 @@ class Message(Object):
|
|||||||
self.body = body
|
self.body = body
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read(b: BytesIO) -> "Message":
|
def read(b: BytesIO, *args) -> "Message":
|
||||||
msg_id = Long.read(b)
|
msg_id = Long.read(b)
|
||||||
seq_no = Int.read(b)
|
seq_no = Int.read(b)
|
||||||
length = Int.read(b)
|
length = Int.read(b)
|
||||||
|
@ -30,7 +30,7 @@ class MsgContainer(Object):
|
|||||||
self.messages = messages
|
self.messages = messages
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read(b: BytesIO) -> "MsgContainer":
|
def read(b: BytesIO, *args) -> "MsgContainer":
|
||||||
count = Int.read(b)
|
count = Int.read(b)
|
||||||
return MsgContainer([Message.read(b) for _ in range(count)])
|
return MsgContainer([Message.read(b) for _ in range(count)])
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ from ..object import Object
|
|||||||
|
|
||||||
class Bytes(Object):
|
class Bytes(Object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read(b: BytesIO) -> bytes:
|
def read(b: BytesIO, *args) -> bytes:
|
||||||
length = int.from_bytes(b.read(1), "little")
|
length = int.from_bytes(b.read(1), "little")
|
||||||
|
|
||||||
if length <= 253:
|
if length <= 253:
|
||||||
|
@ -24,7 +24,7 @@ from ..object import Object
|
|||||||
|
|
||||||
class Double(Object):
|
class Double(Object):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read(b: BytesIO) -> float:
|
def read(b: BytesIO, *args) -> float:
|
||||||
return unpack("d", b.read(8))[0]
|
return unpack("d", b.read(8))[0]
|
||||||
|
|
||||||
def __new__(cls, value: float) -> bytes:
|
def __new__(cls, value: float) -> bytes:
|
||||||
|
@ -23,7 +23,7 @@ from . import Bytes
|
|||||||
|
|
||||||
class String(Bytes):
|
class String(Bytes):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def read(b: BytesIO) -> str:
|
def read(b: BytesIO, *args) -> str:
|
||||||
return super(String, String).read(b).decode()
|
return super(String, String).read(b).decode()
|
||||||
|
|
||||||
def __new__(cls, value: str) -> bytes:
|
def __new__(cls, value: str) -> bytes:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user