|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Inline; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* Class InlineQueryResultGif |
|
7
|
|
|
* Represents a link to an animated GIF file. |
|
8
|
|
|
* By default, this animated GIF 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 InlineQueryResultGif extends AbstractInlineQueryResult |
|
14
|
|
|
{ |
|
15
|
|
|
/** |
|
16
|
|
|
* {@inheritdoc} |
|
17
|
|
|
* |
|
18
|
|
|
* @var array |
|
19
|
|
|
*/ |
|
20
|
|
|
static protected $requiredParams = ['type', 'id', 'gif_url', 'thumb_url']; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* {@inheritdoc} |
|
24
|
|
|
* |
|
25
|
|
|
* @var array |
|
26
|
|
|
*/ |
|
27
|
|
|
static protected $map = [ |
|
28
|
|
|
'type' => true, |
|
29
|
|
|
'id' => true, |
|
30
|
|
|
'gif_url' => true, |
|
31
|
|
|
'gif_width' => true, |
|
32
|
|
|
'gif_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 GIF file. File size must not exceed 1MB |
|
43
|
|
|
* |
|
44
|
|
|
* @var string |
|
45
|
|
|
*/ |
|
46
|
|
|
protected $gifUrl; |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Optional. Width of the GIF |
|
50
|
|
|
* |
|
51
|
|
|
* @var int |
|
52
|
|
|
*/ |
|
53
|
|
|
protected $gifWidth; |
|
54
|
|
|
|
|
55
|
|
|
/** |
|
56
|
|
|
* Optional. Height of the GIF |
|
57
|
|
|
* |
|
58
|
|
|
* @var int |
|
59
|
|
|
*/ |
|
60
|
|
|
protected $gifHeight; |
|
61
|
|
|
|
|
62
|
|
|
/** |
|
63
|
|
|
* URL of the static thumbnail for the result (jpeg or gif) |
|
64
|
|
|
* |
|
65
|
|
|
* @var string |
|
66
|
|
|
*/ |
|
67
|
|
|
protected $thumbUrl; |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Optional. Caption of the GIF file to be sent, 0-200 characters |
|
71
|
|
|
* |
|
72
|
|
|
* @var string |
|
73
|
|
|
*/ |
|
74
|
|
|
protected $caption; |
|
75
|
|
|
|
|
76
|
|
|
/** |
|
77
|
|
|
* @return string |
|
78
|
|
|
*/ |
|
79
|
|
|
public function getGifUrl() |
|
80
|
|
|
{ |
|
81
|
|
|
return $this->gifUrl; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
/** |
|
85
|
|
|
* @param string $gifUrl |
|
86
|
|
|
*/ |
|
87
|
|
|
public function setGifUrl($gifUrl) |
|
88
|
|
|
{ |
|
89
|
|
|
$this->gifUrl = $gifUrl; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @return int |
|
94
|
|
|
*/ |
|
95
|
|
|
public function getGifWidth() |
|
96
|
|
|
{ |
|
97
|
|
|
return $this->gifWidth; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
|
|
/** |
|
101
|
|
|
* @param int $gifWidth |
|
102
|
|
|
*/ |
|
103
|
|
|
public function setGifWidth($gifWidth) |
|
104
|
|
|
{ |
|
105
|
|
|
$this->gifWidth = $gifWidth; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* @return int |
|
110
|
|
|
*/ |
|
111
|
|
|
public function getGifHeight() |
|
112
|
|
|
{ |
|
113
|
|
|
return $this->gifHeight; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @param int $gifHeight |
|
118
|
|
|
*/ |
|
119
|
|
|
public function setGifHeight($gifHeight) |
|
120
|
|
|
{ |
|
121
|
|
|
$this->gifHeight = $gifHeight; |
|
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
|
|
|
|