Skip to content

Commit

Permalink
pyrofork: Add pay_for_upgrade in send_gift method
Browse files Browse the repository at this point in the history
Signed-off-by: Yasir Aris <[email protected]>
  • Loading branch information
yasirarism committed Jan 4, 2025
1 parent 1ddc2d2 commit 6c538f0
Showing 1 changed file with 5 additions and 0 deletions.
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``):
Unique identifier of the gift to send.
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 of the message to be sent. 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 6c538f0

Please sign in to comment.