Module tdlight.api
Package it.tdlight.jni

# Class TdApi.User

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.User

Enclosing class:
  TdApi

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

## Field Summary

Fields
Modifier and Type
Field
Description
`int`
`accentColorId`
Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview.
`boolean`
`addedToAttachmentMenu`
True, if the user added the current bot to attachment menu; only available to bots.
`long`
`backgroundCustomEmojiId`
Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none.
`static final int`
`CONSTRUCTOR`
Identifier uniquely determining type of the object.
`TdApi.EmojiStatus`
`emojiStatus`
Emoji status to be shown instead of the default Telegram Premium badge; may be null.
`String`
`firstName`
First name of the user.
`boolean`
`hasActiveStories`
True, if the user has non-expired stories available to the current user.
`boolean`
`hasUnreadActiveStories`
True, if the user has unread non-expired stories available to the current user.
`boolean`
`haveAccess`
If false, the user is inaccessible, and the only information known about the user is inside this class.
`long`
`id`
User identifier.
`boolean`
`isCloseFriend`
The user is a close friend of the current user; implies that the user is a contact.
`boolean`
`isContact`
The user is a contact of the current user.
`boolean`
`isFake`
True, if many users reported this user as a fake account.
`boolean`
`isMutualContact`
The user is a contact of the current user and the current user is a contact of the user.
`boolean`
`isPremium`
True, if the user is a Telegram Premium user.
`boolean`
`isScam`
True, if many users reported this user as a scam.
`boolean`
`isSupport`
True, if the user is Telegram support account.
`boolean`
`isVerified`
True, if the user is verified.
`String`
`languageCode`
IETF language tag of the user's language; only available to bots.
`String`
`lastName`
Last name of the user.
`String`
`phoneNumber`
Phone number of the user.
`int`
`profileAccentColorId`
Identifier of the accent color for the user's profile; -1 if none.
`long`
`profileBackgroundCustomEmojiId`
Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none.
`TdApi.ProfilePhoto`
`profilePhoto`
Profile photo of the user; may be null.
`String`
`restrictionReason`
If non-empty, it contains a human-readable description of the reason why access to this user must be restricted.
`boolean`
`restrictsNewChats`
True, if the user may restrict new chats with non-contacts.
`TdApi.UserStatus`
`status`
Current online status of the user.
`TdApi.UserType`
`type`
Type of the user.
`TdApi.Usernames`
`usernames`
Usernames of the user; may be null.

## Constructor Summary

Constructors
Constructor
Description
`User()`
Represents a user.
`User(long id, String firstName, String lastName, TdApi.Usernames usernames, String phoneNumber, TdApi.UserStatus status, TdApi.ProfilePhoto profilePhoto, int accentColorId, long backgroundCustomEmojiId, int profileAccentColorId, long profileBackgroundCustomEmojiId, 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 restrictsNewChats, boolean haveAccess, TdApi.UserType type, String languageCode, boolean addedToAttachmentMenu)`
Represents a user.
`User(DataInput input)`
Represents a user.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`int`
`getConstructor()`
Returns an identifier uniquely determining type of the object.
`int`
`hashCode()`
`void`
`serialize(DataOutput output)`
Serialize the TDLib class

### Methods inherited from class it.tdlight.jni.TdApi.Object

`serialize, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## 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.

### accentColorId

public int accentColorId
Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only.

### backgroundCustomEmojiId

public long backgroundCustomEmojiId
Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only.

### profileAccentColorId

public int profileAccentColorId
Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only.

### profileBackgroundCustomEmojiId

public long profileBackgroundCustomEmojiId
Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only.

### 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.

### restrictsNewChats

public boolean restrictsNewChats
True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them.

### 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:
  - Constant Field Values

## 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, int accentColorId, long backgroundCustomEmojiId, int profileAccentColorId, long profileBackgroundCustomEmojiId, 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 restrictsNewChats, 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.
  `accentColorId` - Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview. For Telegram Premium users only.
  `backgroundCustomEmojiId` - Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none. For Telegram Premium users only.
  `profileAccentColorId` - Identifier of the accent color for the user's profile; -1 if none. For Telegram Premium users only.
  `profileBackgroundCustomEmojiId` - Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none. For Telegram Premium users only.
  `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.
  `restrictsNewChats` - True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them.
  `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`