Source code for pyrogram.raw.functions.account.get_unique_gift_chat_themes
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
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 !!! #
# This is a generated file! #
# All changes made in this file will be lost! #
# # # # # # # # # # # # # # # # # # # # # # # #
[docs]
class GetUniqueGiftChatThemes(TLObject): # type: ignore
"""Obtain all `chat themes » <https://core.telegram.org/api/themes#chat-themes>`_ associated to owned or `hosted collectible gifts » <https://core.telegram.org/api/gifts#hosted-collectible-gifts>`_.
.. include:: /_includes/usable-by/users.rst
Details:
- Layer: ``229``
- ID: ``E42CE9C9``
Parameters:
offset (``str``):
Offset for `pagination <https://core.telegram.org/api/offsets>`_, intially an empty string, then equal the value of the last returned `account.chatThemes <https://core.telegram.org/constructor/account.chatThemes>`_. ``next_offset`` (if set).
limit (``int`` ``32-bit``):
Maximum number of results to return, `see pagination <https://core.telegram.org/api/offsets>`_. Note that the server may return less than ``limit`` results, even if the actual number of remaining results is ``>= limit``, paginate to fetch them all.
hash (``int`` ``64-bit``):
Hash from a previously returned `account.chatThemes <https://core.telegram.org/constructor/account.chatThemes>`_ constructor, to avoid returning any result if the theme list hasn't changed.
Returns:
:obj:`account.ChatThemes <pyrogram.raw.base.account.ChatThemes>`
"""
__slots__: List[str] = ["offset", "limit", "hash"]
ID = 0xe42ce9c9
QUALNAME = "functions.account.GetUniqueGiftChatThemes"
def __init__(self, *, offset: str, limit: int, hash: int) -> None:
self.offset = offset # string
self.limit = limit # int
self.hash = hash # long
@staticmethod
def read(b: BytesIO, *args: Any) -> "GetUniqueGiftChatThemes":
# No flags
offset = String.read(b)
limit = Int.read(b)
hash = Long.read(b)
return GetUniqueGiftChatThemes(offset=offset, limit=limit, hash=hash)
def write(self, *args) -> bytes:
b = BytesIO()
b.write(Int(self.ID, False))
# No flags
b.write(String(self.offset))
b.write(Int(self.limit))
b.write(Long(self.hash))
return b.getvalue()