diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index bf6918a..79a0c76 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -11,6 +11,7 @@ use TgBotLib\Methods\DeleteWebhook; use TgBotLib\Methods\ForwardMessage; use TgBotLib\Methods\ForwardMessages; + use TgBotLib\Methods\GetFile; use TgBotLib\Methods\GetMe; use TgBotLib\Methods\GetUpdates; use TgBotLib\Methods\GetUserProfilePhotos; @@ -66,6 +67,7 @@ case SEND_CHAT_ACTION = 'sendChatAction'; case SET_MESSAGE_REACTION = 'setMessageReaction'; case GET_USER_PROFILE_PHOTOS = 'getUserProfilePhotos'; + case GET_FILE = 'getFile'; /** * Executes a command on the provided bot with the given parameters. @@ -108,6 +110,7 @@ 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), + self::GET_FILE => GetFile::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/GetFile.php b/src/TgBotLib/Methods/GetFile.php new file mode 100644 index 0000000..09b3ac7 --- /dev/null +++ b/src/TgBotLib/Methods/GetFile.php @@ -0,0 +1,38 @@ +sendRequest(Methods::GET_FILE->value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return [ + 'file_id' + ]; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return null; + } + } \ No newline at end of file