Skip to content

Commit

Permalink
Added the parameter pay_for_upgrade to the method send_gift.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpEcHiDe committed Jan 3, 2025
1 parent a240b7b commit 854caa1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/releases/changes-in-this-fork.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Changes in this Fork
| Scheme layer used: 196 |
+------------------------+

- Added the ``pay_for_upgrade`` in the :meth:`~pyrogram.Client.send_gift`.
- Added the parameters ``upgrade_star_count`` and ``is_for_birthday`` in :obj:`~pyrogram.types.Gift`.
- Added the :meth:`~pyrogram.Client.on_bot_purchased_paid_media` and :meth:`~pyrogram.Client.on_bot_business_connection`.
- 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`.
Expand Down
5 changes: 5 additions & 0 deletions pyrogram/methods/business/send_gift.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ async def send_gift(
self: "pyrogram.Client",
user_id: Union[int, str],
gift_id: int,
pay_for_upgrade: Optional[bool] = None,
text: Optional[str] = None,
parse_mode: Optional["enums.ParseMode"] = None,
entities: Optional[list["types.MessageEntity"]] = None,
Expand All @@ -46,6 +47,9 @@ async def send_gift(
gift_id (``int``):
Identifier of the gift.
pay_for_upgrade (``bool``, *optional*):
Pass True to pay for the gift upgrade from the sender's balance, thereby making the upgrade free for the receiver.
text (``str``, *optional*):
Text that will be shown along with the gift. 0-``gift_text_length_max`` characters.
Expand Down Expand Up @@ -84,6 +88,7 @@ async def send_gift(
user_id=peer,
gift_id=gift_id,
hide_name=is_private,
include_upgrade=pay_for_upgrade,
message=raw.types.TextWithEntities(
text=text, entities=entities or []
) if text else None
Expand Down

0 comments on commit 854caa1

Please sign in to comment.