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