mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2026-09-07 17:31:57 +00:00
Replace .on_response with static .from_reader for all types
This commit is contained in:
@@ -131,11 +131,7 @@ class BinaryReader:
|
||||
# If there was still no luck, give up
|
||||
raise TypeNotFoundError(constructor_id)
|
||||
|
||||
# Create an empty instance of the class and
|
||||
# fill it with the read attributes
|
||||
result = clazz.empty()
|
||||
result.on_response(self)
|
||||
return result
|
||||
return clazz.from_reader(self)
|
||||
|
||||
def tgread_vector(self):
|
||||
"""Reads a vector (a list) of Telegram objects"""
|
||||
|
||||
@@ -121,5 +121,6 @@ class TLObject:
|
||||
def to_bytes(self):
|
||||
return b''
|
||||
|
||||
def on_response(self, reader):
|
||||
pass
|
||||
@staticmethod
|
||||
def from_reader(reader):
|
||||
return TLObject()
|
||||
|
||||
Reference in New Issue
Block a user