Class MessageEntity

java.lang.Object
io.micronaut.chatbots.telegram.api.MessageEntity

public class MessageEntity extends Object
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
See Also:
  • Constructor Details

    • MessageEntity

      public MessageEntity()
  • Method Details

    • getType

      @NonNull public @NonNull String getType()
      Returns:
      Type of the entity.
    • setType

      public void setType(@NonNull @NonNull String type)
      Parameters:
      type - Type of the entity.
    • getOffset

      @NonNull public @NonNull Integer getOffset()
      Returns:
      Offset in UTF-16 code units to the start of the entity.
    • setOffset

      public void setOffset(@NonNull @NonNull Integer offset)
      Parameters:
      offset - Offset in UTF-16 code units to the start of the entity.
    • getLength

      @NonNull public @NonNull Integer getLength()
      Returns:
      Length of the entity in UTF-16 code units.
    • setLength

      public void setLength(@NonNull @NonNull Integer length)
      Parameters:
      length - Length of the entity in UTF-16 code units.
    • getUrl

      @Nullable public @Nullable String getUrl()
      Returns:
      For “text_link” only, url that will be opened after user taps on the text.
    • setUrl

      public void setUrl(@Nullable @Nullable String url)
      Parameters:
      url - For “text_link” only, url that will be opened after user taps on the text.
    • getUser

      @Nullable public @Nullable User getUser()
      Returns:
      For “text_mention” only, the mentioned user.
    • setUser

      public void setUser(@Nullable @Nullable User user)
      Parameters:
      user - For “text_mention” only, the mentioned user.
    • getLanguage

      @Nullable public @Nullable String getLanguage()
      Returns:
      For “pre” only, the programming language of the entity text
    • setLanguage

      public void setLanguage(@Nullable @Nullable String language)
      Parameters:
      language - For “pre” only, the programming language of the entity text
    • getCustomEmojiId

      @Nullable public @Nullable String getCustomEmojiId()
      Returns:
      For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
    • setCustomEmojiId

      public void setCustomEmojiId(@Nullable @Nullable String customEmojiId)
      Parameters:
      customEmojiId - For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker
    • toString

      public String toString()
      Overrides:
      toString in class Object