Interface User

Represents a user.

interface User {
    @type: "user";
    accent_color_id: number;
    added_to_attachment_menu?: boolean;
    background_custom_emoji_id: string;
    emoji_status: EmojiStatus;
    first_name: string;
    has_active_stories?: boolean;
    has_unread_active_stories?: boolean;
    have_access?: boolean;
    id: number;
    is_close_friend?: boolean;
    is_contact?: boolean;
    is_fake?: boolean;
    is_mutual_contact?: boolean;
    is_premium?: boolean;
    is_scam?: boolean;
    is_support?: boolean;
    is_verified?: boolean;
    language_code: string;
    last_name: string;
    phone_number: string;
    profile_accent_color_id: number;
    profile_background_custom_emoji_id: string;
    profile_photo: ProfilePhoto;
    restriction_reason: string;
    restricts_new_chats?: boolean;
    status: UserStatus;
    type: UserType;
    usernames: Usernames;
}

Properties

@type: "user"
accent_color_id: number

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

added_to_attachment_menu?: boolean

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

background_custom_emoji_id: string

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

emoji_status: EmojiStatus

Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only.

first_name: string

First name of the user.

has_active_stories?: boolean

True, if the user has non-expired stories available to the current user.

has_unread_active_stories?: boolean

True, if the user has unread non-expired stories available to the current user.

have_access?: boolean

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.

id: number

User identifier.

is_close_friend?: boolean

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

is_contact?: boolean

The user is a contact of the current user.

is_fake?: boolean

True, if many users reported this user as a fake account.

is_mutual_contact?: boolean

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

is_premium?: boolean

True, if the user is a Telegram Premium user.

is_scam?: boolean

True, if many users reported this user as a scam.

is_support?: boolean

True, if the user is Telegram support account.

is_verified?: boolean

True, if the user is verified.

language_code: string

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

last_name: string

Last name of the user.

phone_number: string

Phone number of the user.

profile_accent_color_id: number

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

profile_background_custom_emoji_id: string

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

profile_photo: ProfilePhoto

Profile photo of the user; may be null.

restriction_reason: string

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

restricts_new_chats?: boolean

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.

status: UserStatus

Current online status of the user.

type: UserType

Type of the user.

usernames: Usernames

Usernames of the user; may be null.