send_resold_gift()

async Client.send_resold_gift()

Send an upgraded gift that is available for resale to another user or channel chat.

Note

Gifts already owned by the current user must be transferred using transfer_gift() and can’t be passed to this method.

Usable by Users Bots
Parameters:
  • gift_link (str) – Link to the gift.

  • 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).

  • price (GiftResalePrice) – The price that the user agreed to pay for the gift.

  • text (str, optional) – Text of the message to be sent with the gift.

  • parse_mode (ParseMode, optional) – By default, texts are parsed using both Markdown and HTML styles. You can combine both syntaxes together.

  • entities (List of MessageEntity, optional) – List of special entities that appear in message text, which can be specified instead of parse_mode.

  • show_name (bool, optional) – Pass True to show the sender’s name to the gift receiver. Otherwise, the gift is sent anonymously.

Returns:

Message – On success, the sent message is returned.

Example

# Buy gift from telegram market and transfer it to another user
await app.send_resold_gift(
    gift_link="https://t.me/nft/NekoHelmet-9215",
    new_owner_chat_id=123,
    price=types.GiftResalePriceStar(star_count=100_000)
)

# Buy ton gift
from wzgram import utils

await app.send_resold_gift(
    gift_link="https://t.me/nft/NekoHelmet-9215",
    new_owner_chat_id=123,
    price=types.GiftResalePriceTon(
        toncoin_cent_count=utils.to_nano(5) # 5 ton
    )
)