1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace TgBotApi\BotApiBase\Method; |
6
|
|
|
|
7
|
|
|
use TgBotApi\BotApiBase\Method\Interfaces\SetMethodAliasInterface; |
8
|
|
|
use TgBotApi\BotApiBase\Type\InputFileType; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class SetStickerSetThumbMethod. |
12
|
|
|
* |
13
|
|
|
* Use this method to set the thumbnail of a sticker set. |
14
|
|
|
* Animated thumbnails can be set for animated sticker sets only. |
15
|
|
|
* Returns True on success. |
16
|
|
|
* |
17
|
|
|
* @see https://core.telegram.org/bots/api#setstickersetthumb |
18
|
|
|
*/ |
19
|
|
|
class SetStickerSetThumbMethod implements SetMethodAliasInterface |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* Sticker set name. |
23
|
|
|
* |
24
|
|
|
* @var string |
25
|
|
|
*/ |
26
|
|
|
public $name; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* User identifier of the sticker set owner. |
30
|
|
|
* |
31
|
|
|
* @var int |
32
|
|
|
*/ |
33
|
|
|
public $userId; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Optional. A PNG image with the thumbnail, must be up to 128 kilobytes in size |
37
|
|
|
* and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; |
38
|
|
|
* see https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical |
39
|
|
|
* requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, |
40
|
|
|
* pass an HTTP URL as a String for Telegram to get a file from the Internet, |
41
|
|
|
* or upload a new one using multipart/form-data. |
42
|
|
|
* More info on Sending Files: https://core.telegram.org/bots/api#sending-files. |
43
|
|
|
* Animated sticker set thumbnail can't be uploaded via HTTP URL. |
44
|
|
|
* |
45
|
|
|
* @var InputFileType|string|null |
46
|
|
|
*/ |
47
|
|
|
public $thumb; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @param InputFileType|string|null $thumb |
51
|
|
|
*/ |
52
|
3 |
|
public static function create(string $name, int $userId, $thumb = null): SetStickerSetThumbMethod |
53
|
|
|
{ |
54
|
3 |
|
$instance = new static(); |
55
|
3 |
|
$instance->name = $name; |
56
|
3 |
|
$instance->userId = $userId; |
57
|
3 |
|
$instance->thumb = $thumb; |
58
|
|
|
|
59
|
3 |
|
return $instance; |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|