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
|
|
|
* Contains information about a message draft. |
13
|
|
|
*/ |
14
|
|
|
class DraftMessage extends TdObject |
15
|
|
|
{ |
16
|
|
|
public const TYPE_NAME = 'draftMessage'; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* Identifier of the message to reply to; 0 if none. |
20
|
|
|
* |
21
|
|
|
* @var int |
22
|
|
|
*/ |
23
|
|
|
protected int $replyToMessageId; |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Content of the message draft; this should always be of type inputMessageText. |
27
|
|
|
* |
28
|
|
|
* @var InputMessageContent |
29
|
|
|
*/ |
30
|
|
|
protected InputMessageContent $inputMessageText; |
31
|
|
|
|
32
|
|
|
public function __construct(int $replyToMessageId, InputMessageContent $inputMessageText) |
33
|
|
|
{ |
34
|
|
|
$this->replyToMessageId = $replyToMessageId; |
35
|
|
|
$this->inputMessageText = $inputMessageText; |
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
public static function fromArray(array $array): DraftMessage |
39
|
|
|
{ |
40
|
|
|
return new static( |
41
|
|
|
$array['reply_to_message_id'], |
42
|
|
|
TdSchemaRegistry::fromArray($array['input_message_text']), |
43
|
|
|
); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function typeSerialize(): array |
47
|
|
|
{ |
48
|
|
|
return [ |
49
|
|
|
'@type' => static::TYPE_NAME, |
50
|
|
|
'reply_to_message_id' => $this->replyToMessageId, |
51
|
|
|
'input_message_text' => $this->inputMessageText->typeSerialize(), |
52
|
|
|
]; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function getReplyToMessageId(): int |
56
|
|
|
{ |
57
|
|
|
return $this->replyToMessageId; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
public function getInputMessageText(): InputMessageContent |
61
|
|
|
{ |
62
|
|
|
return $this->inputMessageText; |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|