Add ReopenGeneralForumTopic method
This commit is contained in:
parent
9ea36578df
commit
89af7589cb
2 changed files with 40 additions and 0 deletions
|
@ -43,6 +43,7 @@
|
||||||
use TgBotLib\Methods\PinChatMessage;
|
use TgBotLib\Methods\PinChatMessage;
|
||||||
use TgBotLib\Methods\PromoteChatMember;
|
use TgBotLib\Methods\PromoteChatMember;
|
||||||
use TgBotLib\Methods\ReopenForumTopic;
|
use TgBotLib\Methods\ReopenForumTopic;
|
||||||
|
use TgBotLib\Methods\ReopenGeneralForumTopic;
|
||||||
use TgBotLib\Methods\RestrictChatMember;
|
use TgBotLib\Methods\RestrictChatMember;
|
||||||
use TgBotLib\Methods\RevokeChatInviteLink;
|
use TgBotLib\Methods\RevokeChatInviteLink;
|
||||||
use TgBotLib\Methods\SendAnimation;
|
use TgBotLib\Methods\SendAnimation;
|
||||||
|
@ -146,6 +147,7 @@
|
||||||
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';
|
case CLOSE_GENERAL_FORUM_TOPIC = 'closeGeneralForumTopic';
|
||||||
|
case REOPEN_GENERAL_FORUM_TOPIC = 'reopenGeneralForumTopic';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a command on the provided bot with the given parameters.
|
* Executes a command on the provided bot with the given parameters.
|
||||||
|
@ -228,6 +230,7 @@
|
||||||
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),
|
self::CLOSE_GENERAL_FORUM_TOPIC => CloseGeneralForumTopic::execute($bot, $parameters),
|
||||||
|
self::REOPEN_GENERAL_FORUM_TOPIC => ReopenGeneralForumTopic::execute($bot, $parameters),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
37
src/TgBotLib/Methods/ReopenGeneralForumTopic.php
Normal file
37
src/TgBotLib/Methods/ReopenGeneralForumTopic.php
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace TgBotLib\Methods;
|
||||||
|
|
||||||
|
use TgBotLib\Abstracts\Method;
|
||||||
|
use TgBotLib\Bot;
|
||||||
|
use TgBotLib\Enums\Methods;
|
||||||
|
|
||||||
|
class ReopenGeneralForumTopic extends Method
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public static function execute(Bot $bot, array $parameters = []): mixed
|
||||||
|
{
|
||||||
|
return (bool)(self::executeCurl(self::buildPost($bot, Methods::REOPEN_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
Add a link
Reference in a new issue