Added \TgBotLib\Objects\BotCommandScope > BotCommandScopeAllGroupChats

This commit is contained in:
Netkas 2023-02-13 20:23:50 -05:00
parent e90b920df3
commit dd1220cd5c

View file

@ -0,0 +1,52 @@
<?php
/** @noinspection PhpMissingFieldTypeInspection */
namespace TgBotLib\Objects\BotCommandScope;
use TgBotLib\Interfaces\ObjectTypeInterface;
class BotCommandScopeAllGroupChats implements ObjectTypeInterface
{
/**
* @var string
*/
private $type;
/**
* Scope type, must be all_group_chats
*
* @return string
*/
public function getType(): string
{
return $this->type;
}
/**
* Returns an array representation of the object
*
* @return array
*/
public function toArray(): array
{
return [
'type' => $this->type
];
}
/**
* Constructs object from an array representation
*
* @param array $data
* @return ObjectTypeInterface
*/
public static function fromArray(array $data): ObjectTypeInterface
{
$object = new self();
$object->type = $data['type'];
return $object;
}
}