Skip to content

Commit 854caa1

Browse files
committed
Added the parameter pay_for_upgrade to the method send_gift.
1 parent a240b7b commit 854caa1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/source/releases/changes-in-this-fork.rst

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Changes in this Fork
2525
| Scheme layer used: 196 |
2626
+------------------------+
2727

28+
- Added the ``pay_for_upgrade`` in the :meth:`~pyrogram.Client.send_gift`.
2829
- Added the parameters ``upgrade_star_count`` and ``is_for_birthday`` in :obj:`~pyrogram.types.Gift`.
2930
- Added the :meth:`~pyrogram.Client.on_bot_purchased_paid_media` and :meth:`~pyrogram.Client.on_bot_business_connection`.
3031
- Added the parameters ``can_be_upgraded``, ``was_refunded``, ``prepaid_upgrade_star_count``, ``can_be_transferred``, ``transfer_star_count``, ``export_date`` in :obj:`~pyrogram.types.UserGift`.

pyrogram/methods/business/send_gift.py

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ async def send_gift(
2828
self: "pyrogram.Client",
2929
user_id: Union[int, str],
3030
gift_id: int,
31+
pay_for_upgrade: Optional[bool] = None,
3132
text: Optional[str] = None,
3233
parse_mode: Optional["enums.ParseMode"] = None,
3334
entities: Optional[list["types.MessageEntity"]] = None,
@@ -46,6 +47,9 @@ async def send_gift(
4647
gift_id (``int``):
4748
Identifier of the gift.
4849
50+
pay_for_upgrade (``bool``, *optional*):
51+
Pass True to pay for the gift upgrade from the sender's balance, thereby making the upgrade free for the receiver.
52+
4953
text (``str``, *optional*):
5054
Text that will be shown along with the gift. 0-``gift_text_length_max`` characters.
5155
@@ -84,6 +88,7 @@ async def send_gift(
8488
user_id=peer,
8589
gift_id=gift_id,
8690
hide_name=is_private,
91+
include_upgrade=pay_for_upgrade,
8792
message=raw.types.TextWithEntities(
8893
text=text, entities=entities or []
8994
) if text else None

0 commit comments

Comments
 (0)