From 4d40f8f3a3d74c9ea7f2d938ff64b50dcad2b940 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 15:44:14 -0500 Subject: [PATCH] Add DeleteChatPhoto method --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/DeleteChatPhoto.php | 36 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/TgBotLib/Methods/DeleteChatPhoto.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 308f9a4..b88ff4b 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -14,6 +14,7 @@ use TgBotLib\Methods\CreateChatInviteLink; use TgBotLib\Methods\CreateChatSubscriptionInviteLink; use TgBotLib\Methods\DeclineChatJoinRequest; + use TgBotLib\Methods\DeleteChatPhoto; use TgBotLib\Methods\DeleteWebhook; use TgBotLib\Methods\EditChatInviteLink; use TgBotLib\Methods\EditChatSubscriptionInviteLink; @@ -102,6 +103,7 @@ case APPROVE_CHAT_JOIN_REQUEST = 'approveChatJoinRequest'; case DECLINE_CHAT_JOIN_REQUEST = 'declineChatJoinRequest'; case SET_CHAT_PHOTO = 'setChatPhoto'; + case DELETE_CHAT_PHOTO = 'deleteChatPhoto'; /** * Executes a command on the provided bot with the given parameters. @@ -162,6 +164,7 @@ self::APPROVE_CHAT_JOIN_REQUEST => ApproveChatJoinRequest::execute($bot, $parameters), 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), }; } } diff --git a/src/TgBotLib/Methods/DeleteChatPhoto.php b/src/TgBotLib/Methods/DeleteChatPhoto.php new file mode 100644 index 0000000..78808e4 --- /dev/null +++ b/src/TgBotLib/Methods/DeleteChatPhoto.php @@ -0,0 +1,36 @@ +value, $parameters))); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'chat_id' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return null; + } + } \ No newline at end of file