Add 'HideGeneralForumTopic' method
This commit is contained in:
parent
89af7589cb
commit
18bd8ce69e
2 changed files with 40 additions and 0 deletions
|
@ -38,6 +38,7 @@
|
|||
use TgBotLib\Methods\GetUpdates;
|
||||
use TgBotLib\Methods\GetUserProfilePhotos;
|
||||
use TgBotLib\Methods\GetWebhookInfo;
|
||||
use TgBotLib\Methods\HideGeneralForumTopic;
|
||||
use TgBotLib\Methods\LeaveChat;
|
||||
use TgBotLib\Methods\Logout;
|
||||
use TgBotLib\Methods\PinChatMessage;
|
||||
|
@ -148,6 +149,7 @@
|
|||
case EDIT_GENERAL_FORUM_TOPIC = 'editGeneralForumTopic';
|
||||
case CLOSE_GENERAL_FORUM_TOPIC = 'closeGeneralForumTopic';
|
||||
case REOPEN_GENERAL_FORUM_TOPIC = 'reopenGeneralForumTopic';
|
||||
case HIDE_GENERAL_FORUM_TOPIC = 'hideGeneralForumTopic';
|
||||
|
||||
/**
|
||||
* Executes a command on the provided bot with the given parameters.
|
||||
|
@ -231,6 +233,7 @@
|
|||
self::EDIT_GENERAL_FORUM_TOPIC => EditGeneralForumTopic::execute($bot, $parameters),
|
||||
self::CLOSE_GENERAL_FORUM_TOPIC => CloseGeneralForumTopic::execute($bot, $parameters),
|
||||
self::REOPEN_GENERAL_FORUM_TOPIC => ReopenGeneralForumTopic::execute($bot, $parameters),
|
||||
self::HIDE_GENERAL_FORUM_TOPIC => HideGeneralForumTopic::execute($bot, $parameters),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
37
src/TgBotLib/Methods/HideGeneralForumTopic.php
Normal file
37
src/TgBotLib/Methods/HideGeneralForumTopic.php
Normal file
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
namespace TgBotLib\Methods;
|
||||
|
||||
use TgBotLib\Abstracts\Method;
|
||||
use TgBotLib\Bot;
|
||||
use TgBotLib\Enums\Methods;
|
||||
|
||||
class HideGeneralForumTopic extends Method
|
||||
{
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function execute(Bot $bot, array $parameters = []): true
|
||||
{
|
||||
return (bool)(self::executeCurl(self::buildPost($bot, Methods::HIDE_GENERAL_FORUM_TOPIC->value, $parameters)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getRequiredParameters(): ?array
|
||||
{
|
||||
return [
|
||||
'chat_id'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function getOptionalParameters(): ?array
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue