|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types; |
|
4
|
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
|
6
|
|
|
use TelegramBot\Api\TypeInterface; |
|
7
|
|
|
|
|
8
|
|
|
/** |
|
9
|
|
|
* Class StickerSet |
|
10
|
|
|
* This object represents a sticker set. |
|
11
|
|
|
* |
|
12
|
|
|
* @package TelegramBot\Api\Types |
|
13
|
|
|
* @author bernard-ng <[email protected]> |
|
14
|
|
|
*/ |
|
15
|
|
|
class StickerSet extends BaseType implements TypeInterface |
|
16
|
|
|
{ |
|
17
|
|
|
/** |
|
18
|
|
|
* {@inheritdoc} |
|
19
|
|
|
* |
|
20
|
|
|
* @var array |
|
21
|
|
|
*/ |
|
22
|
|
|
protected static $requiredParams = ['name', 'title', 'sticker_type', 'is_animated', 'is_video', 'stickers']; |
|
23
|
|
|
|
|
24
|
|
|
/** |
|
25
|
|
|
* {@inheritdoc} |
|
26
|
|
|
* |
|
27
|
|
|
* @var array |
|
28
|
|
|
*/ |
|
29
|
|
|
protected static $map = [ |
|
30
|
|
|
'name' => true, |
|
31
|
|
|
'title' => true, |
|
32
|
|
|
'sticker_type' => true, |
|
33
|
|
|
'is_animated' => true, |
|
34
|
|
|
'is_video' => true, |
|
35
|
|
|
'stickers' => ArrayOfSticker::class, |
|
36
|
|
|
'thumbnail' => PhotoSize::class, |
|
37
|
|
|
]; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* Sticker set name |
|
41
|
|
|
* |
|
42
|
|
|
* @var string |
|
43
|
|
|
*/ |
|
44
|
|
|
protected $name; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Sticker set title |
|
48
|
|
|
* |
|
49
|
|
|
* @var string |
|
50
|
|
|
*/ |
|
51
|
|
|
protected $title; |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” |
|
55
|
|
|
* |
|
56
|
|
|
* @var string |
|
57
|
|
|
*/ |
|
58
|
|
|
protected $stickerType; |
|
59
|
|
|
|
|
60
|
|
|
/** |
|
61
|
|
|
* True, if the sticker set contains animated stickers |
|
62
|
|
|
* |
|
63
|
|
|
* @var bool |
|
64
|
|
|
*/ |
|
65
|
|
|
protected $isAnimated; |
|
66
|
|
|
|
|
67
|
|
|
/** |
|
68
|
|
|
* True, if the sticker set contains video stickers |
|
69
|
|
|
* |
|
70
|
|
|
* @var bool |
|
71
|
|
|
*/ |
|
72
|
|
|
protected $isVideo; |
|
73
|
|
|
|
|
74
|
|
|
/** |
|
75
|
|
|
* List of all set stickers |
|
76
|
|
|
* |
|
77
|
|
|
* @var ArrayOfSticker |
|
78
|
|
|
*/ |
|
79
|
|
|
protected $stickers; |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* Optional. Sticker set thumbnail in the .WEBP or .TGS format |
|
83
|
|
|
* |
|
84
|
|
|
* @var PhotoSize|null |
|
85
|
|
|
*/ |
|
86
|
|
|
protected $thumbnail; |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @return string |
|
90
|
|
|
*/ |
|
91
|
|
|
public function getName() |
|
92
|
|
|
{ |
|
93
|
|
|
return $this->name; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* @param string $name |
|
98
|
|
|
* |
|
99
|
|
|
* @return void |
|
100
|
|
|
*/ |
|
101
|
|
|
public function setName($name) |
|
102
|
|
|
{ |
|
103
|
|
|
$this->name = $name; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
|
|
/** |
|
107
|
|
|
* @return string |
|
108
|
|
|
*/ |
|
109
|
|
|
public function getTitle() |
|
110
|
|
|
{ |
|
111
|
|
|
return $this->title; |
|
112
|
|
|
} |
|
113
|
|
|
|
|
114
|
|
|
/** |
|
115
|
|
|
* @param string $title |
|
116
|
|
|
* |
|
117
|
|
|
* @return void |
|
118
|
|
|
*/ |
|
119
|
|
|
public function setTitle($title) |
|
120
|
|
|
{ |
|
121
|
|
|
$this->title = $title; |
|
122
|
|
|
} |
|
123
|
|
|
|
|
124
|
|
|
/** |
|
125
|
|
|
* @return string |
|
126
|
|
|
*/ |
|
127
|
|
|
public function getStickerType() |
|
128
|
|
|
{ |
|
129
|
|
|
return $this->stickerType; |
|
130
|
|
|
} |
|
131
|
|
|
|
|
132
|
|
|
/** |
|
133
|
|
|
* @param string $stickerType |
|
134
|
|
|
* |
|
135
|
|
|
* @return void |
|
136
|
|
|
*/ |
|
137
|
|
|
public function setStickerType($stickerType) |
|
138
|
|
|
{ |
|
139
|
|
|
$this->stickerType = $stickerType; |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
/** |
|
143
|
|
|
* @return bool |
|
144
|
|
|
*/ |
|
145
|
|
|
public function getIsAnimated() |
|
146
|
|
|
{ |
|
147
|
|
|
return $this->isAnimated; |
|
148
|
|
|
} |
|
149
|
|
|
|
|
150
|
|
|
/** |
|
151
|
|
|
* @param bool $isAnimated |
|
152
|
|
|
* |
|
153
|
|
|
* @return void |
|
154
|
|
|
*/ |
|
155
|
|
|
public function setIsAnimated($isAnimated) |
|
156
|
|
|
{ |
|
157
|
|
|
$this->isAnimated = $isAnimated; |
|
158
|
|
|
} |
|
159
|
|
|
|
|
160
|
|
|
/** |
|
161
|
|
|
* @return bool |
|
162
|
|
|
*/ |
|
163
|
|
|
public function getIsVideo() |
|
164
|
|
|
{ |
|
165
|
|
|
return $this->isVideo; |
|
166
|
|
|
} |
|
167
|
|
|
|
|
168
|
|
|
/** |
|
169
|
|
|
* @param bool $isVideo |
|
170
|
|
|
* |
|
171
|
|
|
* @return void |
|
172
|
|
|
*/ |
|
173
|
|
|
public function setIsVideo($isVideo) |
|
174
|
|
|
{ |
|
175
|
|
|
$this->isVideo = $isVideo; |
|
176
|
|
|
} |
|
177
|
|
|
|
|
178
|
|
|
/** |
|
179
|
|
|
* @return ArrayOfSticker |
|
180
|
|
|
*/ |
|
181
|
|
|
public function getStickers() |
|
182
|
|
|
{ |
|
183
|
|
|
return $this->stickers; |
|
184
|
|
|
} |
|
185
|
|
|
|
|
186
|
|
|
/** |
|
187
|
|
|
* @param ArrayOfSticker $stickers |
|
188
|
|
|
* |
|
189
|
|
|
* @return void |
|
190
|
|
|
*/ |
|
191
|
|
|
public function setStickers($stickers) |
|
192
|
|
|
{ |
|
193
|
|
|
$this->stickers = $stickers; |
|
194
|
|
|
} |
|
195
|
|
|
|
|
196
|
|
|
/** |
|
197
|
|
|
* @return PhotoSize|null |
|
198
|
|
|
*/ |
|
199
|
|
|
public function getThumbnail() |
|
200
|
|
|
{ |
|
201
|
|
|
return $this->thumbnail; |
|
202
|
|
|
} |
|
203
|
|
|
|
|
204
|
|
|
/** |
|
205
|
|
|
* @param PhotoSize $thumbnail |
|
206
|
|
|
* |
|
207
|
|
|
* @return void |
|
208
|
|
|
*/ |
|
209
|
|
|
public function setThumbnail($thumbnail) |
|
210
|
|
|
{ |
|
211
|
|
|
$this->thumbnail = $thumbnail; |
|
212
|
|
|
} |
|
213
|
|
|
|
|
214
|
|
|
/** |
|
215
|
|
|
* @deprecated use getThumbnail method |
|
216
|
|
|
* |
|
217
|
|
|
* @return PhotoSize|null |
|
218
|
|
|
*/ |
|
219
|
|
|
public function getThumb() |
|
220
|
|
|
{ |
|
221
|
|
|
return $this->getThumbnail(); |
|
222
|
|
|
} |
|
223
|
|
|
|
|
224
|
|
|
/** |
|
225
|
|
|
* @deprecated use setThumbnail method |
|
226
|
|
|
* |
|
227
|
|
|
* @param PhotoSize $thumb |
|
228
|
|
|
* |
|
229
|
|
|
* @return void |
|
230
|
|
|
*/ |
|
231
|
|
|
public function setThumb($thumb) |
|
232
|
|
|
{ |
|
233
|
|
|
$this->setThumbnail($thumb); |
|
234
|
|
|
} |
|
235
|
|
|
} |
|
236
|
|
|
|