|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Greenplugin\TelegramBot\Method; |
|
6
|
|
|
|
|
7
|
|
|
use Greenplugin\TelegramBot\Method\Traits\EditMessageVariablesTrait; |
|
8
|
|
|
use Greenplugin\TelegramBot\Method\Traits\FillFromArrayTrait; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class EditMessageReplyMarkupMethod. |
|
12
|
|
|
* |
|
13
|
|
|
* @see https://core.telegram.org/bots/api#editmessagereplymarkup |
|
14
|
|
|
*/ |
|
15
|
|
|
class EditMessageReplyMarkupMethod |
|
16
|
|
|
{ |
|
17
|
|
|
use FillFromArrayTrait; |
|
18
|
|
|
use EditMessageVariablesTrait; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* EditMessageReplyMarkupMethod constructor. |
|
22
|
|
|
* |
|
23
|
|
|
* @param int|string $chatId |
|
24
|
|
|
* @param array|null $data |
|
25
|
|
|
* |
|
26
|
|
|
* @throws \Greenplugin\TelegramBot\Exception\BadArgumentException |
|
27
|
|
|
*/ |
|
28
|
|
|
public function __construct($chatId, array $data = null) |
|
29
|
|
|
{ |
|
30
|
|
|
$this->chatId = $chatId; |
|
31
|
|
|
if ($data) { |
|
32
|
|
|
$this->fill($data); |
|
33
|
|
|
} |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @param int|string $chatId |
|
38
|
|
|
* @param int $messageId |
|
39
|
|
|
* @param array|null $data |
|
40
|
|
|
* |
|
41
|
|
|
* @throws \Greenplugin\TelegramBot\Exception\BadArgumentException |
|
42
|
|
|
* |
|
43
|
|
|
* @return EditMessageReplyMarkupMethod |
|
44
|
|
|
*/ |
|
45
|
|
|
public static function create($chatId, int $messageId, array $data = null): EditMessageReplyMarkupMethod |
|
46
|
|
|
{ |
|
47
|
|
|
$instance = new self($chatId, $data); |
|
48
|
|
|
$instance->messageId = $messageId; |
|
49
|
|
|
|
|
50
|
|
|
return $instance; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* @param int|string $chatId |
|
55
|
|
|
* @param string $inlineMessageId |
|
56
|
|
|
* @param array|null $data |
|
57
|
|
|
* |
|
58
|
|
|
* @throws \Greenplugin\TelegramBot\Exception\BadArgumentException |
|
59
|
|
|
* |
|
60
|
|
|
* @return EditMessageReplyMarkupMethod |
|
61
|
|
|
*/ |
|
62
|
|
|
public static function createInline( |
|
63
|
|
|
$chatId, |
|
64
|
|
|
string $inlineMessageId, |
|
65
|
|
|
array $data = null |
|
66
|
|
|
): EditMessageReplyMarkupMethod { |
|
67
|
|
|
$instance = new self($chatId, $data); |
|
68
|
|
|
$instance->inlineMessageId = $inlineMessageId; |
|
69
|
|
|
|
|
70
|
|
|
return $instance; |
|
71
|
|
|
} |
|
72
|
|
|
} |
|
73
|
|
|
|