Add GetMyDefaultAdministratorRights
This commit is contained in:
parent
c61c37be02
commit
e0543413e3
2 changed files with 41 additions and 0 deletions
|
@ -40,6 +40,7 @@
|
||||||
use TgBotLib\Methods\GetForumTopicIconStickers;
|
use TgBotLib\Methods\GetForumTopicIconStickers;
|
||||||
use TgBotLib\Methods\GetMe;
|
use TgBotLib\Methods\GetMe;
|
||||||
use TgBotLib\Methods\GetMyCommands;
|
use TgBotLib\Methods\GetMyCommands;
|
||||||
|
use TgBotLib\Methods\GetMyDefaultAdministratorRights;
|
||||||
use TgBotLib\Methods\GetMyDescription;
|
use TgBotLib\Methods\GetMyDescription;
|
||||||
use TgBotLib\Methods\GetMyName;
|
use TgBotLib\Methods\GetMyName;
|
||||||
use TgBotLib\Methods\GetMyShortDescription;
|
use TgBotLib\Methods\GetMyShortDescription;
|
||||||
|
@ -184,6 +185,7 @@
|
||||||
case SET_CHAT_MENU_BUTTON = 'setChatMenuButton';
|
case SET_CHAT_MENU_BUTTON = 'setChatMenuButton';
|
||||||
case GET_CHAT_MENU_BUTTON = 'getChatMenuButton';
|
case GET_CHAT_MENU_BUTTON = 'getChatMenuButton';
|
||||||
case SET_MY_DEFAULT_ADMINISTRATOR_RIGHTS = 'setMyDefaultAdministratorRights';
|
case SET_MY_DEFAULT_ADMINISTRATOR_RIGHTS = 'setMyDefaultAdministratorRights';
|
||||||
|
case GET_MY_DEFAULT_ADMINISTRATOR_RIGHTS = 'getMyDefaultAdministratorRights';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a command on the provided bot with the given parameters.
|
* Executes a command on the provided bot with the given parameters.
|
||||||
|
@ -285,6 +287,7 @@
|
||||||
self::SET_CHAT_MENU_BUTTON => SetChatMenuButton::execute($bot, $parameters),
|
self::SET_CHAT_MENU_BUTTON => SetChatMenuButton::execute($bot, $parameters),
|
||||||
self::GET_CHAT_MENU_BUTTON => GetChatMenuButton::execute($bot, $parameters),
|
self::GET_CHAT_MENU_BUTTON => GetChatMenuButton::execute($bot, $parameters),
|
||||||
self::SET_MY_DEFAULT_ADMINISTRATOR_RIGHTS => SetMyDefaultAdministratorRights::execute($bot, $parameters),
|
self::SET_MY_DEFAULT_ADMINISTRATOR_RIGHTS => SetMyDefaultAdministratorRights::execute($bot, $parameters),
|
||||||
|
self::GET_MY_DEFAULT_ADMINISTRATOR_RIGHTS => GetMyDefaultAdministratorRights::execute($bot, $parameters),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
38
src/TgBotLib/Methods/GetMyDefaultAdministratorRights.php
Normal file
38
src/TgBotLib/Methods/GetMyDefaultAdministratorRights.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\ChatAdministratorRights;
|
||||||
|
|
||||||
|
class GetMyDefaultAdministratorRights extends Method
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public static function execute(Bot $bot, array $parameters = []): ChatAdministratorRights
|
||||||
|
{
|
||||||
|
return ChatAdministratorRights::fromArray(self::executeCurl(self::buildPost($bot, Methods::GET_MY_DEFAULT_ADMINISTRATOR_RIGHTS->value, $parameters)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public static function getRequiredParameters(): ?array
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public static function getOptionalParameters(): ?array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'for_channels'
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue