get_received_gifts()#

Client.get_received_gifts()#

Returns gifts received by the given user or chat.

Usable by Users Bots
Parameters:
  • owner_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).

  • offset (str, optional) – Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results.

  • limit (int, optional) – The maximum number of gifts to be returned; must be positive and can’t be greater than 100. For optimal performance, the number of returned objects is chosen by Telegram Server and can be smaller than the specified limit.

  • exclude_unsaved (bool, optional) – Pass True to exclude gifts that aren’t saved to the chat’s profile page. Always True for gifts received by other users and channel chats without can_post_messages administrator right.

  • exclude_saved (bool, optional) – Pass True to exclude gifts that are saved to the chat’s profile page. Always False for gifts received by other users and channel chats without can_post_messages administrator right.

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

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

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

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

Returns:

Generator – A generator yielding ReceivedGift objects.

Example

async for received_gift in app.get_received_gifts(owner_id):
    print(received_gift)