From 44260ccaeee42a63aab30091fc97558176dbca7f Mon Sep 17 00:00:00 2001 From: netkas Date: Tue, 5 Nov 2024 19:19:14 -0500 Subject: [PATCH] Add 'GetUserProfilePhotos' method support --- src/TgBotLib/Enums/Methods.php | 3 ++ src/TgBotLib/Methods/GetUserProfilePhotos.php | 40 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/TgBotLib/Methods/GetUserProfilePhotos.php diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 666c79e..bf6918a 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -13,6 +13,7 @@ use TgBotLib\Methods\ForwardMessages; use TgBotLib\Methods\GetMe; use TgBotLib\Methods\GetUpdates; + use TgBotLib\Methods\GetUserProfilePhotos; use TgBotLib\Methods\GetWebhookInfo; use TgBotLib\Methods\Logout; use TgBotLib\Methods\SendAnimation; @@ -64,6 +65,7 @@ case SEND_DICE = 'sendDice'; case SEND_CHAT_ACTION = 'sendChatAction'; case SET_MESSAGE_REACTION = 'setMessageReaction'; + case GET_USER_PROFILE_PHOTOS = 'getUserProfilePhotos'; /** * Executes a command on the provided bot with the given parameters. @@ -105,6 +107,7 @@ self::SEND_DICE => SendDice::execute($bot, $parameters), self::SEND_CHAT_ACTION => SendChatAction::execute($bot, $parameters), self::SET_MESSAGE_REACTION => SetMessageReaction::execute($bot, $parameters), + self::GET_USER_PROFILE_PHOTOS => GetUserProfilePhotos::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/GetUserProfilePhotos.php b/src/TgBotLib/Methods/GetUserProfilePhotos.php new file mode 100644 index 0000000..2b3d606 --- /dev/null +++ b/src/TgBotLib/Methods/GetUserProfilePhotos.php @@ -0,0 +1,40 @@ +sendRequest(Methods::GET_USER_PROFILE_PHOTOS->value, $parameters); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'user_id' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'offset', + 'limit' + ]; + } + } \ No newline at end of file