From d33bbd7dfdb0840994c65ba066a2552fbe83f674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D1=96=D0=B9?= <61122611+CrazyTapok-bit@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:44:02 +0200 Subject: [PATCH] Add new property (#68) --- src/Entities/InitData/User.php | 5 +++++ tests/Entities/InitData/UserTest.php | 3 +++ 2 files changed, 8 insertions(+) diff --git a/src/Entities/InitData/User.php b/src/Entities/InitData/User.php index 7a0e647..c8e5006 100644 --- a/src/Entities/InitData/User.php +++ b/src/Entities/InitData/User.php @@ -53,4 +53,9 @@ final class User extends Make * Optional. Only returned for web applications launched from a direct link. */ public ?bool $allowsWriteToPm = null; + + /** + * Optional. True, if this user added the bot to the attachment menu. + */ + public ?bool $addedToAttachmentMenu = null; } diff --git a/tests/Entities/InitData/UserTest.php b/tests/Entities/InitData/UserTest.php index 845c64a..33a5e22 100644 --- a/tests/Entities/InitData/UserTest.php +++ b/tests/Entities/InitData/UserTest.php @@ -29,6 +29,7 @@ public function testMake(): array $this->assertNull($user->isPremium); $this->assertNull($user->photoUrl); $this->assertNull($user->allowsWriteToPm); + $this->assertNull($user->addedToAttachmentMenu); $this->assertInstanceOf(Arrayable::class, $user); return $data; @@ -46,6 +47,7 @@ public function testMakeFull(array $data): void $data['language_code'] = 'uk'; $data['is_premium'] = false; $data['allows_write_to_pm'] = true; + $data['added_to_attachment_menu'] = true; $data['photo_url'] = 'https://t.me/i/userpic/320/7gMg9ZfoSzMQcLwYiEj4rLAofXXn0wOBV9HXGb6c1T0.jpg'; $user = new User($data); @@ -57,6 +59,7 @@ public function testMakeFull(array $data): void $this->assertFalse($user->isPremium); $this->assertEquals($data['photo_url'], $user->photoUrl); $this->assertTrue($user->allowsWriteToPm); + $this->assertTrue($user->addedToAttachmentMenu); $this->assertInstanceOf(Arrayable::class, $user); } }