Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit ddd5e16

Browse files
committed
Sticker set administration
1 parent 5e332ed commit ddd5e16

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
namespace unreal4u\TelegramAPI\Telegram\Methods;
6+
7+
use Psr\Log\LoggerInterface;
8+
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
9+
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
10+
use unreal4u\TelegramAPI\InternalFunctionality\TelegramRawData;
11+
use unreal4u\TelegramAPI\Telegram\Types\Custom\ResultBoolean;
12+
13+
/**
14+
* Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for
15+
* this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in
16+
* getChat requests to check if the bot can use this method. Returns True on success
17+
*
18+
* Objects defined as-is october 2017
19+
*
20+
* @see https://core.telegram.org/bots/api#deletechatstickerset
21+
*/
22+
class DeleteChatStickerSet extends TelegramMethods
23+
{
24+
/**
25+
* Unique identifier for the target chat or username of the target supergroup or channel (in the format
26+
* @channelusername)
27+
* @var string
28+
*/
29+
public $chat_id = '';
30+
31+
public static function bindToObject(TelegramRawData $data, LoggerInterface $logger): TelegramTypes
32+
{
33+
return new ResultBoolean($data->getResultBoolean(), $logger);
34+
}
35+
36+
public function getMandatoryFields(): array
37+
{
38+
return [
39+
'chat_id',
40+
];
41+
}
42+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
declare(strict_types = 1);
4+
5+
namespace unreal4u\TelegramAPI\Telegram\Methods;
6+
7+
use Psr\Log\LoggerInterface;
8+
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
9+
use unreal4u\TelegramAPI\Abstracts\TelegramTypes;
10+
use unreal4u\TelegramAPI\InternalFunctionality\TelegramRawData;
11+
use unreal4u\TelegramAPI\Telegram\Types\Custom\ResultBoolean;
12+
13+
/**
14+
* Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for
15+
* this to work and must have the appropriate admin rights. Use the field can_set_sticker_set optionally returned in
16+
* getChat requests to check if the bot can use this method. Returns True on success
17+
*
18+
* Objects defined as-is october 2017
19+
*
20+
* @see https://core.telegram.org/bots/api#setchatstickerset
21+
*/
22+
class SetChatStickerSet extends TelegramMethods
23+
{
24+
/**
25+
* Unique identifier for the target chat or username of the target supergroup or channel (in the format
26+
* @channelusername)
27+
* @var string
28+
*/
29+
public $chat_id = '';
30+
31+
/**
32+
* Name of the sticker set to be set as the group sticker set
33+
* @var string
34+
*/
35+
public $sticker_set_name = '';
36+
37+
public static function bindToObject(TelegramRawData $data, LoggerInterface $logger): TelegramTypes
38+
{
39+
return new ResultBoolean($data->getResultBoolean(), $logger);
40+
}
41+
42+
public function getMandatoryFields(): array
43+
{
44+
return [
45+
'chat_id',
46+
'sticker_set_name',
47+
];
48+
}
49+
}

0 commit comments

Comments
 (0)