get_chat_gifts()

Client.get_chat_gifts()

Get all gifts owned by specified chat.

Usable by Users Bots
Parameters:
  • chat_id (int | str) – Unique identifier (int) or username (str) of the target chat. For your personal cloud (Saved Messages) you can simply use “me” or “self”. For a contact that exists in your Telegram address book you can use his phone number (str).

  • collection_id (int, optional) – Pass collection identifier to get gifts only from the specified collection.

  • exclude_unsaved (bool, optional) – Pass True to exclude gifts that aren’t saved to the account’s profile page.

  • exclude_saved (bool, optional) – Pass True to exclude gifts that are saved to the account’s profile page.

  • exclude_unlimited (bool, optional) – Pass True to exclude gifts that can be purchased an unlimited number of times.

  • exclude_upgradable (bool, optional) – Pass true to exclude gifts that can be purchased limited number of times and can be upgraded.

  • exclude_non_upgradable (bool, optional) – Pass true to exclude gifts that can be purchased limited number of times and can’t be upgraded.

  • exclude_upgraded (bool, optional) – Pass True to exclude upgraded gifts.

  • exclude_without_colors (bool, optional) – Pass True to exclude gifts that can’t be used in set_upgraded_gift_colors().

  • exclude_hosted (bool, optional) – Pass True to exclude gifts that are just hosted and are not owned by the owner.

  • sort_by_price (bool, optional) – Pass True to sort results by gift price instead of send date. Sorting is applied before pagination.

  • offset (str, optional) – Offset of the first entry to return as received from the previous request.

  • limit (int, optional) – The maximum number of gifts to be returned.

Returns:

Generator – A generator yielding Gift objects.

Example

async for gift in app.get_chat_gifts(chat_id):
    print(gift)