get_user_gifts()

Client.get_user_gifts()

Get gifts saved to profile by the given user.

Usable by Users Bots
Parameters:
  • user_id (int | str) – Unique identifier (int) or username (str) of the target user. 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.

Returns:

Generator – A generator yielding UserGift objects.

Example

async for user_gift in app.get_user_gifts(user_id):
    print(user_gift)