Skip to content

giftPremiumSubscription

Returns boolean

Gifts a Telegram Premium subscription to the given user.

Required: user_id, month_count, star_count · Optional: 3 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("gift_premium_subscription", {
user_id: 0,
month_count: 0,
star_count: 0
})

Parameters

user_id number Required
Unique identifier of the target user who will receive a Telegram Premium subscription.

month_count number Required
Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12.

star_count number Required
Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months.

text string
Text that will be shown along with the service message about the subscription; 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.