@@ -83,6 +83,9 @@ class Gift(Object):
8383 host_id (``int``, *optional*):
8484 Identifier of the user or the chat to which the upgraded gift was assigned from blockchain.
8585
86+ host (:obj:`~pyrogram.types.Chat`, *optional*):
87+ User or the chat to which the upgraded gift was assigned from blockchain.
88+
8689 owner (:obj:`~pyrogram.types.Chat`, *optional*):
8790 Current gift owner.
8891
@@ -224,6 +227,7 @@ def __init__(
224227 locked_until_date : Optional [datetime ] = None ,
225228 from_user : Optional ["types.User" ] = None ,
226229 host_id : Optional [int ] = None ,
230+ host : Optional ["types.Chat" ] = None ,
227231 owner : Optional ["types.Chat" ] = None ,
228232 owner_name : Optional [str ] = None ,
229233 owner_address : Optional [str ] = None ,
@@ -283,6 +287,7 @@ def __init__(
283287 self .locked_until_date = locked_until_date
284288 self .from_user = from_user
285289 self .host_id = host_id
290+ self .host = host
286291 self .owner = owner
287292 self .owner_name = owner_name
288293 self .owner_address = owner_address
@@ -334,7 +339,7 @@ async def _parse(client, gift, users: Dict[int, "raw.base.User"] = {}, chats: Di
334339 return await Gift ._parse_regular (client , gift , users , chats )
335340 elif isinstance (gift , raw .types .StarGiftUnique ):
336341 return await Gift ._parse_unique (client , gift , users , chats )
337- elif isinstance (gift , raw .types .StarGiftSaved ):
342+ elif isinstance (gift , raw .types .SavedStarGift ):
338343 return await Gift ._parse_saved (client , gift , users , chats )
339344
340345 @staticmethod
@@ -383,7 +388,8 @@ async def _parse_unique(
383388 if not isinstance (star_gift , raw .types .StarGiftUnique ):
384389 return
385390
386- owner_id = utils .get_raw_peer_id (star_gift .owner_id )
391+ raw_host_id = utils .get_raw_peer_id (star_gift .host_id )
392+ raw_owner_id = utils .get_raw_peer_id (star_gift .owner_id )
387393
388394 return Gift (
389395 id = star_gift .id ,
@@ -401,7 +407,8 @@ async def _parse_unique(
401407 is_theme_available = star_gift .theme_available ,
402408 used_theme_chat_id = utils .get_peer_id (star_gift .theme_peer ) if star_gift .theme_peer else None ,
403409 host_id = utils .get_peer_id (star_gift .host_id ) if star_gift .host_id else None ,
404- owner = types .Chat ._parse_chat (client , users .get (owner_id ) or chats .get (owner_id )),
410+ host = types .Chat ._parse_chat (client , users .get (raw_host_id ) or chats .get (raw_host_id )),
411+ owner = types .Chat ._parse_chat (client , users .get (raw_owner_id ) or chats .get (raw_owner_id )),
405412 owner_name = star_gift .owner_name ,
406413 owner_address = star_gift .owner_address ,
407414 gift_address = star_gift .gift_address ,
0 commit comments