mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-12-01 01:57:51 +00:00
c7b1d6f70a
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.
28 lines
483 B
Plaintext
28 lines
483 B
Plaintext
{notice}
|
|
|
|
from io import BytesIO
|
|
|
|
from pyrogram.api.core import *
|
|
|
|
|
|
class {class_name}(Object):
|
|
"""{docstring_args}
|
|
"""
|
|
|
|
ID = {object_id}
|
|
|
|
def __init__(self{arguments}):
|
|
{fields}
|
|
|
|
@staticmethod
|
|
def read(b: BytesIO, *args) -> "{class_name}":
|
|
{read_types}
|
|
return {class_name}({return_arguments})
|
|
|
|
def write(self) -> bytes:
|
|
b = BytesIO()
|
|
b.write(Int(self.ID, False))
|
|
|
|
{write_types}
|
|
return b.getvalue()
|