mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
pyrofork: Add pay_for_upgrade in send_gift method
Signed-off-by: Yasir Aris <git@yasir.id>
This commit is contained in:
parent
1ddc2d268b
commit
6c538f026d
1 changed files with 5 additions and 0 deletions
|
|
@ -28,6 +28,7 @@ class SendGift:
|
||||||
self: "pyrogram.Client",
|
self: "pyrogram.Client",
|
||||||
user_id: Union[int, str],
|
user_id: Union[int, str],
|
||||||
gift_id: int,
|
gift_id: int,
|
||||||
|
pay_for_upgrade: Optional[bool] = None,
|
||||||
text: Optional[str] = None,
|
text: Optional[str] = None,
|
||||||
parse_mode: Optional["enums.ParseMode"] = None,
|
parse_mode: Optional["enums.ParseMode"] = None,
|
||||||
entities: Optional[List["types.MessageEntity"]] = None,
|
entities: Optional[List["types.MessageEntity"]] = None,
|
||||||
|
|
@ -46,6 +47,9 @@ class SendGift:
|
||||||
gift_id (``int``):
|
gift_id (``int``):
|
||||||
Unique identifier of the gift to send.
|
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 (``str``, *optional*):
|
||||||
Text of the message to be sent. 0-``gift_text_length_max`` characters.
|
Text of the message to be sent. 0-``gift_text_length_max`` characters.
|
||||||
|
|
||||||
|
|
@ -84,6 +88,7 @@ class SendGift:
|
||||||
user_id=peer,
|
user_id=peer,
|
||||||
gift_id=gift_id,
|
gift_id=gift_id,
|
||||||
hide_name=is_private,
|
hide_name=is_private,
|
||||||
|
include_upgrade=pay_for_upgrade,
|
||||||
message=raw.types.TextWithEntities(
|
message=raw.types.TextWithEntities(
|
||||||
text=text, entities=entities or []
|
text=text, entities=entities or []
|
||||||
) if text else None
|
) if text else None
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue