search_gifts_for_resale()

Client.search_gifts_for_resale()

Get upgraded gifts that can be bought from other owners.

Usable by Users Bots
Parameters:
  • gift_id (int) – Identifier of the regular gift that was upgraded to a unique gift.

  • order (GiftForResaleOrder) – Order in which the results will be sorted.

  • attributes (List of UpgradedGiftAttributeId, optional) – Attributes used to filter received gifts. If multiple attributes of the same type are specified, then all of them are allowed. If none attributes of specific type are specified, then all values for this attribute type are allowed.

  • limit (int, optional) – The maximum number of gifts to return. Default is 0 (no limit).

  • offset (str, optional) – The offset from which to start returning results. Default is “” (no offset).

Returns:

Generator – A generator yielding Gift objects.

Example

async for gift in app.search_gifts_for_resale(gift_id=123456):
    print(gift)

# Buy first gift from resale market
async for gift in app.search_gifts_for_resale(gift_id=123456, limit=1):
    await app.send_resold_gift(gift_link=gift.link, new_owner_chat_id="me") # or just use await gift.buy()