diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 3a65e77..b941066 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -73,6 +73,7 @@ use TgBotLib\Methods\SendVoice; use TgBotLib\Methods\SetChatAdministratorCustomTitle; use TgBotLib\Methods\SetChatDescription; + use TgBotLib\Methods\SetChatMenuButton; use TgBotLib\Methods\SetChatPermissions; use TgBotLib\Methods\SetChatPhoto; use TgBotLib\Methods\SetChatStickerSet; @@ -178,6 +179,7 @@ case GET_MY_DESCRIPTION = 'getMyDescription'; case SET_MY_SHORT_DESCRIPTION = 'setMyShortDescription'; case GET_MY_SHORT_DESCRIPTION = 'getMyShortDescription'; + case SET_CHAT_MENU_BUTTON = 'setChatMenuButton'; /** * Executes a command on the provided bot with the given parameters. @@ -276,6 +278,7 @@ self::GET_MY_DESCRIPTION => GetMyDescription::execute($bot, $parameters), self::SET_MY_SHORT_DESCRIPTION => SetMyShortDescription::execute($bot, $parameters), self::GET_MY_SHORT_DESCRIPTION => GetMyShortDescription::execute($bot, $parameters), + self::SET_CHAT_MENU_BUTTON => SetChatMenuButton::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/SetChatMenuButton.php b/src/TgBotLib/Methods/SetChatMenuButton.php new file mode 100644 index 0000000..87847b1 --- /dev/null +++ b/src/TgBotLib/Methods/SetChatMenuButton.php @@ -0,0 +1,44 @@ +toArray()); + } + + return self::executeCurl(self::buildPost($bot, Methods::SET_CHAT_MENU_BUTTON->value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return null; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'chat_id', + 'menu_button' + ]; + } + } \ No newline at end of file