MadelineProto/old_docs/API_docs_v41/constructors/user.md

1.9 KiB

title description
user user attributes, type and example

Constructor: user

Back to constructors index

Attributes:

Name Type Required
self Bool Optional
contact Bool Optional
mutual_contact Bool Optional
deleted Bool Optional
bot Bool Optional
bot_chat_history Bool Optional
bot_nochats Bool Optional
verified Bool Optional
id int Required
access_hash long Optional
first_name string Optional
last_name string Optional
username string Optional
phone string Optional
photo UserProfilePhoto Optional
status UserStatus Optional
bot_info_version int Optional

Type: User

Example:

$user = ['_' => 'user', 'self' => true, 'contact' => true, 'mutual_contact' => true, 'deleted' => true, 'bot' => true, 'bot_chat_history' => true, 'bot_nochats' => true, 'verified' => true, 'id' => int, 'access_hash' => long, 'first_name' => string, 'last_name' => string, 'username' => string, 'phone' => string, 'photo' => UserProfilePhoto, 'status' => UserStatus, 'bot_info_version' => int, ];

The following syntaxes can also be used:

$user = '@username'; // Username

$user = 44700; // bot API id (users)
$user = -492772765; // bot API id (chats)
$user = -10038575794; // bot API id (channels)

$user = 'user#44700'; // tg-cli style id (users)
$user = 'chat#492772765'; // tg-cli style id (chats)
$user = 'channel#38575794'; // tg-cli style id (channels)