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); } }