phpbotgram

WebAppUser
in package

FinalYes

Represents the user object embedded in WebApp init data.

Minimal hand-rolled DTO mirroring the user field of WebAppInitData. Fields match the Telegram Bot API WebAppUser spec.

Table of Contents

Properties

$addedToAttachmentMenu  : bool|null
$allowsWriteToPm  : bool|null
$firstName  : string
$id  : int
$isBot  : bool|null
$isPremium  : bool|null
$languageCode  : string|null
$lastName  : string|null
$photoUrl  : string|null
$username  : string|null

Methods

__construct()  : mixed
fromArray()  : self
Construct from a raw JSON-decoded assoc array.

Properties

$addedToAttachmentMenu read-only

public bool|null $addedToAttachmentMenu = null

$allowsWriteToPm read-only

public bool|null $allowsWriteToPm = null

$firstName read-only

public string $firstName = ''

$isPremium read-only

public bool|null $isPremium = null

$languageCode read-only

public string|null $languageCode = null

$lastName read-only

public string|null $lastName = null

$photoUrl read-only

public string|null $photoUrl = null

$username read-only

public string|null $username = null

Methods

__construct()

public __construct(int $id[, bool|null $isBot = null ][, string $firstName = '' ][, string|null $lastName = null ][, string|null $username = null ][, string|null $languageCode = null ][, bool|null $isPremium = null ][, bool|null $addedToAttachmentMenu = null ][, bool|null $allowsWriteToPm = null ][, string|null $photoUrl = null ]) : mixed
Parameters
$id : int
$isBot : bool|null = null
$firstName : string = ''
$lastName : string|null = null
$username : string|null = null
$languageCode : string|null = null
$isPremium : bool|null = null
$addedToAttachmentMenu : bool|null = null
$allowsWriteToPm : bool|null = null
$photoUrl : string|null = null

fromArray()

Construct from a raw JSON-decoded assoc array.

public static fromArray(array<string, mixed> $data) : self
Parameters
$data : array<string, mixed>
Return values
self
On this page

Search results