diff --git a/mtproto.py b/mtproto.py index c9facee2..6daab00e 100644 --- a/mtproto.py +++ b/mtproto.py @@ -49,8 +49,8 @@ class TlMethod: class TL: - def __init__(self): - with open("TL_schema.JSON", 'r') as f: + def __init__(self, filename): + with open(filename, 'r') as f: TL_dict = json.load(f) # Read constructors @@ -71,79 +71,75 @@ class TL: self.method_id[z.id] = z self.method_name[z.method] = z - def method_call(self, method, **kwargs): - z = io.BytesIO() - tl_method = self.method_name[method] - z.write(struct.pack('