|
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 video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file |
|
12
|
|
|
* will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message |
|
13
|
|
|
* with the specified content instead of the animation. |
|
14
|
|
|
* |
|
15
|
|
|
* More on https://core.telegram.org/bots/api#inlinequeryresultmpeg4gif |
|
16
|
|
|
*/ |
|
17
|
|
|
class InlineQueryResultMpeg4Gif extends InlineQueryResult |
|
18
|
|
|
{ |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* A valid URL for the MP4 file. File size must not exceed 1MB |
|
22
|
|
|
* |
|
23
|
|
|
* @var string |
|
24
|
|
|
*/ |
|
25
|
|
|
private $mpeg4_url; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Optional. Video width |
|
29
|
|
|
* |
|
30
|
|
|
* @var int|null |
|
31
|
|
|
*/ |
|
32
|
|
|
private $mpeg4_width; |
|
33
|
|
|
|
|
34
|
|
|
/** |
|
35
|
|
|
* Optional. Video height |
|
36
|
|
|
* |
|
37
|
|
|
* @var int|null |
|
38
|
|
|
*/ |
|
39
|
|
|
private $mpeg4_height; |
|
40
|
|
|
|
|
41
|
|
|
/** |
|
42
|
|
|
* Optional. Video duration |
|
43
|
|
|
* |
|
44
|
|
|
* @var int|null |
|
45
|
|
|
*/ |
|
46
|
|
|
private $mpeg4_duration; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result. |
|
50
|
|
|
* |
|
51
|
|
|
* @var string |
|
52
|
|
|
*/ |
|
53
|
|
|
private $thumb_url; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to |
|
57
|
|
|
* “image/jpeg”. |
|
58
|
|
|
* |
|
59
|
|
|
* @var string|null |
|
60
|
|
|
*/ |
|
61
|
|
|
private $thumb_mime_type; |
|
62
|
|
|
|
|
63
|
|
|
/** |
|
64
|
|
|
* Optional. Title for the result |
|
65
|
|
|
* |
|
66
|
|
|
* @var string|null |
|
67
|
|
|
*/ |
|
68
|
|
|
private $title; |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing |
|
72
|
|
|
* |
|
73
|
|
|
* @var string|null |
|
74
|
|
|
*/ |
|
75
|
|
|
private $caption; |
|
76
|
|
|
|
|
77
|
|
|
/** |
|
78
|
|
|
* Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in |
|
79
|
|
|
* the media caption. |
|
80
|
|
|
* |
|
81
|
|
|
* @var string|null |
|
82
|
|
|
*/ |
|
83
|
|
|
private $parse_mode; |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
|
87
|
|
|
* |
|
88
|
|
|
* @since zanzara 0.5.0, Telegram Bot Api 5.0 |
|
89
|
|
|
* |
|
90
|
|
|
* @var \Zanzara\Telegram\Type\MessageEntity[]|null |
|
91
|
|
|
*/ |
|
92
|
|
|
private $caption_entities; |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* Optional. Inline keyboard attached to the message |
|
96
|
|
|
* |
|
97
|
|
|
* @var InlineKeyboardMarkup|null |
|
98
|
|
|
*/ |
|
99
|
|
|
private $reply_markup; |
|
100
|
|
|
|
|
101
|
|
|
/** |
|
102
|
|
|
* Optional. Content of the message to be sent instead of the video animation |
|
103
|
|
|
* |
|
104
|
|
|
* @var InputMessageContent|null |
|
105
|
|
|
*/ |
|
106
|
|
|
private $input_message_content; |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* @return string |
|
110
|
|
|
*/ |
|
111
|
|
|
public function getMpeg4Url(): string |
|
112
|
|
|
{ |
|
113
|
|
|
return $this->mpeg4_url; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @param string $mpeg4_url |
|
118
|
|
|
*/ |
|
119
|
|
|
public function setMpeg4Url(string $mpeg4_url): void |
|
120
|
|
|
{ |
|
121
|
|
|
$this->mpeg4_url = $mpeg4_url; |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
/** |
|
125
|
|
|
* @return int|null |
|
126
|
|
|
*/ |
|
127
|
|
|
public function getMpeg4Width(): ?int |
|
128
|
|
|
{ |
|
129
|
|
|
return $this->mpeg4_width; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
/** |
|
133
|
|
|
* @param int|null $mpeg4_width |
|
134
|
|
|
*/ |
|
135
|
|
|
public function setMpeg4Width(?int $mpeg4_width): void |
|
136
|
|
|
{ |
|
137
|
|
|
$this->mpeg4_width = $mpeg4_width; |
|
138
|
|
|
} |
|
139
|
|
|
|
|
140
|
|
|
/** |
|
141
|
|
|
* @return int|null |
|
142
|
|
|
*/ |
|
143
|
|
|
public function getMpeg4Height(): ?int |
|
144
|
|
|
{ |
|
145
|
|
|
return $this->mpeg4_height; |
|
146
|
|
|
} |
|
147
|
|
|
|
|
148
|
|
|
/** |
|
149
|
|
|
* @param int|null $mpeg4_height |
|
150
|
|
|
*/ |
|
151
|
|
|
public function setMpeg4Height(?int $mpeg4_height): void |
|
152
|
|
|
{ |
|
153
|
|
|
$this->mpeg4_height = $mpeg4_height; |
|
154
|
|
|
} |
|
155
|
|
|
|
|
156
|
|
|
/** |
|
157
|
|
|
* @return int|null |
|
158
|
|
|
*/ |
|
159
|
|
|
public function getMpeg4Duration(): ?int |
|
160
|
|
|
{ |
|
161
|
|
|
return $this->mpeg4_duration; |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* @param int|null $mpeg4_duration |
|
166
|
|
|
*/ |
|
167
|
|
|
public function setMpeg4Duration(?int $mpeg4_duration): void |
|
168
|
|
|
{ |
|
169
|
|
|
$this->mpeg4_duration = $mpeg4_duration; |
|
170
|
|
|
} |
|
171
|
|
|
|
|
172
|
|
|
/** |
|
173
|
|
|
* @return string |
|
174
|
|
|
*/ |
|
175
|
|
|
public function getThumbUrl(): string |
|
176
|
|
|
{ |
|
177
|
|
|
return $this->thumb_url; |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
/** |
|
181
|
|
|
* @param string $thumb_url |
|
182
|
|
|
*/ |
|
183
|
|
|
public function setThumbUrl(string $thumb_url): void |
|
184
|
|
|
{ |
|
185
|
|
|
$this->thumb_url = $thumb_url; |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
/** |
|
189
|
|
|
* @return string|null |
|
190
|
|
|
*/ |
|
191
|
|
|
public function getTitle(): ?string |
|
192
|
|
|
{ |
|
193
|
|
|
return $this->title; |
|
194
|
|
|
} |
|
195
|
|
|
|
|
196
|
|
|
/** |
|
197
|
|
|
* @param string|null $title |
|
198
|
|
|
*/ |
|
199
|
|
|
public function setTitle(?string $title): void |
|
200
|
|
|
{ |
|
201
|
|
|
$this->title = $title; |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
/** |
|
205
|
|
|
* @return string|null |
|
206
|
|
|
*/ |
|
207
|
|
|
public function getCaption(): ?string |
|
208
|
|
|
{ |
|
209
|
|
|
return $this->caption; |
|
210
|
|
|
} |
|
211
|
|
|
|
|
212
|
|
|
/** |
|
213
|
|
|
* @param string|null $caption |
|
214
|
|
|
*/ |
|
215
|
|
|
public function setCaption(?string $caption): void |
|
216
|
|
|
{ |
|
217
|
|
|
$this->caption = $caption; |
|
218
|
|
|
} |
|
219
|
|
|
|
|
220
|
|
|
/** |
|
221
|
|
|
* @return string|null |
|
222
|
|
|
*/ |
|
223
|
|
|
public function getParseMode(): ?string |
|
224
|
|
|
{ |
|
225
|
|
|
return $this->parse_mode; |
|
226
|
|
|
} |
|
227
|
|
|
|
|
228
|
|
|
/** |
|
229
|
|
|
* @param string|null $parse_mode |
|
230
|
|
|
*/ |
|
231
|
|
|
public function setParseMode(?string $parse_mode): void |
|
232
|
|
|
{ |
|
233
|
|
|
$this->parse_mode = $parse_mode; |
|
234
|
|
|
} |
|
235
|
|
|
|
|
236
|
|
|
/** |
|
237
|
|
|
* @return InlineKeyboardMarkup|null |
|
238
|
|
|
*/ |
|
239
|
|
|
public function getReplyMarkup(): ?InlineKeyboardMarkup |
|
240
|
|
|
{ |
|
241
|
|
|
return $this->reply_markup; |
|
242
|
|
|
} |
|
243
|
|
|
|
|
244
|
|
|
/** |
|
245
|
|
|
* @param InlineKeyboardMarkup|null $reply_markup |
|
246
|
|
|
*/ |
|
247
|
|
|
public function setReplyMarkup(?InlineKeyboardMarkup $reply_markup): void |
|
248
|
|
|
{ |
|
249
|
|
|
$this->reply_markup = $reply_markup; |
|
250
|
|
|
} |
|
251
|
|
|
|
|
252
|
|
|
/** |
|
253
|
|
|
* @return InputMessageContent|null |
|
254
|
|
|
*/ |
|
255
|
|
|
public function getInputMessageContent(): ?InputMessageContent |
|
256
|
|
|
{ |
|
257
|
|
|
return $this->input_message_content; |
|
258
|
|
|
} |
|
259
|
|
|
|
|
260
|
|
|
/** |
|
261
|
|
|
* @param InputMessageContent|null $input_message_content |
|
262
|
|
|
*/ |
|
263
|
|
|
public function setInputMessageContent(?InputMessageContent $input_message_content): void |
|
264
|
|
|
{ |
|
265
|
|
|
$this->input_message_content = $input_message_content; |
|
266
|
|
|
} |
|
267
|
|
|
|
|
268
|
|
|
/** |
|
269
|
|
|
* @return string|null |
|
270
|
|
|
*/ |
|
271
|
|
|
public function getThumbMimeType(): ?string |
|
272
|
|
|
{ |
|
273
|
|
|
return $this->thumb_mime_type; |
|
274
|
|
|
} |
|
275
|
|
|
|
|
276
|
|
|
/** |
|
277
|
|
|
* @param string|null $thumb_mime_type |
|
278
|
|
|
*/ |
|
279
|
|
|
public function setThumbMimeType(?string $thumb_mime_type): void |
|
280
|
|
|
{ |
|
281
|
|
|
$this->thumb_mime_type = $thumb_mime_type; |
|
282
|
|
|
} |
|
283
|
|
|
|
|
284
|
|
|
/** |
|
285
|
|
|
* @return \Zanzara\Telegram\Type\MessageEntity[]|null |
|
286
|
|
|
*/ |
|
287
|
|
|
public function getCaptionEntities(): ?array |
|
288
|
|
|
{ |
|
289
|
|
|
return $this->caption_entities; |
|
290
|
|
|
} |
|
291
|
|
|
|
|
292
|
|
|
/** |
|
293
|
|
|
* @param \Zanzara\Telegram\Type\MessageEntity[]|null $caption_entities |
|
294
|
|
|
*/ |
|
295
|
|
|
public function setCaptionEntities(?array $caption_entities): void |
|
296
|
|
|
{ |
|
297
|
|
|
$this->caption_entities = $caption_entities; |
|
298
|
|
|
} |
|
299
|
|
|
|
|
300
|
|
|
} |