Class TdApi.SponsoredMessage

java.lang.Object
org.drinkless.tdlib.TdApi.Object
org.drinkless.tdlib.TdApi.SponsoredMessage
Enclosing class:
TdApi

public static class TdApi.SponsoredMessage extends TdApi.Object
Describes a sponsored message.
  • Field Details

    • messageId

      public long messageId
      Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages.
    • isRecommended

      public boolean isRecommended
      True, if the message needs to be labeled as "recommended" instead of "sponsored".
    • canBeReported

      public boolean canBeReported
      True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage.
    • content

      public TdApi.MessageContent content
      Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen. The content must be fully downloaded before the message is shown.
    • title

      public String title
      Title of the sponsored message.
    • buttonText

      public String buttonText
      Text for the message action button.
    • accentColorId

      public int accentColorId
      Identifier of the accent color for title, button text and message background.
    • backgroundCustomEmojiId

      public long backgroundCustomEmojiId
      Identifier of a custom emoji to be shown on the message background; 0 if none.
    • additionalInfo

      public String additionalInfo
      If non-empty, additional information about the sponsored message to be shown along with the message.
    • CONSTRUCTOR

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

    • SponsoredMessage

      public SponsoredMessage()
      Describes a sponsored message.
    • SponsoredMessage

      public SponsoredMessage(long messageId, boolean isRecommended, boolean canBeReported, TdApi.MessageContent content, TdApi.AdvertisementSponsor sponsor, String title, String buttonText, int accentColorId, long backgroundCustomEmojiId, String additionalInfo)
      Describes a sponsored message.
      Parameters:
      messageId - Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages.
      isRecommended - True, if the message needs to be labeled as "recommended" instead of "sponsored".
      canBeReported - True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage.
      content - Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen. The content must be fully downloaded before the message is shown.
      sponsor - Information about the sponsor of the message.
      title - Title of the sponsored message.
      buttonText - Text for the message action button.
      accentColorId - Identifier of the accent color for title, button text and message background.
      backgroundCustomEmojiId - Identifier of a custom emoji to be shown on the message background; 0 if none.
      additionalInfo - If non-empty, additional information about the sponsored message to be shown along with the message.
  • 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