Add GetBusinessConnection method
This commit is contained in:
parent
69f796b951
commit
af7473aa05
2 changed files with 43 additions and 0 deletions
|
@ -29,6 +29,7 @@
|
|||
use TgBotLib\Methods\ExportChatInviteLink;
|
||||
use TgBotLib\Methods\ForwardMessage;
|
||||
use TgBotLib\Methods\ForwardMessages;
|
||||
use TgBotLib\Methods\GetBusinessConnection;
|
||||
use TgBotLib\Methods\GetChat;
|
||||
use TgBotLib\Methods\GetChatAdministrators;
|
||||
use TgBotLib\Methods\GetChatMember;
|
||||
|
@ -158,6 +159,7 @@
|
|||
case UNPIN_ALL_GENERAL_FORUM_TOPIC_MESSAGES = 'unpinAllGeneralForumTopicMessages';
|
||||
case ANSWER_CALLBACK_QUERY = 'answerCallbackQuery';
|
||||
case GET_USER_CHAT_BOOSTS = 'getUserChatBoosts';
|
||||
case GET_BUSINESS_CONNECTION = 'getBusinessConnection';
|
||||
|
||||
/**
|
||||
* Executes a command on the provided bot with the given parameters.
|
||||
|
@ -246,6 +248,7 @@
|
|||
self::UNPIN_ALL_GENERAL_FORUM_TOPIC_MESSAGES => UnpinAllGeneralForumTopicMessages::execute($bot, $parameters),
|
||||
self::ANSWER_CALLBACK_QUERY => AnswerCallbackQuery::execute($bot, $parameters),
|
||||
self::GET_USER_CHAT_BOOSTS => GetUserChatBoosts::execute($bot, $parameters),
|
||||
self::GET_BUSINESS_CONNECTION => GetBusinessConnection::execute($bot, $parameters),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
40
src/TgBotLib/Methods/GetBusinessConnection.php
Normal file
40
src/TgBotLib/Methods/GetBusinessConnection.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Methods;
|
||||
|
||||
use TgBotLib\Abstracts\Method;
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Enums\Methods;
|
||||
use TgBotLib\Objects\BusinessConnection;
|
||||
|
||||
class GetBusinessConnection extends Method
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function execute(Bot $bot, array $parameters = []): BusinessConnection
|
||||
{
|
||||
return BusinessConnection::fromArray(
|
||||
self::executeCurl(self::buildPost($bot, Methods::GET_BUSINESS_CONNECTION->value, $parameters))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getRequiredParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'business_connection_id'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getOptionalParameters(): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue