get_user_gifts()

async Client.get_user_gifts()

Get the gifts owned by a user.

Usable by Users Bots
Parameters:
  • user_id (int | str) – Unique identifier (int) or username (str) of the target user.

  • exclude_unlimited (bool, optional) – Pass True to exclude non-limited gifts.

  • exclude_limited_upgradable (bool, optional) – Pass True to exclude limited gifts that can be upgraded to collectible.

  • exclude_limited_non_upgradable (bool, optional) – Pass True to exclude limited gifts that cannot be upgraded.

  • exclude_unique (bool, optional) – Pass True to exclude unique/collectible gifts.

  • sort_by_price (bool, optional) – Pass True to sort gifts by price instead of reception date.

  • offset (str, optional) – Offset for pagination (use empty string to start from beginning).

  • limit (int, optional) – Maximum number of results to return. Defaults to 100.

Returns:

AsyncGenerator – An async generator yielding StarGift objects.

Example

# Get all gifts of a user
async for gift in app.get_user_gifts(user_id):
    print(gift)