|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This phpFile is auto-generated. |
|
5
|
|
|
*/ |
|
6
|
|
|
|
|
7
|
|
|
declare(strict_types=1); |
|
8
|
|
|
|
|
9
|
|
|
namespace AurimasNiekis\TdLibSchema; |
|
10
|
|
|
|
|
11
|
|
|
/** |
|
12
|
|
|
* Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set. |
|
13
|
|
|
*/ |
|
14
|
|
|
class StopPoll extends TdFunction |
|
15
|
|
|
{ |
|
16
|
|
|
public const TYPE_NAME = 'stopPoll'; |
|
17
|
|
|
|
|
18
|
|
|
/** |
|
19
|
|
|
* Identifier of the chat to which the poll belongs. |
|
20
|
|
|
* |
|
21
|
|
|
* @var int |
|
22
|
|
|
*/ |
|
23
|
|
|
protected int $chatId; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Identifier of the message containing the poll. |
|
27
|
|
|
* |
|
28
|
|
|
* @var int |
|
29
|
|
|
*/ |
|
30
|
|
|
protected int $messageId; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* The new message reply markup; for bots only. |
|
34
|
|
|
* |
|
35
|
|
|
* @var ReplyMarkup |
|
36
|
|
|
*/ |
|
37
|
|
|
protected ReplyMarkup $replyMarkup; |
|
38
|
|
|
|
|
39
|
|
|
public function __construct(int $chatId, int $messageId, ReplyMarkup $replyMarkup) |
|
40
|
|
|
{ |
|
41
|
|
|
$this->chatId = $chatId; |
|
42
|
|
|
$this->messageId = $messageId; |
|
43
|
|
|
$this->replyMarkup = $replyMarkup; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public static function fromArray(array $array): StopPoll |
|
47
|
|
|
{ |
|
48
|
|
|
return new static( |
|
49
|
|
|
$array['chat_id'], |
|
50
|
|
|
$array['message_id'], |
|
51
|
|
|
TdSchemaRegistry::fromArray($array['reply_markup']), |
|
52
|
|
|
); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
public function typeSerialize(): array |
|
56
|
|
|
{ |
|
57
|
|
|
return [ |
|
58
|
|
|
'@type' => static::TYPE_NAME, |
|
59
|
|
|
'chat_id' => $this->chatId, |
|
60
|
|
|
'message_id' => $this->messageId, |
|
61
|
|
|
'reply_markup' => $this->replyMarkup->typeSerialize(), |
|
62
|
|
|
]; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function getChatId(): int |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->chatId; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
public function getMessageId(): int |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->messageId; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function getReplyMarkup(): ReplyMarkup |
|
76
|
|
|
{ |
|
77
|
|
|
return $this->replyMarkup; |
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|