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

public class Chat extends Object
This object represents a chat.
  • Constructor Details

    • Chat

      public Chat()
  • Method Details

    • getId

      @NonNull public @NonNull Long getId()
      Returns:
      Unique identifier for this chat.
    • setId

      public void setId(@NonNull @NonNull Long id)
      Parameters:
      id - Unique identifier for this chat.
    • getType

      @NonNull public @NonNull String getType()
      Returns:
      Type of chat, can be either “private”, “group”, “supergroup” or “channel”.
    • setType

      public void setType(@NonNull @NonNull String type)
      Parameters:
      type - Type of chat, can be either “private”, “group”, “supergroup” or “channel”.
    • getTitle

      @Nullable public @Nullable String getTitle()
      Returns:
      Title, for supergroups, channels and group chats.
    • setTitle

      public void setTitle(@Nullable @Nullable String title)
      Parameters:
      title - Title, for supergroups, channels and group chats.
    • getUsername

      @Nullable public @Nullable String getUsername()
      Returns:
      Username, for private chats, supergroups and channels if available.
    • setUsername

      public void setUsername(@Nullable @Nullable String username)
      Parameters:
      username - Username, for private chats, supergroups and channels if available.
    • getFirstName

      @Nullable public @Nullable String getFirstName()
      Returns:
      First name of the other party in a private chat.
    • setFirstName

      public void setFirstName(@Nullable @Nullable String firstName)
      Parameters:
      firstName - First name of the other party in a private chat.
    • getLastName

      @Nullable public @Nullable String getLastName()
      Returns:
      Last name of the other party in a private chat.
    • setLastName

      public void setLastName(@Nullable @Nullable String lastName)
      Parameters:
      lastName - Last name of the other party in a private chat.
    • getPhoto

      @Nullable public @Nullable ChatPhoto getPhoto()
      Returns:
      Chat photo. Returned only in getChat.
    • setPhoto

      public void setPhoto(@Nullable @Nullable ChatPhoto photo)
      Parameters:
      photo - Chat photo. Returned only in getChat.
    • getDescription

      @Nullable public @Nullable String getDescription()
      Returns:
      Description, for groups, supergroups and channel chats. Returned only in getChat.
    • setDescription

      public void setDescription(@Nullable @Nullable String description)
      Parameters:
      description - Description, for groups, supergroups and channel chats. Returned only in getChat.
    • getInviteLink

      @Nullable public @Nullable String getInviteLink()
      Returns:
      Chat invite link, for groups, supergroups and channel chats.
    • setInviteLink

      public void setInviteLink(@Nullable @Nullable String inviteLink)
      Parameters:
      inviteLink - Chat invite link, for groups, supergroups and channel chats.
    • getPinnedMessage

      @Nullable public @Nullable Message getPinnedMessage()
      Returns:
      Pinned message, for groups, supergroups and channels. Returned only in getChat.
    • setPinnedMessage

      public void setPinnedMessage(@Nullable @Nullable Message pinnedMessage)
      Parameters:
      pinnedMessage - Pinned message, for groups, supergroups and channels. Returned only in getChat.
    • getPermissions

      @Nullable public @Nullable ChatPermissions getPermissions()
      Returns:
      Default chat member permissions, for groups and supergroups. Returned only in getChat.
    • setPermissions

      public void setPermissions(@Nullable @Nullable ChatPermissions permissions)
      Parameters:
      permissions - Default chat member permissions, for groups and supergroups. Returned only in getChat.
    • getSlowModeDelay

      @Nullable public @Nullable Integer getSlowModeDelay()
      Returns:
      For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user.
    • setSlowModeDelay

      public void setSlowModeDelay(@Nullable @Nullable Integer slowModeDelay)
      Parameters:
      slowModeDelay - For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user.
    • getStickerSetName

      @Nullable public @Nullable String getStickerSetName()
      Returns:
      For supergroups, name of group sticker set. Returned only in getChat.
    • setStickerSetName

      public void setStickerSetName(@Nullable @Nullable String stickerSetName)
      Parameters:
      stickerSetName - For supergroups, name of group sticker set. Returned only in getChat.
    • getCanSetStickerSet

      @Nullable public @Nullable Boolean getCanSetStickerSet()
      Returns:
      True, if the bot can change the group sticker set. Returned only in getChat.
    • setCanSetStickerSet

      public void setCanSetStickerSet(@Nullable @Nullable Boolean canSetStickerSet)
      Parameters:
      canSetStickerSet - True, if the bot can change the group sticker set. Returned only in getChat.
    • getBio

      @Nullable public @Nullable String getBio()
      Returns:
      Bio of the other party in a private chat.
    • setBio

      public void setBio(@Nullable @Nullable String bio)
      Parameters:
      bio - Bio of the other party in a private chat.
    • getHasPrivateForwards

      @Nullable public @Nullable Boolean getHasPrivateForwards()
      Returns:
      True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
    • setHasPrivateForwards

      public void setHasPrivateForwards(@Nullable @Nullable Boolean hasPrivateForwards)
      Parameters:
      hasPrivateForwards - True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
    • getHasRestrictedVoiceAndVideoMessages

      @Nullable public @Nullable Boolean getHasRestrictedVoiceAndVideoMessages()
      Returns:
      True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.
    • setHasRestrictedVoiceAndVideoMessages

      public void setHasRestrictedVoiceAndVideoMessages(@Nullable @Nullable Boolean hasRestrictedVoiceAndVideoMessages)
      Parameters:
      hasRestrictedVoiceAndVideoMessages - True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.
    • getJoinToSendMessages

      @Nullable public @Nullable Boolean getJoinToSendMessages()
      Returns:
      True, if users need to join the supergroup before they can send messages. Returned only in getChat.
    • setJoinToSendMessages

      public void setJoinToSendMessages(@Nullable @Nullable Boolean joinToSendMessages)
      Parameters:
      joinToSendMessages - True, if users need to join the supergroup before they can send messages. Returned only in getChat.
    • getJoinByRequest

      @Nullable public @Nullable Boolean getJoinByRequest()
      Returns:
      True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.
    • setJoinByRequest

      public void setJoinByRequest(@Nullable @Nullable Boolean joinByRequest)
      Parameters:
      joinByRequest - True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.
    • getMessageAutoDeleteTime

      @Nullable public @Nullable Integer getMessageAutoDeleteTime()
      Returns:
      The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
    • setMessageAutoDeleteTime

      public void setMessageAutoDeleteTime(@Nullable @Nullable Integer messageAutoDeleteTime)
      Parameters:
      messageAutoDeleteTime - The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
    • getHasProtectedContent

      @Nullable public @Nullable Boolean getHasProtectedContent()
      Returns:
      Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
    • setHasProtectedContent

      public void setHasProtectedContent(@Nullable @Nullable Boolean hasProtectedContent)
      Parameters:
      hasProtectedContent - Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.
    • getLinkedChatId

      @Nullable public @Nullable Integer getLinkedChatId()
      Returns:
      Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.
    • setLinkedChatId

      public void setLinkedChatId(@Nullable @Nullable Integer linkedChatId)
      Parameters:
      linkedChatId - Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.
    • getLocation

      @Nullable public @Nullable ChatLocation getLocation()
      Returns:
      Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
    • setLocation

      public void setLocation(@Nullable @Nullable ChatLocation location)
      Parameters:
      location - Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
    • toString

      public String toString()
      Overrides:
      toString in class Object