1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types; |
4
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
6
|
|
|
use TelegramBot\Api\TypeInterface; |
7
|
|
|
use TelegramBot\Api\Types\Inline\ChosenInlineResult; |
8
|
|
|
use TelegramBot\Api\Types\Inline\InlineQuery; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class Update |
12
|
|
|
* This object represents an incoming update. |
13
|
|
|
* Only one of the optional parameters can be present in any given update. |
14
|
|
|
* |
15
|
|
|
* @package TelegramBot\Api\Types |
16
|
|
|
*/ |
17
|
|
|
class Update extends BaseType implements TypeInterface |
18
|
|
|
{ |
19
|
|
|
/** |
20
|
|
|
* {@inheritdoc} |
21
|
|
|
* |
22
|
|
|
* @var array |
23
|
|
|
*/ |
24
|
|
|
static protected $requiredParams = ['update_id']; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* {@inheritdoc} |
28
|
|
|
* |
29
|
|
|
* @var array |
30
|
|
|
*/ |
31
|
|
|
static protected $map = [ |
32
|
|
|
'update_id' => true, |
33
|
|
|
'message' => Message::class, |
34
|
|
|
'inline_query' => InlineQuery::class, |
35
|
|
|
'chosen_inline_result' => ChosenInlineResult::class, |
36
|
|
|
]; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* The update‘s unique identifier. |
40
|
|
|
* Update identifiers start from a certain positive number and increase sequentially. |
41
|
|
|
* This ID becomes especially handy if you’re using Webhooks, since it allows you to ignore repeated updates or |
42
|
|
|
* to restore the correct update sequence, should they get out of order. |
43
|
|
|
* |
44
|
|
|
* @var integer |
45
|
|
|
*/ |
46
|
|
|
protected $updateId; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Optional. New incoming message of any kind — text, photo, sticker, etc. |
50
|
|
|
* |
51
|
|
|
* @var Message |
52
|
|
|
*/ |
53
|
|
|
protected $message; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Optional. New incoming inline query |
57
|
|
|
* |
58
|
|
|
* @var \TelegramBot\Api\Types\Inline\InlineQuery |
59
|
|
|
*/ |
60
|
|
|
protected $inlineQuery; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Optional. The result of a inline query that was chosen by a user and sent to their chat partner |
64
|
|
|
* |
65
|
|
|
* @var \TelegramBot\Api\Types\Inline\ChosenInlineResult |
66
|
|
|
*/ |
67
|
|
|
protected $chosenInlineResult; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @return int |
71
|
|
|
*/ |
72
|
|
|
public function getUpdateId() |
73
|
|
|
{ |
74
|
|
|
return $this->updateId; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* @param int $updateId |
79
|
|
|
*/ |
80
|
|
|
public function setUpdateId($updateId) |
81
|
|
|
{ |
82
|
|
|
$this->updateId = $updateId; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* @return Message |
87
|
|
|
*/ |
88
|
|
|
public function getMessage() |
89
|
|
|
{ |
90
|
|
|
return $this->message; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* @param Message $message |
95
|
|
|
*/ |
96
|
|
|
public function setMessage(Message $message) |
97
|
|
|
{ |
98
|
|
|
$this->message = $message; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @return InlineQuery |
103
|
|
|
*/ |
104
|
|
|
public function getInlineQuery() |
105
|
|
|
{ |
106
|
|
|
return $this->inlineQuery; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @param InlineQuery $inlineQuery |
111
|
|
|
*/ |
112
|
|
|
public function setInlineQuery($inlineQuery) |
113
|
|
|
{ |
114
|
|
|
$this->inlineQuery = $inlineQuery; |
115
|
|
|
} |
116
|
|
|
|
117
|
|
|
/** |
118
|
|
|
* @return ChosenInlineResult |
119
|
|
|
*/ |
120
|
|
|
public function getChosenInlineResult() |
121
|
|
|
{ |
122
|
|
|
return $this->chosenInlineResult; |
123
|
|
|
} |
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @param ChosenInlineResult $chosenInlineResult |
127
|
|
|
*/ |
128
|
|
|
public function setChosenInlineResult($chosenInlineResult) |
129
|
|
|
{ |
130
|
|
|
$this->chosenInlineResult = $chosenInlineResult; |
131
|
|
|
} |
132
|
|
|
} |
133
|
|
|
|