1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Zanzara\Telegram\Type\InlineQueryResult; |
6
|
|
|
|
7
|
|
|
use Zanzara\Telegram\Type\Input\InputMessageContent; |
8
|
|
|
use Zanzara\Telegram\Type\Keyboard\InlineKeyboardMarkup; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Represents a link to a page containing an embedded video player or a video file. By default, this video file will be |
12
|
|
|
* sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with |
13
|
|
|
* the specified content instead of the video. |
14
|
|
|
* |
15
|
|
|
* More on https://core.telegram.org/bots/api#inlinequeryresultvideo |
16
|
|
|
*/ |
17
|
|
|
class InlineQueryResultVideo extends InlineQueryResult |
18
|
|
|
{ |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* A valid URL for the embedded video player or video file |
22
|
|
|
* |
23
|
|
|
* @var string |
24
|
|
|
*/ |
25
|
|
|
private $video_url; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* Mime type of the content of video url, "text/html" or "video/mp4" |
29
|
|
|
* |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
private $mime_type; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* URL of the thumbnail (jpeg only) for the video |
36
|
|
|
* |
37
|
|
|
* @var string |
38
|
|
|
*/ |
39
|
|
|
private $thumb_url; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* Title for the result |
43
|
|
|
* |
44
|
|
|
* @var string |
45
|
|
|
*/ |
46
|
|
|
private $title; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* Optional. Caption of the video to be sent, 0-1024 characters after entities parsing |
50
|
|
|
* |
51
|
|
|
* @var string|null |
52
|
|
|
*/ |
53
|
|
|
private $caption; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in |
57
|
|
|
* the media caption. |
58
|
|
|
* |
59
|
|
|
* @var string|null |
60
|
|
|
*/ |
61
|
|
|
private $parse_mode; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
65
|
|
|
* |
66
|
|
|
* @since zanzara 0.5.0, Telegram Bot Api 5.0 |
67
|
|
|
* |
68
|
|
|
* @var \Zanzara\Telegram\Type\MessageEntity[]|null |
69
|
|
|
*/ |
70
|
|
|
private $caption_entities; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* Optional. Video width |
74
|
|
|
* |
75
|
|
|
* @var int|null |
76
|
|
|
*/ |
77
|
|
|
private $video_width; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* Optional. Video height |
81
|
|
|
* |
82
|
|
|
* @var int|null |
83
|
|
|
*/ |
84
|
|
|
private $video_height; |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* Optional. Video duration in seconds |
88
|
|
|
* |
89
|
|
|
* @var int|null |
90
|
|
|
*/ |
91
|
|
|
private $video_duration; |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Optional. Short description of the result |
95
|
|
|
* |
96
|
|
|
* @var string|null |
97
|
|
|
*/ |
98
|
|
|
private $description; |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* Optional. Inline keyboard attached to the message |
102
|
|
|
* |
103
|
|
|
* @var InlineKeyboardMarkup|null |
104
|
|
|
*/ |
105
|
|
|
private $reply_markup; |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is |
109
|
|
|
* used to send an HTML-page as a result (e.g., a YouTube video). |
110
|
|
|
* |
111
|
|
|
* @var InputMessageContent|null |
112
|
|
|
*/ |
113
|
|
|
private $input_message_content; |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @return string |
117
|
|
|
*/ |
118
|
|
|
public function getVideoUrl(): string |
119
|
|
|
{ |
120
|
|
|
return $this->video_url; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @param string $video_url |
125
|
|
|
*/ |
126
|
|
|
public function setVideoUrl(string $video_url): void |
127
|
|
|
{ |
128
|
|
|
$this->video_url = $video_url; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @return string |
133
|
|
|
*/ |
134
|
|
|
public function getMimeType(): string |
135
|
|
|
{ |
136
|
|
|
return $this->mime_type; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @param string $mime_type |
141
|
|
|
*/ |
142
|
|
|
public function setMimeType(string $mime_type): void |
143
|
|
|
{ |
144
|
|
|
$this->mime_type = $mime_type; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @return string |
149
|
|
|
*/ |
150
|
|
|
public function getThumbUrl(): string |
151
|
|
|
{ |
152
|
|
|
return $this->thumb_url; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* @param string $thumb_url |
157
|
|
|
*/ |
158
|
|
|
public function setThumbUrl(string $thumb_url): void |
159
|
|
|
{ |
160
|
|
|
$this->thumb_url = $thumb_url; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @return string |
165
|
|
|
*/ |
166
|
|
|
public function getTitle(): string |
167
|
|
|
{ |
168
|
|
|
return $this->title; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* @param string $title |
173
|
|
|
*/ |
174
|
|
|
public function setTitle(string $title): void |
175
|
|
|
{ |
176
|
|
|
$this->title = $title; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @return string|null |
181
|
|
|
*/ |
182
|
|
|
public function getCaption(): ?string |
183
|
|
|
{ |
184
|
|
|
return $this->caption; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @param string|null $caption |
189
|
|
|
*/ |
190
|
|
|
public function setCaption(?string $caption): void |
191
|
|
|
{ |
192
|
|
|
$this->caption = $caption; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* @return string|null |
197
|
|
|
*/ |
198
|
|
|
public function getParseMode(): ?string |
199
|
|
|
{ |
200
|
|
|
return $this->parse_mode; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* @param string|null $parse_mode |
205
|
|
|
*/ |
206
|
|
|
public function setParseMode(?string $parse_mode): void |
207
|
|
|
{ |
208
|
|
|
$this->parse_mode = $parse_mode; |
209
|
|
|
} |
210
|
|
|
|
211
|
|
|
/** |
212
|
|
|
* @return int|null |
213
|
|
|
*/ |
214
|
|
|
public function getVideoWidth(): ?int |
215
|
|
|
{ |
216
|
|
|
return $this->video_width; |
217
|
|
|
} |
218
|
|
|
|
219
|
|
|
/** |
220
|
|
|
* @param int|null $video_width |
221
|
|
|
*/ |
222
|
|
|
public function setVideoWidth(?int $video_width): void |
223
|
|
|
{ |
224
|
|
|
$this->video_width = $video_width; |
225
|
|
|
} |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* @return int|null |
229
|
|
|
*/ |
230
|
|
|
public function getVideoHeight(): ?int |
231
|
|
|
{ |
232
|
|
|
return $this->video_height; |
233
|
|
|
} |
234
|
|
|
|
235
|
|
|
/** |
236
|
|
|
* @param int|null $video_height |
237
|
|
|
*/ |
238
|
|
|
public function setVideoHeight(?int $video_height): void |
239
|
|
|
{ |
240
|
|
|
$this->video_height = $video_height; |
241
|
|
|
} |
242
|
|
|
|
243
|
|
|
/** |
244
|
|
|
* @return int|null |
245
|
|
|
*/ |
246
|
|
|
public function getVideoDuration(): ?int |
247
|
|
|
{ |
248
|
|
|
return $this->video_duration; |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* @param int|null $video_duration |
253
|
|
|
*/ |
254
|
|
|
public function setVideoDuration(?int $video_duration): void |
255
|
|
|
{ |
256
|
|
|
$this->video_duration = $video_duration; |
257
|
|
|
} |
258
|
|
|
|
259
|
|
|
/** |
260
|
|
|
* @return string|null |
261
|
|
|
*/ |
262
|
|
|
public function getDescription(): ?string |
263
|
|
|
{ |
264
|
|
|
return $this->description; |
265
|
|
|
} |
266
|
|
|
|
267
|
|
|
/** |
268
|
|
|
* @param string|null $description |
269
|
|
|
*/ |
270
|
|
|
public function setDescription(?string $description): void |
271
|
|
|
{ |
272
|
|
|
$this->description = $description; |
273
|
|
|
} |
274
|
|
|
|
275
|
|
|
/** |
276
|
|
|
* @return InlineKeyboardMarkup|null |
277
|
|
|
*/ |
278
|
|
|
public function getReplyMarkup(): ?InlineKeyboardMarkup |
279
|
|
|
{ |
280
|
|
|
return $this->reply_markup; |
281
|
|
|
} |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* @param InlineKeyboardMarkup|null $reply_markup |
285
|
|
|
*/ |
286
|
|
|
public function setReplyMarkup(?InlineKeyboardMarkup $reply_markup): void |
287
|
|
|
{ |
288
|
|
|
$this->reply_markup = $reply_markup; |
289
|
|
|
} |
290
|
|
|
|
291
|
|
|
/** |
292
|
|
|
* @return InputMessageContent|null |
293
|
|
|
*/ |
294
|
|
|
public function getInputMessageContent(): ?InputMessageContent |
295
|
|
|
{ |
296
|
|
|
return $this->input_message_content; |
297
|
|
|
} |
298
|
|
|
|
299
|
|
|
/** |
300
|
|
|
* @param InputMessageContent|null $input_message_content |
301
|
|
|
*/ |
302
|
|
|
public function setInputMessageContent(?InputMessageContent $input_message_content): void |
303
|
|
|
{ |
304
|
|
|
$this->input_message_content = $input_message_content; |
305
|
|
|
} |
306
|
|
|
|
307
|
|
|
/** |
308
|
|
|
* @return \Zanzara\Telegram\Type\MessageEntity[]|null |
309
|
|
|
*/ |
310
|
|
|
public function getCaptionEntities(): ?array |
311
|
|
|
{ |
312
|
|
|
return $this->caption_entities; |
313
|
|
|
} |
314
|
|
|
|
315
|
|
|
/** |
316
|
|
|
* @param \Zanzara\Telegram\Type\MessageEntity[]|null $caption_entities |
317
|
|
|
*/ |
318
|
|
|
public function setCaptionEntities(?array $caption_entities): void |
319
|
|
|
{ |
320
|
|
|
$this->caption_entities = $caption_entities; |
321
|
|
|
} |
322
|
|
|
|
323
|
|
|
} |