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