|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Inline\QueryResult; |
|
4
|
|
|
|
|
5
|
|
|
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup; |
|
6
|
|
|
use TelegramBot\Api\Types\Inline\InputMessageContent; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class InlineQueryResultMpeg4Gif |
|
10
|
|
|
* Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). |
|
11
|
|
|
* By default, this animated MPEG-4 file will be sent by the user with optional caption. |
|
12
|
|
|
* Alternatively, you can provide message_text to send it instead of the animation. |
|
13
|
|
|
* |
|
14
|
|
|
* @package TelegramBot\Api\Types\Inline |
|
15
|
|
|
*/ |
|
16
|
|
|
class Mpeg4Gif extends AbstractInlineQueryResult |
|
17
|
|
|
{ |
|
18
|
|
|
/** |
|
19
|
|
|
* {@inheritdoc} |
|
20
|
|
|
* |
|
21
|
|
|
* @var array |
|
22
|
|
|
*/ |
|
23
|
|
|
static protected $requiredParams = ['type', 'id', 'mpeg4_url', 'thumb_url']; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* {@inheritdoc} |
|
27
|
|
|
* |
|
28
|
|
|
* @var array |
|
29
|
|
|
*/ |
|
30
|
|
|
static protected $map = [ |
|
31
|
|
|
'type' => true, |
|
32
|
|
|
'id' => true, |
|
33
|
|
|
'mpeg4_url' => true, |
|
34
|
|
|
'mpeg4_width' => true, |
|
35
|
|
|
'mpeg4_height' => true, |
|
36
|
|
|
'thumb_url' => true, |
|
37
|
|
|
'title' => true, |
|
38
|
|
|
'caption' => true, |
|
39
|
|
|
'reply_markup' => InlineKeyboardMarkup::class, |
|
40
|
|
|
'input_message_content' => InputMessageContent::class, |
|
41
|
|
|
]; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* {@inheritdoc} |
|
45
|
|
|
* |
|
46
|
|
|
* @var string |
|
47
|
|
|
*/ |
|
48
|
|
|
protected $type = 'mpeg4_gif'; |
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* A valid URL for the MP4 file. File size must not exceed 1MB |
|
52
|
|
|
* |
|
53
|
|
|
* @var string |
|
54
|
|
|
*/ |
|
55
|
|
|
protected $mpeg4Url; |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* Optional. Video width |
|
59
|
|
|
* |
|
60
|
|
|
* @var int |
|
61
|
|
|
*/ |
|
62
|
|
|
protected $mpeg4Width; |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* Optional. Video height |
|
66
|
|
|
* |
|
67
|
|
|
* @var int |
|
68
|
|
|
*/ |
|
69
|
|
|
protected $mpeg4Height; |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
72
|
|
|
* URL of the static thumbnail (jpeg or gif) for the result |
|
73
|
|
|
* |
|
74
|
|
|
* @var string |
|
75
|
|
|
*/ |
|
76
|
|
|
protected $thumbUrl; |
|
77
|
|
|
|
|
78
|
|
|
/** |
|
79
|
|
|
* Optional. Caption of the MPEG-4 file to be sent, 0-200 characters |
|
80
|
|
|
* |
|
81
|
|
|
* @var string |
|
82
|
|
|
*/ |
|
83
|
|
|
protected $caption; |
|
84
|
|
|
|
|
85
|
|
|
/** |
|
86
|
|
|
* InlineQueryResultMpeg4Gif constructor. |
|
87
|
|
|
* |
|
88
|
|
|
* @param string $id |
|
89
|
|
|
* @param string $mpeg4Url |
|
90
|
|
|
* @param string $thumbUrl |
|
91
|
|
|
* @param int|null $mpeg4Width |
|
92
|
|
|
* @param int|null $mpeg4Height |
|
93
|
|
|
* @param string|null $caption |
|
94
|
|
|
* @param string|null $title |
|
95
|
|
|
* @param InputMessageContent $inputMessageContent |
|
96
|
|
|
* @param InlineKeyboardMarkup|null $inlineKeyboardMarkup |
|
97
|
|
|
*/ |
|
98
|
|
|
public function __construct( |
|
99
|
|
|
$id, |
|
100
|
|
|
$mpeg4Url, |
|
101
|
|
|
$thumbUrl, |
|
102
|
|
|
$title = null, |
|
103
|
|
|
$caption = null, |
|
104
|
|
|
$mpeg4Width = null, |
|
105
|
|
|
$mpeg4Height = null, |
|
106
|
|
|
$inputMessageContent = null, |
|
107
|
|
|
$inlineKeyboardMarkup = null |
|
108
|
|
|
) { |
|
109
|
|
|
parent::__construct($id, $title, $inputMessageContent, $inlineKeyboardMarkup); |
|
110
|
|
|
|
|
111
|
|
|
$this->mpeg4Url = $mpeg4Url; |
|
112
|
|
|
$this->thumbUrl = $thumbUrl; |
|
113
|
|
|
$this->mpeg4Width = $mpeg4Width; |
|
114
|
|
|
$this->mpeg4Height = $mpeg4Height; |
|
115
|
|
|
$this->caption = $caption; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
|
|
119
|
|
|
/** |
|
120
|
|
|
* @return string |
|
121
|
|
|
*/ |
|
122
|
|
|
public function getMpeg4Url() |
|
123
|
|
|
{ |
|
124
|
|
|
return $this->mpeg4Url; |
|
125
|
|
|
} |
|
126
|
|
|
|
|
127
|
|
|
/** |
|
128
|
|
|
* @param string $mpeg4Url |
|
129
|
|
|
*/ |
|
130
|
|
|
public function setMpeg4Url($mpeg4Url) |
|
131
|
|
|
{ |
|
132
|
|
|
$this->mpeg4Url = $mpeg4Url; |
|
133
|
|
|
} |
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* @return int |
|
137
|
|
|
*/ |
|
138
|
|
|
public function getMpeg4Width() |
|
139
|
|
|
{ |
|
140
|
|
|
return $this->mpeg4Width; |
|
141
|
|
|
} |
|
142
|
|
|
|
|
143
|
|
|
/** |
|
144
|
|
|
* @param int $mpeg4Width |
|
145
|
|
|
*/ |
|
146
|
|
|
public function setMpeg4Width($mpeg4Width) |
|
147
|
|
|
{ |
|
148
|
|
|
$this->mpeg4Width = $mpeg4Width; |
|
149
|
|
|
} |
|
150
|
|
|
|
|
151
|
|
|
/** |
|
152
|
|
|
* @return int |
|
153
|
|
|
*/ |
|
154
|
|
|
public function getMpeg4Height() |
|
155
|
|
|
{ |
|
156
|
|
|
return $this->mpeg4Height; |
|
157
|
|
|
} |
|
158
|
|
|
|
|
159
|
|
|
/** |
|
160
|
|
|
* @param int $mpeg4Height |
|
161
|
|
|
*/ |
|
162
|
|
|
public function setMpeg4Height($mpeg4Height) |
|
163
|
|
|
{ |
|
164
|
|
|
$this->mpeg4Height = $mpeg4Height; |
|
165
|
|
|
} |
|
166
|
|
|
|
|
167
|
|
|
/** |
|
168
|
|
|
* @return string |
|
169
|
|
|
*/ |
|
170
|
|
|
public function getThumbUrl() |
|
171
|
|
|
{ |
|
172
|
|
|
return $this->thumbUrl; |
|
173
|
|
|
} |
|
174
|
|
|
|
|
175
|
|
|
/** |
|
176
|
|
|
* @param string $thumbUrl |
|
177
|
|
|
*/ |
|
178
|
|
|
public function setThumbUrl($thumbUrl) |
|
179
|
|
|
{ |
|
180
|
|
|
$this->thumbUrl = $thumbUrl; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
/** |
|
184
|
|
|
* @return string |
|
185
|
|
|
*/ |
|
186
|
|
|
public function getCaption() |
|
187
|
|
|
{ |
|
188
|
|
|
return $this->caption; |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
/** |
|
192
|
|
|
* @param string $caption |
|
193
|
|
|
*/ |
|
194
|
|
|
public function setCaption($caption) |
|
195
|
|
|
{ |
|
196
|
|
|
$this->caption = $caption; |
|
197
|
|
|
} |
|
198
|
|
|
} |
|
199
|
|
|
|