Skip to content

Commit 97bc2c8

Browse files
authored
Merge pull request #1229 from TiiFuchs/api-5.3
Bot API 5.3
2 parents 163ca3b + f63fe6f commit 97bc2c8

23 files changed

+530
-66
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\BotCommandScope;
5+
6+
7+
interface BotCommandScope
8+
{
9+
10+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\BotCommandScope;
5+
6+
7+
use Longman\TelegramBot\Entities\Entity;
8+
9+
/**
10+
* Class BotCommandScopeAllChatAdministrators
11+
*
12+
* @link https://core.telegram.org/bots/api#botcommandscopeallchatadministrators
13+
*/
14+
class BotCommandScopeAllChatAdministrators extends Entity implements BotCommandScope
15+
{
16+
public function __construct(array $data = [])
17+
{
18+
$data['type'] = 'all_chat_administrators';
19+
parent::__construct($data);
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\BotCommandScope;
5+
6+
7+
use Longman\TelegramBot\Entities\Entity;
8+
9+
/**
10+
* Class BotCommandScopeAllGroupChats
11+
*
12+
* @link https://core.telegram.org/bots/api#botcommandscopeallgroupchats
13+
*/
14+
class BotCommandScopeAllGroupChats extends Entity implements BotCommandScope
15+
{
16+
public function __construct(array $data = [])
17+
{
18+
$data['type'] = 'all_group_chats';
19+
parent::__construct($data);
20+
}
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\BotCommandScope;
5+
6+
7+
use Longman\TelegramBot\Entities\Entity;
8+
9+
/**
10+
* Class BotCommandScopeAllPrivateChats
11+
*
12+
* @link https://core.telegram.org/bots/api#botcommandscopeallprivatechats
13+
*/
14+
class BotCommandScopeAllPrivateChats extends Entity implements BotCommandScope
15+
{
16+
public function __construct(array $data = [])
17+
{
18+
$data['type'] = 'all_private_chats';
19+
parent::__construct($data);
20+
}
21+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\BotCommandScope;
5+
6+
7+
use Longman\TelegramBot\Entities\Entity;
8+
9+
/**
10+
* Class BotCommandScopeChat
11+
*
12+
* @link https://core.telegram.org/bots/api#botcommandscopechat
13+
*
14+
* <code>
15+
* $data = [
16+
* 'chat_id' => '123456'
17+
* ];
18+
* </code>
19+
*
20+
* @method string getType() Scope type, must be chat
21+
* @method string getChatId() Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
22+
*
23+
* @method $this setChatId(string $chat_id) Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
24+
*/
25+
class BotCommandScopeChat extends Entity implements BotCommandScope
26+
{
27+
public function __construct(array $data = [])
28+
{
29+
$data['type'] = 'chat';
30+
parent::__construct($data);
31+
}
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\BotCommandScope;
5+
6+
7+
use Longman\TelegramBot\Entities\Entity;
8+
9+
/**
10+
* Class BotCommandScopeChatAdministrators
11+
*
12+
* @link https://core.telegram.org/bots/api#botcommandscopechatadministrators
13+
*
14+
* <code>
15+
* $data = [
16+
* 'chat_id' => '123456'
17+
* ];
18+
* </code>
19+
*
20+
* @method string getType() Scope type, must be chat_administrators
21+
* @method string getChatId() Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
22+
*
23+
* @method $this setChatId(string $chat_id) Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
24+
*/
25+
class BotCommandScopeChatAdministrators extends Entity implements BotCommandScope
26+
{
27+
public function __construct(array $data = [])
28+
{
29+
$data['type'] = 'chat_administrators';
30+
parent::__construct($data);
31+
}
32+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\BotCommandScope;
5+
6+
7+
use Longman\TelegramBot\Entities\Entity;
8+
9+
/**
10+
* Class BotCommandScopeChatMember
11+
*
12+
* @link https://core.telegram.org/bots/api#botcommandscopechatmember
13+
*
14+
* <code>
15+
* $data = [
16+
* 'chat_id' => '123456',
17+
* 'user_id' => 987654,
18+
* ];
19+
* </code>
20+
*
21+
* @method string getType() Scope type, must be chat_member
22+
* @method string getChatId() Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
23+
* @method int getUserId() Unique identifier of the target user
24+
*
25+
* @method $this setChatId(string $chat_id) Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
26+
* @method $this setUserId(int $user_id) Unique identifier of the target user
27+
*/
28+
class BotCommandScopeChatMember extends Entity implements BotCommandScope
29+
{
30+
public function __construct(array $data = [])
31+
{
32+
$data['type'] = 'chat_member';
33+
parent::__construct($data);
34+
}
35+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
4+
namespace Longman\TelegramBot\Entities\BotCommandScope;
5+
6+
7+
use Longman\TelegramBot\Entities\Entity;
8+
use Longman\TelegramBot\Entities\InputMedia\InputMediaAnimation;
9+
10+
/**
11+
* Class BotCommandScopeDefault
12+
*
13+
* @link https://core.telegram.org/bots/api#botcommandscopedefault
14+
*/
15+
class BotCommandScopeDefault extends Entity implements BotCommandScope
16+
{
17+
public function __construct(array $data = [])
18+
{
19+
$data['type'] = 'default';
20+
parent::__construct($data);
21+
}
22+
}

src/Entities/ChatMember.php

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Longman\TelegramBot\Entities\ChatMember;
4+
5+
use Longman\TelegramBot\Entities\User;
6+
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+
*/
13+
interface ChatMember
14+
{
15+
//
16+
}

0 commit comments

Comments
 (0)