Source code for pyrogram.raw.types.sticker_pack
# 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 StickerPack(TLObject): # type: ignore
"""A stickerpack is a group of stickers associated to the same emoji.
It is **not** a sticker pack the way it is usually intended, you may be looking for a `StickerSet <https://core.telegram.org/type/StickerSet>`_.
Constructor of :obj:`~pyrogram.raw.base.StickerPack`.
Details:
- Layer: ``229``
- ID: ``12B299D4``
Parameters:
emoticon (``str``):
Emoji
documents (List of ``int`` ``64-bit``):
Stickers
"""
__slots__: List[str] = ["emoticon", "documents"]
ID = 0x12b299d4
QUALNAME = "types.StickerPack"
def __init__(self, *, emoticon: str, documents: List[int]) -> None:
self.emoticon = emoticon # string
self.documents = documents # Vector<long>
@staticmethod
def read(b: BytesIO, *args: Any) -> "StickerPack":
# No flags
emoticon = String.read(b)
documents = TLObject.read(b, Long)
return StickerPack(emoticon=emoticon, documents=documents)
def write(self, *args) -> bytes:
b = BytesIO()
b.write(Int(self.ID, False))
# No flags
b.write(String(self.emoticon))
b.write(Vector(self.documents, Long))
return b.getvalue()