You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/releases/changes-in-this-fork.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,6 +33,7 @@ Changes in this Fork
33
33
| Scheme layer used: 200 |
34
34
+------------------------+
35
35
36
+
- Rename ``UserGift`` to :obj:`~pyrogram.types.ReceivedGift`, ``get_user_gifts`` to :meth:`~pyrogram.Client.get_received_gifts` and the corresponding fields appropriately.
36
37
- Added the field ``paid_message_star_count`` to the classes :obj:`~pyrogram.types.Chat`, :obj:`~pyrogram.types.Message` and :obj:`~pyrogram.types.User`.
37
38
- Added the parameter ``paid_message_star_count`` to the methods :meth:`~pyrogram.Client.copy_media_group`, :meth:`~pyrogram.Client.send_game`, :meth:`~pyrogram.Client.send_invoice`, :meth:`~pyrogram.Client.forward_messages`, :meth:`~pyrogram.Client.send_animation`, :meth:`~pyrogram.Client.send_audio`, :meth:`~pyrogram.Client.send_cached_media`, :meth:`~pyrogram.Client.send_contact`, :meth:`~pyrogram.Client.send_dice`, :meth:`~pyrogram.Client.send_document`, :meth:`~pyrogram.Client.send_location`, :meth:`~pyrogram.Client.send_media_group`, :meth:`~pyrogram.Client.send_message`, :meth:`~pyrogram.Client.send_paid_media`, :meth:`~pyrogram.Client.send_photo`, :meth:`~pyrogram.Client.send_poll`, :meth:`~pyrogram.Client.send_sticker`, :meth:`~pyrogram.Client.send_venue`, :meth:`~pyrogram.Client.send_video_note`, :meth:`~pyrogram.Client.send_video`, :meth:`~pyrogram.Client.send_voice` and the bound methods :meth:`~pyrogram.types.Message.forward` and :meth:`~pyrogram.types.Message.copy`.
38
39
- View `new and changed <https://telegramplayground.github.io/TG-APIs/TL/diff/tdlib.html?from=199&to=200>`__ `raw API methods <https://telegramplayground.github.io/TG-APIs/TL/diff/tdesktop.html?from=199&to=200>`__.
"""Returns gifts received by the given user or chat.
34
40
35
41
.. include:: /_includes/usable-by/users.rst
36
42
37
43
Parameters:
38
-
chat_id (``int`` | ``str``):
44
+
owner_id (``int`` | ``str``):
39
45
Unique identifier (int) or username (str) of the target chat.
40
46
For your personal cloud (Saved Messages) you can simply use "me" or "self".
41
47
For a contact that exists in your Telegram address book you can use his phone number (str).
@@ -46,16 +52,34 @@ async def get_user_gifts(
46
52
limit (``int``, *optional*):
47
53
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.
48
54
55
+
exclude_unsaved (``bool``, *optional*):
56
+
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.
57
+
58
+
exclude_saved (``bool``, *optional*):
59
+
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.
60
+
61
+
exclude_unlimited (``bool``, *optional*):
62
+
Pass True to exclude gifts that can be purchased unlimited number of times.
63
+
64
+
exclude_limited (``bool``, *optional*):
65
+
Pass True to exclude gifts that can be purchased limited number of times.
66
+
67
+
exclude_upgraded (``bool``, *optional*):
68
+
Pass True to exclude upgraded gifts.
69
+
70
+
sort_by_price (``bool``, *optional*):
71
+
Pass True to sort results by gift price instead of send date.
72
+
49
73
Returns:
50
-
``Generator``: A generator yielding :obj:`~pyrogram.types.UserGift` objects.
74
+
``Generator``: A generator yielding :obj:`~pyrogram.types.ReceivedGift` objects.
51
75
52
76
Example:
53
77
.. code-block:: python
54
78
55
-
async for user_gift in app.get_user_gifts(user_id):
56
-
print(user_gift)
79
+
async for received_gift in app.get_received_gifts(owner_id):
0 commit comments