gift_premium_subscription()

async Client.gift_premium_subscription()

Gift a Telegram Premium subscription to a user.

Usable by Users Bots
Parameters:
  • user_id (int | str) – Unique identifier (int) or username (str) of the target user.

  • month_count (int) – Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12.

  • star_count (int) – Number of Telegram Stars to pay for the gift.

  • text (str, optional) – Text that will be shown along with the service message about the subscription; 0-255 characters.

  • text_parse_mode (str, optional) – Mode for parsing entities in the text. See formatting options for more details.

  • text_entities (list, optional) – Special entities that appear in the gift text. It can be specified instead of text_parse_mode.

Returns:

bool – True on success.

Example

# Gift 3-month Premium to a user for 1000 Stars
await app.gift_premium_subscription(user_id, month_count=3, star_count=1000)