Module tdlight.api

Class TdApi.User

Enclosing class:
TdApi

public static final class TdApi.User extends TdApi.Object
Represents a user.
  • Field Details

    • id

      public long id
      User identifier.
    • firstName

      public String firstName
      First name of the user.
    • lastName

      public String lastName
      Last name of the user.
    • usernames

      public TdApi.Usernames usernames
      Usernames of the user; may be null.
    • phoneNumber

      public String phoneNumber
      Phone number of the user.
    • status

      public TdApi.UserStatus status
      Current online status of the user.
    • profilePhoto

      public TdApi.ProfilePhoto profilePhoto
      Profile photo of the user; may be null.
    • emojiStatus

      public TdApi.EmojiStatus emojiStatus
      Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only.
    • isContact

      public boolean isContact
      The user is a contact of the current user.
    • isMutualContact

      public boolean isMutualContact
      The user is a contact of the current user and the current user is a contact of the user.
    • isCloseFriend

      public boolean isCloseFriend
      The user is a close friend of the current user; implies that the user is a contact.
    • isVerified

      public boolean isVerified
      True, if the user is verified.
    • isPremium

      public boolean isPremium
      True, if the user is a Telegram Premium user.
    • isSupport

      public boolean isSupport
      True, if the user is Telegram support account.
    • restrictionReason

      public String restrictionReason
      If non-empty, it contains a human-readable description of the reason why access to this user must be restricted.
    • isScam

      public boolean isScam
      True, if many users reported this user as a scam.
    • isFake

      public boolean isFake
      True, if many users reported this user as a fake account.
    • hasActiveStories

      public boolean hasActiveStories
      True, if the user has non-expired stories available to the current user.
    • hasUnreadActiveStories

      public boolean hasUnreadActiveStories
      True, if the user has unread non-expired stories available to the current user.
    • haveAccess

      public boolean haveAccess
      If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method.
    • type

      public TdApi.UserType type
      Type of the user.
    • languageCode

      public String languageCode
      IETF language tag of the user's language; only available to bots.
    • addedToAttachmentMenu

      public boolean addedToAttachmentMenu
      True, if the user added the current bot to attachment menu; only available to bots.
    • CONSTRUCTOR

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

    • User

      public User()
      Represents a user.
    • User

      public User(long id, String firstName, String lastName, TdApi.Usernames usernames, String phoneNumber, TdApi.UserStatus status, TdApi.ProfilePhoto profilePhoto, TdApi.EmojiStatus emojiStatus, boolean isContact, boolean isMutualContact, boolean isCloseFriend, boolean isVerified, boolean isPremium, boolean isSupport, String restrictionReason, boolean isScam, boolean isFake, boolean hasActiveStories, boolean hasUnreadActiveStories, boolean haveAccess, TdApi.UserType type, String languageCode, boolean addedToAttachmentMenu)
      Represents a user.
      Parameters:
      id - User identifier.
      firstName - First name of the user.
      lastName - Last name of the user.
      usernames - Usernames of the user; may be null.
      phoneNumber - Phone number of the user.
      status - Current online status of the user.
      profilePhoto - Profile photo of the user; may be null.
      emojiStatus - Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only.
      isContact - The user is a contact of the current user.
      isMutualContact - The user is a contact of the current user and the current user is a contact of the user.
      isCloseFriend - The user is a close friend of the current user; implies that the user is a contact.
      isVerified - True, if the user is verified.
      isPremium - True, if the user is a Telegram Premium user.
      isSupport - True, if the user is Telegram support account.
      restrictionReason - If non-empty, it contains a human-readable description of the reason why access to this user must be restricted.
      isScam - True, if many users reported this user as a scam.
      isFake - True, if many users reported this user as a fake account.
      hasActiveStories - True, if the user has non-expired stories available to the current user.
      hasUnreadActiveStories - True, if the user has unread non-expired stories available to the current user.
      haveAccess - If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method.
      type - Type of the user.
      languageCode - IETF language tag of the user's language; only available to bots.
      addedToAttachmentMenu - True, if the user added the current bot to attachment menu; only available to bots.
    • User

      public User(DataInput input) throws IOException
      Represents a 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