sendGift¶
Returns: bool
- class aiogram.methods.send_gift.SendGift(*, user_id: int, gift_id: str, pay_for_upgrade: bool | None = None, text: str | None = None, text_parse_mode: str | None = None, text_entities: list[MessageEntity] | None = None, **extra_data: Any)[source]¶
Sends a gift to the given user. The gift can’t be converted to Telegram Stars by the user. Returns
True
on success.Source: https://core.telegram.org/bots/api#sendgift
- user_id: int¶
Unique identifier of the target user that will receive the gift
- gift_id: str¶
Identifier of the gift
- pay_for_upgrade: bool | None¶
Pass
True
to pay for the gift upgrade from the bot’s balance, thereby making the upgrade free for the receiver
- text: str | None¶
Text that will be shown along with the gift; 0-255 characters
- text_parse_mode: str | None¶
Mode for parsing entities in the text. See formatting options for more details. Entities other than ‘bold’, ‘italic’, ‘underline’, ‘strikethrough’, ‘spoiler’, and ‘custom_emoji’ are ignored.
- text_entities: list[MessageEntity] | None¶
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’, and ‘custom_emoji’ are ignored.
Usage¶
As bot method¶
result: bool = await bot.send_gift(...)
Method as object¶
Imports:
from aiogram.methods.send_gift import SendGift
alias:
from aiogram.methods import SendGift
With specific bot¶
result: bool = await bot(SendGift(...))
As reply into Webhook in handler¶
return SendGift(...)