Module tdlight.api

Class TdApi.MessagePremiumGiftCode

Enclosing class:
TdApi

public static final class TdApi.MessagePremiumGiftCode extends TdApi.MessageContent
A Telegram Premium gift code was created for the user.
  • Field Details

    • creatorId

      public TdApi.MessageSender creatorId
      Identifier of a chat or a user that created the gift code; may be null if unknown.
    • isFromGiveaway

      public boolean isFromGiveaway
      True, if the gift code was created for a giveaway.
    • isUnclaimed

      public boolean isUnclaimed
      True, if the winner for the corresponding Telegram Premium subscription wasn't chosen.
    • currency

      public String currency
      Currency for the paid amount; empty if unknown.
    • amount

      public long amount
      The paid amount, in the smallest units of the currency; 0 if unknown.
    • cryptocurrency

      public String cryptocurrency
      Cryptocurrency used to pay for the gift; may be empty if none or unknown.
    • cryptocurrencyAmount

      public long cryptocurrencyAmount
      The paid amount, in the smallest units of the cryptocurrency; 0 if unknown.
    • monthCount

      public int monthCount
      Number of months the Telegram Premium subscription will be active after code activation.
    • sticker

      public TdApi.Sticker sticker
      A sticker to be shown in the message; may be null if unknown.
    • code

      public String code
      The gift code.
    • CONSTRUCTOR

      public static final int CONSTRUCTOR
      Identifier uniquely determining type of the object.
      See Also:
  • Constructor Details

    • MessagePremiumGiftCode

      public MessagePremiumGiftCode()
      A Telegram Premium gift code was created for the user.
    • MessagePremiumGiftCode

      public MessagePremiumGiftCode(TdApi.MessageSender creatorId, boolean isFromGiveaway, boolean isUnclaimed, String currency, long amount, String cryptocurrency, long cryptocurrencyAmount, int monthCount, TdApi.Sticker sticker, String code)
      A Telegram Premium gift code was created for the user.
      Parameters:
      creatorId - Identifier of a chat or a user that created the gift code; may be null if unknown.
      isFromGiveaway - True, if the gift code was created for a giveaway.
      isUnclaimed - True, if the winner for the corresponding Telegram Premium subscription wasn't chosen.
      currency - Currency for the paid amount; empty if unknown.
      amount - The paid amount, in the smallest units of the currency; 0 if unknown.
      cryptocurrency - Cryptocurrency used to pay for the gift; may be empty if none or unknown.
      cryptocurrencyAmount - The paid amount, in the smallest units of the cryptocurrency; 0 if unknown.
      monthCount - Number of months the Telegram Premium subscription will be active after code activation.
      sticker - A sticker to be shown in the message; may be null if unknown.
      code - The gift code.
    • MessagePremiumGiftCode

      public MessagePremiumGiftCode(DataInput input) throws IOException
      A Telegram Premium gift code was created for the user.
      Parameters:
      input - Serialized input
      Throws:
      IOException - the deserialization failed
  • 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
    • serialize

      public void serialize(DataOutput output) throws IOException
      Serialize the TDLib class
      Specified by:
      serialize in class TdApi.Object
      Parameters:
      output - output data stream
      Throws:
      IOException - the serialization failed
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object