peyk.platforms.telegram.methods.send_gift

async peyk.platforms.telegram.methods.send_gift(self, gift_id: str, *, user_id: int | None = None, chat_id: int | str | None = None, pay_for_upgrade: bool | None = None, text: str | None = None, text_parse_mode: str | None = None, text_entities: List[MessageEntity] | None = None) bool

Sends a gift to the given user or channel chat. The gift can’t be converted to Telegram Stars by the receiver. Returns True on success.

Parameters:
  • gift_id – Identifier of the gift; limited gifts can’t be sent to channel chats

  • user_id – Required if chat_id is not specified. Unique identifier of the target user who will receive the gift.

  • chat_id – Required if user_id is not specified. Unique identifier for the chat or username of the channel (in the format @username) that will receive the gift.

  • pay_for_upgrade – Pass True to pay for the gift upgrade from the bot’s balance, thereby making the upgrade free for the receiver

  • text – Text that will be shown along with the gift; 0-128 characters

  • text_parse_mode – Mode for parsing entities in the text. See formatting options for more details. Entities other than ‘bold’, ‘italic’, ‘underline’, ‘strikethrough’, ‘spoiler’, ‘custom_emoji’, and ‘date_time’ are ignored.

  • text_entities – A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than ‘bold’, ‘italic’, ‘underline’, ‘strikethrough’, ‘spoiler’, ‘custom_emoji’, and ‘date_time’ are ignored.

Returns:

Result returned by Telegram on successful execution.

Return type:

bool