Package org.drinkless.tdlib

# Class TdApi.MessageGift

java.lang.Object
org.drinkless.tdlib.TdApi.Object
org.drinkless.tdlib.TdApi.MessageContent
org.drinkless.tdlib.TdApi.MessageGift

Enclosing class:
  `TdApi`

public static class TdApi.MessageGift extends TdApi.MessageContent
A regular gift was received or sent by the current user, or the current user was notified about a channel gift.

- ## Nested Class Summary

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

  `TdApi.MessageContent.Constructors`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `boolean`
  `canBeUpgraded`
  True, if the gift can be upgraded to a unique gift; only for the receiver of the gift.
  `static final int`
  `CONSTRUCTOR`
  Identifier uniquely determining type of the object.
  `TdApi.Gift`
  `gift`
  The gift.
  `boolean`
  `isFromAuction`
  True, if the message is a notification about a gift won on an auction.
  `boolean`
  `isPrepaidUpgrade`
  True, if the message is about prepaid upgrade of the gift by another user.
  `boolean`
  `isPrivate`
  True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them.
  `boolean`
  `isSaved`
  True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift.
  `boolean`
  `isUpgradeSeparate`
  True, if the upgrade was bought after the gift was sent.
  `String`
  `prepaidUpgradeHash`
  If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade.
  `long`
  `prepaidUpgradeStarCount`
  Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift.
  `String`
  `receivedGiftId`
  Unique identifier of the received gift for the current user; only for the receiver of the gift.
  `TdApi.MessageSender`
  `receiverId`
  Receiver of the gift.
  `long`
  `sellStarCount`
  Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver.
  `TdApi.MessageSender`
  `senderId`
  Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users.
  `TdApi.FormattedText`
  `text`
  Message added to the gift.
  `int`
  `uniqueGiftNumber`
  Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned.
  `String`
  `upgradedReceivedGiftId`
  Identifier of the corresponding upgraded gift; may be empty if unknown.
  `boolean`
  `wasConverted`
  True, if the gift was converted to Telegram Stars; only for the receiver of the gift.
  `boolean`
  `wasRefunded`
  True, if the gift was refunded and isn't available anymore.
  `boolean`
  `wasUpgraded`
  True, if the gift was upgraded to a unique gift.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MessageGift()`
  A regular gift was received or sent by the current user, or the current user was notified about a channel gift.
  `MessageGift(TdApi.Gift gift, TdApi.MessageSender senderId, TdApi.MessageSender receiverId, String receivedGiftId, TdApi.FormattedText text, int uniqueGiftNumber, long sellStarCount, long prepaidUpgradeStarCount, boolean isUpgradeSeparate, boolean isFromAuction, boolean isPrivate, boolean isSaved, boolean isPrepaidUpgrade, boolean canBeUpgraded, boolean wasConverted, boolean wasUpgraded, boolean wasRefunded, String upgradedReceivedGiftId, String prepaidUpgradeHash)`
  A regular gift was received or sent by the current user, or the current user was notified about a channel gift.

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

  `toString`

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

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

- ## Field Details

  - ### gift

    public TdApi.Gift gift
    The gift.

  - ### senderId

    @Nullable public TdApi.MessageSender senderId
    Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users.

  - ### receiverId

    public TdApi.MessageSender receiverId
    Receiver of the gift.

  - ### receivedGiftId

    public String receivedGiftId
    Unique identifier of the received gift for the current user; only for the receiver of the gift.

  - ### text

    public TdApi.FormattedText text
    Message added to the gift.

  - ### uniqueGiftNumber

    public int uniqueGiftNumber
    Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned.

  - ### sellStarCount

    public long sellStarCount
    Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver.

  - ### prepaidUpgradeStarCount

    public long prepaidUpgradeStarCount
    Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift.

  - ### isUpgradeSeparate

    public boolean isUpgradeSeparate
    True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost.

  - ### isFromAuction

    public boolean isFromAuction
    True, if the message is a notification about a gift won on an auction.

  - ### isPrivate

    public boolean isPrivate
    True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them.

  - ### isSaved

    public boolean isSaved
    True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift.

  - ### isPrepaidUpgrade

    public boolean isPrepaidUpgrade
    True, if the message is about prepaid upgrade of the gift by another user.

  - ### canBeUpgraded

    public boolean canBeUpgraded
    True, if the gift can be upgraded to a unique gift; only for the receiver of the gift.

  - ### wasConverted

    public boolean wasConverted
    True, if the gift was converted to Telegram Stars; only for the receiver of the gift.

  - ### wasUpgraded

    public boolean wasUpgraded
    True, if the gift was upgraded to a unique gift.

  - ### wasRefunded

    public boolean wasRefunded
    True, if the gift was refunded and isn't available anymore.

  - ### upgradedReceivedGiftId

    public String upgradedReceivedGiftId
    Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift.

  - ### prepaidUpgradeHash

    public String prepaidUpgradeHash
    If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade.

  - ### CONSTRUCTOR

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

- ## Constructor Details

  - ### MessageGift

    public MessageGift()
    A regular gift was received or sent by the current user, or the current user was notified about a channel gift.

  - ### MessageGift

    public MessageGift(TdApi.Gift gift, TdApi.MessageSender senderId, TdApi.MessageSender receiverId, String receivedGiftId, TdApi.FormattedText text, int uniqueGiftNumber, long sellStarCount, long prepaidUpgradeStarCount, boolean isUpgradeSeparate, boolean isFromAuction, boolean isPrivate, boolean isSaved, boolean isPrepaidUpgrade, boolean canBeUpgraded, boolean wasConverted, boolean wasUpgraded, boolean wasRefunded, String upgradedReceivedGiftId, String prepaidUpgradeHash)
    A regular gift was received or sent by the current user, or the current user was notified about a channel gift.
    Parameters:
      `gift` - The gift.
      `senderId` - Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users.
      `receiverId` - Receiver of the gift.
      `receivedGiftId` - Unique identifier of the received gift for the current user; only for the receiver of the gift.
      `text` - Message added to the gift.
      `uniqueGiftNumber` - Unique number of the gift among gifts upgraded from the same gift after upgrade; 0 if yet unassigned.
      `sellStarCount` - Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can't be sold by the receiver.
      `prepaidUpgradeStarCount` - Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift.
      `isUpgradeSeparate` - True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost.
      `isFromAuction` - True, if the message is a notification about a gift won on an auction.
      `isPrivate` - True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them.
      `isSaved` - True, if the gift is displayed on the user's or the channel's profile page; only for the receiver of the gift.
      `isPrepaidUpgrade` - True, if the message is about prepaid upgrade of the gift by another user.
      `canBeUpgraded` - True, if the gift can be upgraded to a unique gift; only for the receiver of the gift.
      `wasConverted` - True, if the gift was converted to Telegram Stars; only for the receiver of the gift.
      `wasUpgraded` - True, if the gift was upgraded to a unique gift.
      `wasRefunded` - True, if the gift was refunded and isn't available anymore.
      `upgradedReceivedGiftId` - Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift.
      `prepaidUpgradeHash` - If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade.

- ## 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.MessageContent`
    Returns:
      this.CONSTRUCTOR