Updated BotCommandScopes

This commit is contained in:
Netkas 2023-02-13 20:33:55 -05:00
parent 418cdf8497
commit d4b7924358
6 changed files with 98 additions and 0 deletions

View file

@ -5,6 +5,7 @@
namespace TgBotLib\Objects\BotCommandScope;
use TgBotLib\Interfaces\ObjectTypeInterface;
use TgBotLib\Objects\BotCommandScope;
class BotCommandScopeAllGroupChats implements ObjectTypeInterface
{
@ -49,4 +50,19 @@
return $object;
}
/**
* Constructs object from BotCommandScope
*
* @param BotCommandScope $botCommandScope
* @return BotCommandScopeAllGroupChats
*/
public static function fromBotCommandScope(BotCommandScope $botCommandScope): BotCommandScopeAllGroupChats
{
$object = new self();
$object->type = $botCommandScope->getType();
return $object;
}
}