Skip to content

sendGift

Returns boolean

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

Required: gift_id · Optional: 6 parameters

Limits:

  • text: 0-128 characters
Try it
Token saved
Response

TypeScript example · @effect-ak/tg-bot-client
import { makeTgBotClient } from "@effect-ak/tg-bot-client"
const client = makeTgBotClient({ bot_token: "YOUR_BOT_TOKEN" })
const result = await client.execute("send_gift", {
gift_id: "..."
})

Parameters

gift_id string Required
Identifier of the gift; limited gifts can’t be sent to channel chats.

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

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

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

text string
Text that will be shown along with the gift; 0-128 characters.

text_parse_mode "HTML" | "MarkdownV2"
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 MessageEntity[]
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.

sendAnimation · sendAudio · sendChatAction · sendChecklist · sendContact · sendDice · sendDocument · sendGame · sendInvoice · sendLocation · sendMediaGroup · sendMessage · sendMessageDraft · sendPaidMedia · sendPhoto · sendPoll · sendSticker · sendVenue · sendVideo · sendVideoNote · sendVoice