Skip to content

User

Type · TDLib 1.8.67 · d1085f9c

Represents a user

User(
  id: int53,
  first_name: string,
  last_name: string,
  usernames: Usernames,
  phone_number: string,
  status: UserStatus,
  profile_photo: ProfilePhoto,
  accent_color_id: int32,
  background_custom_emoji_id: int64,
  upgraded_gift_colors: UpgradedGiftColors,
  profile_accent_color_id: int32,
  profile_background_custom_emoji_id: int64,
  emoji_status: EmojiStatus,
  is_contact: Bool,
  is_mutual_contact: Bool,
  is_close_friend: Bool,
  verification_status: VerificationStatus,
  is_premium: Bool,
  is_support: Bool,
  restriction_info: RestrictionInfo,
  active_story_state: ActiveStoryState,
  restricts_new_chats: Bool,
  paid_message_star_count: int53,
  have_access: Bool,
  type: UserType,
  language_code: string,
  added_to_attachment_menu: Bool
) → User

id

int53

User identifier

first_name

string

First name of the user

last_name

string

Last name of the user

usernames

Usernames

Usernames of the user; may be null

phone_number

string

Phone number of the user

status

UserStatus

Current online status of the user

profile_photo

ProfilePhoto

Profile photo of the user; may be null

accent_color_id

int32

Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview

background_custom_emoji_id

int64

Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none

upgraded_gift_colors

UpgradedGiftColors

Color scheme based on an upgraded gift to be used for the user instead of accent_color_id and background_custom_emoji_id; may be null if none

profile_accent_color_id

int32

Identifier of the accent color for the user's profile; -1 if none

profile_background_custom_emoji_id

int64

Identifier of a custom emoji to be shown on the background of the user's profile; 0 if none

emoji_status

EmojiStatus

Emoji status to be shown instead of the default Telegram Premium badge; may be null

is_contact

Bool

The user is a contact of the current user

is_mutual_contact

Bool

The user is a contact of the current user and the current user is a contact of the user

is_close_friend

Bool

The user is a close friend of the current user; implies that the user is a contact

verification_status

VerificationStatus

Information about verification status of the user; may be null if none

is_premium

Bool

True, if the user is a Telegram Premium user

is_support

Bool

True, if the user is Telegram support account

restriction_info

RestrictionInfo

Information about restrictions that must be applied to the corresponding private chat; may be null if none

active_story_state

ActiveStoryState

State of active stories of the user; may be null if the user has no active stories

restricts_new_chats

Bool

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

int53

Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay

have_access

Bool

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

UserType

Type of the user

language_code

string

IETF language tag of the user's language; only available to bots

added_to_attachment_menu

Bool

True, if the user added the current bot to attachment menu; only available to bots