
    i                     H    S SK JrJr  S SKrS SKJrJrJrJr   " S S5      rg)    )OptionalUnionN)errorsrawtypesutilsc                   H    \ rS rSr SSSS\S\\\4   S\S\S	   4
S
 jjrSr	g)TransferGift   Nselfzpyrogram.Clientowned_gift_idnew_owner_chat_idbusiness_connection_idreturnztypes.Messagec                 V  #    [         R                  " X5      I Sh  vN nU R                  U5      I Sh  vN n U R                  [        R
                  R                  R                  UUS9US9I Sh  vN n[         R                  " U [!        U[        R                  R                  R"                  5      (       a  UR$                  OUS9I Sh  vN nU(       a  US   $ S$  N N Nr! [        R                   a    [        R                  R                  UUS9nU R                  [        R
                  R                  R                  U R                  [        R
                  R                  R                  US9US9I Sh  vN  R                  US9US9I Sh  vN  n GN*f = f N7f)a!  Transfers an owned unique gift to another user.

.. note::

    Requires the `can_transfer_and_upgrade_gifts` business bot right.
    Additionally requires the `can_transfer_stars` business bot right if the upgrade is paid.

.. include:: /_includes/usable-by/users-bots.rst

Parameters:
    owned_gift_id (``str``):
        Unique identifier of the regular gift that should be transferred.
        For a user gift, you can use the message ID (int) of the gift message.
        For a channel gift, you can use the packed format `chatID_savedID` (str).
        For a upgraded gift, you can use the gift link.

    new_owner_chat_id (``int`` | ``str``):
        Unique identifier (int) or username (str) of the target chat you want to transfer the star gift to.
        For your personal cloud (Saved Messages) you can simply use "me" or "self".
        For a contact that exists in your Telegram address book you can use his phone number (str).

    business_connection_id (``str``, *optional*):
        Unique identifier of the business connection.
        For bots only.

Returns:
    :obj:`~pyrogram.types.Message`: On success, the sent message is returned.

Example:
    .. code-block:: python

        # Transfer gift to another user
        await app.transfer_gift(owned_gift_id="123", new_owner_chat_id=123)
N)stargiftto_id)r   )invoice)form_idr   )clientmessagesr   )r   get_input_stargiftresolve_peerinvoker   	functionspaymentsTransferStarGiftr   PaymentRequiredr   InputInvoiceStarGiftTransferSendStarsFormGetPaymentFormr   parse_messages
isinstancePaymentResultupdates)	r   r   r   r   r   peerrr   r   s	            T/app/mltbenv/lib/python3.13/site-packages/pyrogram/methods/payments/transfer_gift.pytransfer_giftTransferGift.transfer_gift   s    R 11$FF&&'899	kk&&77% 8  (> "  A4 --",Q		0B0B0P0P"Q"QQYYWX
 

 'x{0D0I G9 %% 	ii<<! = G
 kk&&44#';;..==$+ >  0F	 $/ $  
 w# 5  (> "   A	&
sz   F)C#F)C%F)9C) 4C'5C) 9AF)F'F)%F)'C) )BF$FF$FF$ F)#F$$F) )N)
__name__
__module____qualname____firstlineno__strr   intr   r)   __static_attributes__r+       r(   r
   r
      sS     '+M1M1M1 !c?M1
 !$M1 
/	"M1 M1r3   r
   )	typingr   r   pyrogramr   r   r   r   r
   r+   r3   r(   <module>r6      s   & #  . .N1 N1r3   