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