Add __str__ to RpcResult/GzipPacked

This commit is contained in:
Lonami Exo
2018-06-21 09:52:47 +02:00
parent a99fce471a
commit 5c602d4ba7
4 changed files with 22 additions and 19 deletions

View File

@@ -1,8 +1,9 @@
from .gzippacked import GzipPacked
from .. import TLObject
from ..types import RpcError
class RpcResult:
class RpcResult(TLObject):
CONSTRUCTOR_ID = 0xf35c6d01
def __init__(self, req_msg_id, body, error):
@@ -21,3 +22,11 @@ class RpcResult:
reader.seek(-4)
return RpcResult(msg_id, reader.read(), None)
def to_dict(self):
return {
'_': 'RpcResult',
'req_msg_id': self.req_msg_id,
'body': self.body,
'error': self.error
}