From 17204559189fb409ddff55a08dac10ef4f751fc1 Mon Sep 17 00:00:00 2001 From: netkas Date: Mon, 30 Sep 2024 02:48:39 -0400 Subject: [PATCH] Add execute method to Methods enum --- src/TgBotLib/Enums/Methods.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index 469a1b4..2ed70ef 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -3,12 +3,21 @@ namespace TgBotLib\Enums; use TgBotLib\Bot; + use TgBotLib\Exceptions\TelegramException; use TgBotLib\Methods\GetMe; enum Methods : string { case GET_ME = 'getMe'; + /** + * Executes a command on the provided bot with the given parameters. + * + * @param Bot $bot The bot instance on which the command will be executed. + * @param array $parameters Optional parameters for the command. + * @return mixed The result of the command execution, varies based on the command. + * @throws TelegramException if the command execution fails. + */ public function execute(Bot $bot, array $parameters=[]): mixed { return match($this)