transfer_gift()¶
- Client.transfer_gift()¶
Transfers an owned unique gift to another user.
Usable by Users BotsNote
Requires the can_transfer_and_upgrade_gifts business bot right. Additionally requires the can_transfer_stars business bot right if the upgrade is paid.
- 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:
Message– On success, the sent message is returned.
Example
# Transfer gift to another user await app.transfer_gift(owned_gift_id="123", new_owner_chat_id=123)