mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-24 00:56:50 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace BushlanovDev\MaxMessengerBot\Models;
|
||||
|
||||
/**
|
||||
* Command supported by the bot.
|
||||
*/
|
||||
final readonly class BotCommand extends AbstractModel
|
||||
{
|
||||
/**
|
||||
* @param string $name Command name (1 to 64 characters)
|
||||
* @param string|null $description Command description (1 to 128 characters)
|
||||
*/
|
||||
public function __construct(
|
||||
public string $name,
|
||||
public ?string $description,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
public static function fromArray(array $data): static
|
||||
{
|
||||
return new static(
|
||||
(string)$data['name'],
|
||||
$data['description'] ? (string)$data['description'] : null
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user