Class 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

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Identifier uniquely determining type of the object.
    long
    Identifier of the gift to send.
    boolean
    Pass true to show gift text and sender only to the gift receiver; otherwise, everyone will be able to see them.
    Identifier of the user or the channel chat that will receive the gift.
    boolean
    Pass true to additionally pay for the gift upgrade and allow the receiver to upgrade it for free.
    Text to show along with the gift; 0-getOption("gift_text_length_max") characters.
  • Constructor Summary

    Constructors
    Constructor
    Description
    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
    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.
    • 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, and CustomEmoji 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:
  • 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.
      text - Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji 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.Object
      Returns:
      this.CONSTRUCTOR