Package org.drinkless.tdlib

# Class TdApi.GiftPremiumWithStars

java.lang.Object
org.drinkless.tdlib.TdApi.Object
org.drinkless.tdlib.TdApi.Function<TdApi.Ok>
org.drinkless.tdlib.TdApi.GiftPremiumWithStars

Enclosing class:
  `TdApi`

public static class TdApi.GiftPremiumWithStars extends TdApi.Function<TdApi.Ok>
Allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars; for bots only.

Returns `Ok`

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.drinkless.tdlib.TdApi.Function

  `TdApi.Function.Constructors`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `CONSTRUCTOR`
  Identifier uniquely determining type of the object.
  `int`
  `monthCount`
  Number of months the Telegram Premium subscription will be active for the user.
  `long`
  `starCount`
  The number of Telegram Stars to pay for subscription.
  `TdApi.FormattedText`
  `text`
  Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters.
  `long`
  `userId`
  Identifier of the user which will receive Telegram Premium.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GiftPremiumWithStars()`
  Default constructor for a function, which allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars; for bots only.
  `GiftPremiumWithStars(long userId, long starCount, int monthCount, TdApi.FormattedText text)`
  Creates a function, which allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars; for bots only.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getConstructor()`
  Returns an identifier uniquely determining type of the object.

  ### Methods inherited from class org.drinkless.tdlib.TdApi.Function

  `toString`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### userId

    public long userId
    Identifier of the user which will receive Telegram Premium.

  - ### starCount

    public long starCount
    The number of Telegram Stars to pay for subscription.

  - ### monthCount

    public int monthCount
    Number of months the Telegram Premium subscription will be active for the user.

  - ### text

    public TdApi.FormattedText text
    Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed.

  - ### CONSTRUCTOR

    public static final int CONSTRUCTOR
    Identifier uniquely determining type of the object.
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### GiftPremiumWithStars

    public GiftPremiumWithStars()
    Default constructor for a function, which allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars; for bots only.

    Returns `Ok`

  - ### GiftPremiumWithStars

    public GiftPremiumWithStars(long userId, long starCount, int monthCount, TdApi.FormattedText text)
    Creates a function, which allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars; for bots only.

    Returns `Ok`

    Parameters:
      `userId` - Identifier of the user which will receive Telegram Premium.
      `starCount` - The number of Telegram Stars to pay for subscription.
      `monthCount` - Number of months the Telegram Premium subscription will be active for the user.
      `text` - Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed.

- ## Method Details

  - ### getConstructor

    public int getConstructor()
    Description copied from class: `TdApi.Object`
    Returns an identifier uniquely determining type of the object.
    Specified by:
      `getConstructor` in class `TdApi.Function<TdApi.Ok>`
    Returns:
      this.CONSTRUCTOR