pyrogram/compiler/api/template/combinator.txt

36 lines
743 B
Plaintext
Raw Normal View History

{notice}
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Optional, Any
{warning}
class {name}(TLObject): # type: ignore
"""{docstring}
"""
__slots__: List[str] = [{slots}]
ID = {id}
QUALNAME = "{qualname}"
def __init__(self{arguments}) -> None:
{fields}
@staticmethod
def read(b: BytesIO, *args: Any) -> "{name}":
{read_types}
return {name}({return_arguments})
2022-04-24 09:56:06 +00:00
def write(self, *args) -> bytes:
b = BytesIO()
b.write(Int(self.ID, False))
{write_types}
return b.getvalue()