class User

This object represents a Telegram user or bot.

Methods

__construct(int $id, bool $is_bot, string $first_name, string|null $last_name = null, string|null $username = null, string|null $language_code = null, bool|null $is_premium = null, bool|null $added_to_attachment_menu = null, bool|null $can_join_groups = null, bool|null $can_read_all_group_messages = null, bool|null $supports_inline_queries = null)

No description

int
getId()

Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

bool
getIsBot()

True, if this user is a bot.

string
getFirstName()

User's or bot's first name.

string|null
getLastName()

Optional. User's or bot's last name.

string|null
getUsername()

Optional. User's or bot's username.

string|null
getLanguageCode()

Optional. IETF language tag of the user's language.

bool|null
getIsPremium()

Optional. True, if this user is a Telegram Premium user.

bool|null
getAddedToAttachmentMenu()

Optional. True, if this user added the bot to the attachment menu.

bool|null
getCanJoinGroups()

Optional. True, if the bot can be invited to groups. Returned only in getMe.

bool|null
getCanReadAllGroupMessages()

Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.

bool|null
getSupportsInlineQueries()

Optional. True, if the bot supports inline queries. Returned only in getMe.

Details

at line 23
__construct(int $id, bool $is_bot, string $first_name, string|null $last_name = null, string|null $username = null, string|null $language_code = null, bool|null $is_premium = null, bool|null $added_to_attachment_menu = null, bool|null $can_join_groups = null, bool|null $can_read_all_group_messages = null, bool|null $supports_inline_queries = null)

No description

Parameters

int $id
bool $is_bot
string $first_name
string|null $last_name
string|null $username
string|null $language_code
bool|null $is_premium
bool|null $added_to_attachment_menu
bool|null $can_join_groups
bool|null $can_read_all_group_messages
bool|null $supports_inline_queries

at line 41
int getId()

Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

Return Value

int

at line 49
bool getIsBot()

True, if this user is a bot.

Return Value

bool

at line 57
string getFirstName()

User's or bot's first name.

Return Value

string

at line 65
string|null getLastName()

Optional. User's or bot's last name.

Return Value

string|null

at line 73
string|null getUsername()

Optional. User's or bot's username.

Return Value

string|null

at line 81
string|null getLanguageCode()

Optional. IETF language tag of the user's language.

Return Value

string|null

at line 89
bool|null getIsPremium()

Optional. True, if this user is a Telegram Premium user.

Return Value

bool|null

at line 97
bool|null getAddedToAttachmentMenu()

Optional. True, if this user added the bot to the attachment menu.

Return Value

bool|null

at line 105
bool|null getCanJoinGroups()

Optional. True, if the bot can be invited to groups. Returned only in getMe.

Return Value

bool|null

at line 113
bool|null getCanReadAllGroupMessages()

Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.

Return Value

bool|null

at line 121
bool|null getSupportsInlineQueries()

Optional. True, if the bot supports inline queries. Returned only in getMe.

Return Value

bool|null