Major Refactoring

This commit is contained in:
Netkas 2023-02-14 17:35:16 -05:00
parent 3de87df2d9
commit 54a8a59ee8
83 changed files with 892 additions and 918 deletions

View file

@ -4,6 +4,7 @@
namespace TgBotLib\Objects\BotCommandScope;
use TgBotLib\Abstracts\BotCommandScopeType;
use TgBotLib\Interfaces\ObjectTypeInterface;
use TgBotLib\Objects\BotCommandScope;
@ -77,9 +78,11 @@
public static function fromArray(array $data): ObjectTypeInterface
{
$object = new self();
$object->type = $data['type'];
$object->chat_id = $data['chat_id'];
$object->user_id = $data['user_id'];
$object->type = $data['type'] ?? BotCommandScopeType::ChatMember;
$object->chat_id = $data['chat_id'] ?? null;
$object->user_id = $data['user_id'] ?? null;
return $object;
}