1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Inline; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class InlineQueryResultPhoto |
7
|
|
|
* Represents a link to a photo. By default, this photo will be sent by the user with optional caption. |
8
|
|
|
* Alternatively, you can provide message_text to send it instead of photo. |
9
|
|
|
* |
10
|
|
|
* @package TelegramBot\Api\Types\Inline |
11
|
|
|
*/ |
12
|
|
|
class InlineQueryResultPhoto extends AbstractInlineQueryResult |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* {@inheritdoc} |
16
|
|
|
* |
17
|
|
|
* @var array |
18
|
|
|
*/ |
19
|
|
|
static protected $requiredParams = ['type', 'id', 'photo_url', 'thumb_url']; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* {@inheritdoc} |
23
|
|
|
* |
24
|
|
|
* @var array |
25
|
|
|
*/ |
26
|
|
|
static protected $map = [ |
27
|
|
|
'type' => true, |
28
|
|
|
'id' => true, |
29
|
|
|
'photo_url' => true, |
30
|
|
|
'mime_type' => true, |
31
|
|
|
'photo_width' => true, |
32
|
|
|
'photo_height' => true, |
33
|
|
|
'thumb_url' => true, |
34
|
|
|
'title' => true, |
35
|
|
|
'description' => true, |
36
|
|
|
'caption' => true, |
37
|
|
|
'message_text' => true, |
38
|
|
|
'parse_mode' => true, |
39
|
|
|
'disable_web_page_preview' => true |
40
|
|
|
]; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* A valid URL of the photo. Photo size must not exceed 5MB |
44
|
|
|
* |
45
|
|
|
* @var string |
46
|
|
|
*/ |
47
|
|
|
protected $photoUrl; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Optional. MIME type of the photo, defaults to image/jpeg |
51
|
|
|
* |
52
|
|
|
* @var string |
53
|
|
|
*/ |
54
|
|
|
protected $mimeType; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Optional. Width of the photo |
58
|
|
|
* |
59
|
|
|
* @var int |
60
|
|
|
*/ |
61
|
|
|
protected $photoWidth; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Optional. Height of the photo |
65
|
|
|
* |
66
|
|
|
* @var int |
67
|
|
|
*/ |
68
|
|
|
protected $photoHeight; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* URL of the thumbnail for the photo |
72
|
|
|
* |
73
|
|
|
* @var |
74
|
|
|
*/ |
75
|
|
|
protected $thumbUrl; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Optional. Short description of the result |
79
|
|
|
* |
80
|
|
|
* @var string |
81
|
|
|
*/ |
82
|
|
|
protected $description; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* Optional. Caption of the photo to be sent, 0-200 characters |
86
|
|
|
* |
87
|
|
|
* @var string |
88
|
|
|
*/ |
89
|
|
|
protected $caption; |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* Optional. Text of a message to be sent instead of the photo, 1-512 characters |
93
|
|
|
* |
94
|
|
|
* @var string |
95
|
|
|
*/ |
96
|
|
|
protected $messageText; |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* Optional. Send “Markdown”, if you want Telegram apps to show bold, italic and inline URLs in your bot's message. |
100
|
|
|
* |
101
|
|
|
* @var string |
102
|
|
|
*/ |
103
|
|
|
protected $parseMode; |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Optional. Disables link previews for links in the sent message |
107
|
|
|
* |
108
|
|
|
* @var bool |
109
|
|
|
*/ |
110
|
|
|
protected $disableWebPagePreview; |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @return string |
114
|
|
|
*/ |
115
|
|
|
public function getPhotoUrl() |
116
|
|
|
{ |
117
|
|
|
return $this->photoUrl; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @param string $photoUrl |
122
|
|
|
*/ |
123
|
|
|
public function setPhotoUrl($photoUrl) |
124
|
|
|
{ |
125
|
|
|
$this->photoUrl = $photoUrl; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @return string |
130
|
|
|
*/ |
131
|
|
|
public function getMimeType() |
132
|
|
|
{ |
133
|
|
|
return $this->mimeType; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @param string $mimeType |
138
|
|
|
*/ |
139
|
|
|
public function setMimeType($mimeType) |
140
|
|
|
{ |
141
|
|
|
$this->mimeType = $mimeType; |
142
|
|
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @return int |
146
|
|
|
*/ |
147
|
|
|
public function getPhotoWidth() |
148
|
|
|
{ |
149
|
|
|
return $this->photoWidth; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* @param int $photoWidth |
154
|
|
|
*/ |
155
|
|
|
public function setPhotoWidth($photoWidth) |
156
|
|
|
{ |
157
|
|
|
$this->photoWidth = $photoWidth; |
158
|
|
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* @return int |
162
|
|
|
*/ |
163
|
|
|
public function getPhotoHeight() |
164
|
|
|
{ |
165
|
|
|
return $this->photoHeight; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @param int $photoHeight |
170
|
|
|
*/ |
171
|
|
|
public function setPhotoHeight($photoHeight) |
172
|
|
|
{ |
173
|
|
|
$this->photoHeight = $photoHeight; |
174
|
|
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @return mixed |
178
|
|
|
*/ |
179
|
|
|
public function getThumbUrl() |
180
|
|
|
{ |
181
|
|
|
return $this->thumbUrl; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @param mixed $thumbUrl |
186
|
|
|
*/ |
187
|
|
|
public function setThumbUrl($thumbUrl) |
188
|
|
|
{ |
189
|
|
|
$this->thumbUrl = $thumbUrl; |
190
|
|
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* @return string |
194
|
|
|
*/ |
195
|
|
|
public function getDescription() |
196
|
|
|
{ |
197
|
|
|
return $this->description; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* @param string $description |
202
|
|
|
*/ |
203
|
|
|
public function setDescription($description) |
204
|
|
|
{ |
205
|
|
|
$this->description = $description; |
206
|
|
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @return string |
210
|
|
|
*/ |
211
|
|
|
public function getCaption() |
212
|
|
|
{ |
213
|
|
|
return $this->caption; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @param string $caption |
218
|
|
|
*/ |
219
|
|
|
public function setCaption($caption) |
220
|
|
|
{ |
221
|
|
|
$this->caption = $caption; |
222
|
|
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @return string |
226
|
|
|
*/ |
227
|
|
|
public function getMessageText() |
228
|
|
|
{ |
229
|
|
|
return $this->messageText; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* @param string $messageText |
234
|
|
|
*/ |
235
|
|
|
public function setMessageText($messageText) |
236
|
|
|
{ |
237
|
|
|
$this->messageText = $messageText; |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* @return string |
242
|
|
|
*/ |
243
|
|
|
public function getParseMode() |
244
|
|
|
{ |
245
|
|
|
return $this->parseMode; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* @param string $parseMode |
250
|
|
|
*/ |
251
|
|
|
public function setParseMode($parseMode) |
252
|
|
|
{ |
253
|
|
|
$this->parseMode = $parseMode; |
254
|
|
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* @return boolean |
258
|
|
|
*/ |
259
|
|
|
public function isDisableWebPagePreview() |
260
|
|
|
{ |
261
|
|
|
return $this->disableWebPagePreview; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @param boolean $disableWebPagePreview |
266
|
|
|
*/ |
267
|
|
|
public function setDisableWebPagePreview($disableWebPagePreview) |
268
|
|
|
{ |
269
|
|
|
$this->disableWebPagePreview = $disableWebPagePreview; |
270
|
|
|
} |
271
|
|
|
} |
272
|
|
|
|