Add CloseGeneralForumTopic method
This commit is contained in:
parent
175754649c
commit
9ea36578df
2 changed files with 40 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
||||||
use TgBotLib\Methods\BanChatSenderChat;
|
use TgBotLib\Methods\BanChatSenderChat;
|
||||||
use TgBotLib\Methods\Close;
|
use TgBotLib\Methods\Close;
|
||||||
use TgBotLib\Methods\CloseForumTopic;
|
use TgBotLib\Methods\CloseForumTopic;
|
||||||
|
use TgBotLib\Methods\CloseGeneralForumTopic;
|
||||||
use TgBotLib\Methods\CopyMessage;
|
use TgBotLib\Methods\CopyMessage;
|
||||||
use TgBotLib\Methods\CopyMessages;
|
use TgBotLib\Methods\CopyMessages;
|
||||||
use TgBotLib\Methods\CreateChatInviteLink;
|
use TgBotLib\Methods\CreateChatInviteLink;
|
||||||
|
@ -144,6 +145,7 @@
|
||||||
case DELETE_FORUM_TOPIC = 'deleteForumTopic';
|
case DELETE_FORUM_TOPIC = 'deleteForumTopic';
|
||||||
case UNPIN_ALLL_FORUM_TOPIC_MESSAGES = 'UnpinAllForumTopicMessages';
|
case UNPIN_ALLL_FORUM_TOPIC_MESSAGES = 'UnpinAllForumTopicMessages';
|
||||||
case EDIT_GENERAL_FORUM_TOPIC = 'editGeneralForumTopic';
|
case EDIT_GENERAL_FORUM_TOPIC = 'editGeneralForumTopic';
|
||||||
|
case CLOSE_GENERAL_FORUM_TOPIC = 'closeGeneralForumTopic';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a command on the provided bot with the given parameters.
|
* Executes a command on the provided bot with the given parameters.
|
||||||
|
@ -225,6 +227,7 @@
|
||||||
self::DELETE_FORUM_TOPIC => DeleteForumTopic::execute($bot, $parameters),
|
self::DELETE_FORUM_TOPIC => DeleteForumTopic::execute($bot, $parameters),
|
||||||
self::UNPIN_ALLL_FORUM_TOPIC_MESSAGES => UnpinAllForumTopicMessages::execute($bot, $parameters),
|
self::UNPIN_ALLL_FORUM_TOPIC_MESSAGES => UnpinAllForumTopicMessages::execute($bot, $parameters),
|
||||||
self::EDIT_GENERAL_FORUM_TOPIC => EditGeneralForumTopic::execute($bot, $parameters),
|
self::EDIT_GENERAL_FORUM_TOPIC => EditGeneralForumTopic::execute($bot, $parameters),
|
||||||
|
self::CLOSE_GENERAL_FORUM_TOPIC => CloseGeneralForumTopic::execute($bot, $parameters),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
37
src/TgBotLib/Methods/CloseGeneralForumTopic.php
Normal file
37
src/TgBotLib/Methods/CloseGeneralForumTopic.php
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace TgBotLib\Methods;
|
||||||
|
|
||||||
|
use TgBotLib\Abstracts\Method;
|
||||||
|
use TgBotLib\Bot;
|
||||||
|
use TgBotLib\Enums\Methods;
|
||||||
|
|
||||||
|
class CloseGeneralForumTopic extends Method
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public static function execute(Bot $bot, array $parameters = []): true
|
||||||
|
{
|
||||||
|
return (bool)(self::executeCurl(self::buildPost($bot, Methods::CLOSE_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