Skip to content

Commit 4505074

Browse files
committed
Not Implemented Type for ChatMember
1 parent ee3a443 commit 4505074

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
<?php
22

3-
43
namespace Longman\TelegramBot\Entities\ChatMember;
54

5+
use Longman\TelegramBot\Entities\User;
66

7+
/**
8+
* Interface ChatMember
9+
*
10+
* @method string getStatus() The member's status in the chat
11+
* @method User getUser() Information about the user
12+
*/
713
interface ChatMember
814
{
9-
15+
//
1016
}

src/Entities/ChatMember/ChatMemberBanned.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @link https://core.telegram.org/bots/api#chatmemberbanned
1414
*
15-
* @method string getStatus() The member's status in the chat, always “kicked”
15+
* @method string getStatus() The member's status in the chat, always “kicked”
1616
* @method User getUser() Information about the user
1717
* @method int getUntilDate() Date when restrictions will be lifted for this user; unix time
1818
*/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\ChatMember;
5+
6+
7+
use Longman\TelegramBot\Entities\Entity;
8+
use Longman\TelegramBot\Entities\User;
9+
10+
/**
11+
* Class ChatMemberNotImplemented
12+
*
13+
* @method string getStatus() The member's status in the chat, always “left”
14+
* @method User getUser() Information about the user
15+
*/
16+
class ChatMemberNotImplemented extends Entity implements ChatMember
17+
{
18+
//
19+
}

src/Entities/ChatMember/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function make(array $data, string $bot_username): Entity
2525
];
2626

2727
if (! isset($type[$data['status']])) {
28-
throw new TelegramException('Unexpected ChatMember status');
28+
return new ChatMemberNotImplemented($data, $bot_username);
2929
}
3030

3131
$class = $type[$data['status']];

0 commit comments

Comments
 (0)