From 02ce45a64304ad84ceee6a13cc2909beeb191955 Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 28 Nov 2024 14:58:18 -0500 Subject: [PATCH] Enhance execute method to handle boolean result --- src/TgBotLib/Methods/EditMessageLiveLocation.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/TgBotLib/Methods/EditMessageLiveLocation.php b/src/TgBotLib/Methods/EditMessageLiveLocation.php index 5ee1339..a22126c 100644 --- a/src/TgBotLib/Methods/EditMessageLiveLocation.php +++ b/src/TgBotLib/Methods/EditMessageLiveLocation.php @@ -14,7 +14,7 @@ /** * @inheritDoc */ - public static function execute(Bot $bot, array $parameters = []): Message + public static function execute(Bot $bot, array $parameters = []): Message|true { if (isset($parameters['reply_markup'])) { @@ -28,7 +28,14 @@ } } - return Message::fromArray(self::executeCurl(self::buildPost($bot, Methods::EDIT_MESSAGE_LIVE_LOCATION->value, $parameters))); + $result = self::executeCurl(self::buildPost($bot, Methods::EDIT_MESSAGE_LIVE_LOCATION->value, $parameters)); + + if(is_bool($result)) + { + return (bool)$result; + } + + return Message::fromArray($result); } /**