From 3acdb17d4645d2513adc8f5416294a4d6b740870 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 15:46:39 -0500 Subject: [PATCH] Add SetChatTitle method --- src/TgBotLib/Enums/Methods.php | 3 +++ src/TgBotLib/Methods/SetChatTitle.php | 37 +++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/TgBotLib/Methods/SetChatTitle.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index b88ff4b..310c974 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -49,6 +49,7 @@ use TgBotLib\Methods\SetChatAdministratorCustomTitle; use TgBotLib\Methods\SetChatPermissions; use TgBotLib\Methods\SetChatPhoto; + use TgBotLib\Methods\SetChatTitle; use TgBotLib\Methods\SetMessageReaction; use TgBotLib\Methods\SetWebhook; use TgBotLib\Methods\UnbanChatMember; @@ -104,6 +105,7 @@ case DECLINE_CHAT_JOIN_REQUEST = 'declineChatJoinRequest'; case SET_CHAT_PHOTO = 'setChatPhoto'; case DELETE_CHAT_PHOTO = 'deleteChatPhoto'; + case SET_CHAT_TITLE = 'setChatTitle'; /** * Executes a command on the provided bot with the given parameters. @@ -165,6 +167,7 @@ self::DECLINE_CHAT_JOIN_REQUEST => DeclineChatJoinRequest::execute($bot, $parameters), self::SET_CHAT_PHOTO => SetChatPhoto::execute($bot, $parameters), self::DELETE_CHAT_PHOTO => DeleteChatPhoto::execute($bot, $parameters), + self::SET_CHAT_TITLE => SetChatTitle::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/SetChatTitle.php b/src/TgBotLib/Methods/SetChatTitle.php new file mode 100644 index 0000000..aef169a --- /dev/null +++ b/src/TgBotLib/Methods/SetChatTitle.php @@ -0,0 +1,37 @@ +value, $parameters))); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id', + 'title' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return null; + } + } \ No newline at end of file