Add GetMyName method to TgBotLib
This commit is contained in:
parent
d6f13f3177
commit
bf648ec2af
2 changed files with 41 additions and 0 deletions
38
src/TgBotLib/Methods/GetMyName.php
Normal file
38
src/TgBotLib/Methods/GetMyName.php
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Methods;
|
||||
|
||||
use TgBotLib\Abstracts\Method;
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Enums\Methods;
|
||||
use TgBotLib\Objects\BotName;
|
||||
|
||||
class GetMyName extends Method
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function execute(Bot $bot, array $parameters = []): BotName
|
||||
{
|
||||
return BotName::fromArray(self::executeCurl(self::buildPost($bot, Methods::GET_MY_NAME->value, $parameters)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getRequiredParameters(): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getOptionalParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'language_code'
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue