Package org.drinkless.tdlib

# Class TdApi.SendGift

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

Enclosing class:
  `TdApi`

public static class TdApi.SendGift extends TdApi.Function<TdApi.Ok>
Sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out.

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.
  `long`
  `giftId`
  Identifier of the gift to send.
  `boolean`
  `isPrivate`
  Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them.
  `TdApi.MessageSender`
  `ownerId`
  Identifier of the user or the channel chat that will receive the gift; limited gifts can't be sent to channel chats.
  `boolean`
  `payForUpgrade`
  Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free.
  `TdApi.FormattedText`
  `text`
  Text to show along with the gift; 0-getOption("gift_text_length_max") characters.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SendGift()`
  Default constructor for a function, which sends a gift to another user or channel chat.
  `SendGift(long giftId, TdApi.MessageSender ownerId, TdApi.FormattedText text, boolean isPrivate, boolean payForUpgrade)`
  Creates a function, which sends a gift to another user or channel chat.

- ## 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

  - ### giftId

    public long giftId
    Identifier of the gift to send.

  - ### ownerId

    public TdApi.MessageSender ownerId
    Identifier of the user or the channel chat that will receive the gift; limited gifts can't be sent to channel chats.

  - ### text

    public TdApi.FormattedText text
    Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed. Must be empty if the receiver enabled paid messages.

  - ### isPrivate

    public boolean isPrivate
    Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them.

  - ### payForUpgrade

    public boolean payForUpgrade
    Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free.

  - ### CONSTRUCTOR

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

- ## Constructor Details

  - ### SendGift

    public SendGift()
    Default constructor for a function, which sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out.

    Returns `Ok`

  - ### SendGift

    public SendGift(long giftId, TdApi.MessageSender ownerId, TdApi.FormattedText text, boolean isPrivate, boolean payForUpgrade)
    Creates a function, which sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift was sold out.

    Returns `Ok`

    Parameters:
      `giftId` - Identifier of the gift to send.
      `ownerId` - Identifier of the user or the channel chat that will receive the gift; limited gifts can't be sent to channel chats.
      `text` - Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, and DateTime entities are allowed. Must be empty if the receiver enabled paid messages.
      `isPrivate` - Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them.
      `payForUpgrade` - Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free.

- ## 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