Added BotName

This commit is contained in:
netkas 2024-10-09 13:13:28 -04:00
parent 4558ebb9a7
commit 02d9fe69d9

View file

@ -0,0 +1,46 @@
<?php
namespace TgBotLib\Objects;
use TgBotLib\Interfaces\ObjectTypeInterface;
class BotName implements ObjectTypeInterface
{
private string $name;
/**
* The bot's name
*
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @inheritDoc
*/
public function toArray(): ?array
{
return [
'name' => $this->name
];
}
/**
* @inheritDoc
*/
public static function fromArray(?array $data): ?BotName
{
if($data === null)
{
return null;
}
$object = new self();
$object->name = $data['name'];
return $object;
}
}