mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-05 23:04:51 +00:00
feat(sticker): Adding "needs_repainting" attribute to sticker class
This commit is contained in:
parent
43fb830382
commit
4c9a4f972e
1 changed files with 15 additions and 0 deletions
|
|
@ -51,6 +51,13 @@ class Sticker(Object):
|
||||||
is_video (``bool``):
|
is_video (``bool``):
|
||||||
True, if the sticker is a video sticker
|
True, if the sticker is a video sticker
|
||||||
|
|
||||||
|
needs_repainting (``bool``, *optional*):
|
||||||
|
True, if the sticker needs repainting.
|
||||||
|
if the sticker can repainted to a text color in messages,
|
||||||
|
the color of the Telegram Premium badge in emoji status,
|
||||||
|
white color on chat photos, or another appropriate color in other places.
|
||||||
|
Only applicable to custom emoji stickers.
|
||||||
|
|
||||||
file_name (``str``, *optional*):
|
file_name (``str``, *optional*):
|
||||||
Sticker file name.
|
Sticker file name.
|
||||||
|
|
||||||
|
|
@ -85,6 +92,7 @@ class Sticker(Object):
|
||||||
height: int,
|
height: int,
|
||||||
is_animated: bool,
|
is_animated: bool,
|
||||||
is_video: bool,
|
is_video: bool,
|
||||||
|
needs_repainting: bool = False,
|
||||||
file_name: str = None,
|
file_name: str = None,
|
||||||
mime_type: str = None,
|
mime_type: str = None,
|
||||||
file_size: int = None,
|
file_size: int = None,
|
||||||
|
|
@ -105,6 +113,7 @@ class Sticker(Object):
|
||||||
self.height = height
|
self.height = height
|
||||||
self.is_animated = is_animated
|
self.is_animated = is_animated
|
||||||
self.is_video = is_video
|
self.is_video = is_video
|
||||||
|
self.needs_repainting = needs_repainting
|
||||||
self.emoji = emoji
|
self.emoji = emoji
|
||||||
self.set_name = set_name
|
self.set_name = set_name
|
||||||
self.thumbs = thumbs
|
self.thumbs = thumbs
|
||||||
|
|
@ -167,6 +176,11 @@ class Sticker(Object):
|
||||||
else:
|
else:
|
||||||
set_name = None
|
set_name = None
|
||||||
|
|
||||||
|
if isinstance(sticker_attributes, raw.types.DocumentAttributeCustomEmoji):
|
||||||
|
needs_repainting = sticker_attributes.text_color
|
||||||
|
else:
|
||||||
|
needs_repainting = None
|
||||||
|
|
||||||
return Sticker(
|
return Sticker(
|
||||||
file_id=FileId(
|
file_id=FileId(
|
||||||
file_type=FileType.STICKER,
|
file_type=FileType.STICKER,
|
||||||
|
|
@ -195,6 +209,7 @@ class Sticker(Object):
|
||||||
),
|
),
|
||||||
is_animated=sticker.mime_type == "application/x-tgsticker",
|
is_animated=sticker.mime_type == "application/x-tgsticker",
|
||||||
is_video=sticker.mime_type == "video/webm",
|
is_video=sticker.mime_type == "video/webm",
|
||||||
|
needs_repainting=needs_repainting,
|
||||||
# TODO: mask_position
|
# TODO: mask_position
|
||||||
set_name=set_name,
|
set_name=set_name,
|
||||||
emoji=sticker_attributes.alt or None,
|
emoji=sticker_attributes.alt or None,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue