2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-09-02 15:25:41 +00:00

Take into account that flags:# could be not always the first argument

For instance, in Layer 91, Poll's flags:# is at the second position.
This mess also happened in the past (thanks tg devs) and eventually will
be fixed again with the next Layer update, but from now on Pyrogram
will be able to correctly generate code even in such cases.
This commit is contained in:
Dan
2019-01-05 15:26:40 +01:00
parent a50dba2b4c
commit c7b1d6f70a
2 changed files with 28 additions and 26 deletions

View File

@@ -16,7 +16,6 @@ class {class_name}(Object):
@staticmethod
def read(b: BytesIO, *args) -> "{class_name}":
{read_flags}
{read_types}
return {class_name}({return_arguments})
@@ -24,6 +23,5 @@ class {class_name}(Object):
b = BytesIO()
b.write(Int(self.ID, False))
{write_flags}
{write_types}
return b.getvalue()