@@ -184,6 +184,16 @@ class Gift(Object):
184184 is_pinned (``bool``, *optional*):
185185 True, if the gift is pinned.
186186
187+ is_upgrade_separate (``bool``, *optional*):
188+ True, if the upgrade was bought after the gift was sent.
189+ In this case, prepaid upgrade cost must not be added to the gift cost.
190+
191+ is_theme_available (``bool``, *optional*):
192+ True, if the gift can be used to set a theme in a chat.
193+
194+ used_theme_chat_id (``int``, *optional*):
195+ Identifier of the chat for which the gift is used to set a theme.
196+
187197 raw (:obj:`~pyrogram.raw.base.StarGift`, *optional*):
188198 The raw object as received from the server.
189199
@@ -246,6 +256,9 @@ def __init__(
246256 is_for_birthday : Optional [bool ] = None ,
247257 is_premium : Optional [bool ] = None ,
248258 is_pinned : Optional [bool ] = None ,
259+ is_upgrade_separate : Optional [bool ] = None ,
260+ is_theme_available : Optional [bool ] = None ,
261+ used_theme_chat_id : Optional [int ] = None ,
249262 raw : Optional ["raw.base.StarGift" ] = None
250263 ):
251264 super ().__init__ (client )
@@ -300,6 +313,9 @@ def __init__(
300313 self .is_for_birthday = is_for_birthday
301314 self .is_premium = is_premium
302315 self .is_pinned = is_pinned
316+ self .is_upgrade_separate = is_upgrade_separate
317+ self .is_theme_available = is_theme_available
318+ self .used_theme_chat_id = used_theme_chat_id
303319 self .raw = raw
304320
305321 @staticmethod
@@ -372,6 +388,8 @@ async def _parse_unique(
372388 total_upgraded_count = star_gift .availability_total ,
373389 max_upgraded_count = star_gift .availability_issued ,
374390 is_premium = star_gift .require_premium ,
391+ is_theme_available = star_gift .theme_available ,
392+ used_theme_chat_id = utils .get_peer_id (star_gift .theme_peer ) if star_gift .theme_peer else None ,
375393 owner = types .Chat ._parse_chat (client , users .get (owner_id ) or chats .get (owner_id )),
376394 owner_name = star_gift .owner_name ,
377395 owner_address = star_gift .owner_address ,
@@ -411,6 +429,7 @@ async def _parse_saved(
411429 parsed_gift .is_saved = not saved_gift .unsaved
412430 parsed_gift .is_refunded = saved_gift .refunded
413431 parsed_gift .is_pinned = saved_gift .pinned_to_top
432+ parsed_gift .is_upgrade_separate = saved_gift .upgrade_separate
414433 parsed_gift .can_upgrade = saved_gift .can_upgrade
415434 parsed_gift .from_user = types .User ._parse (client , users .get (utils .get_raw_peer_id (saved_gift .from_id )))
416435 parsed_gift .caption = caption
@@ -447,6 +466,7 @@ async def _parse_action(
447466 parsed_gift .is_converted = action .converted
448467 parsed_gift .is_upgraded = action .upgraded
449468 parsed_gift .is_refunded = action .refunded
469+ parsed_gift .is_upgrade_separate = action .upgrade_separate
450470 parsed_gift .can_upgrade = action .can_upgrade
451471 parsed_gift .caption = caption
452472 parsed_gift .caption_entities = caption_entities
0 commit comments