From 491137d5a4716ef0c81153b5003784b96917327a Mon Sep 17 00:00:00 2001 From: netkas Date: Thu, 14 Nov 2024 00:28:12 -0500 Subject: [PATCH] Refactor execute method to return Message object --- src/TgBotLib/Methods/StopMessageLiveLocation.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TgBotLib/Methods/StopMessageLiveLocation.php b/src/TgBotLib/Methods/StopMessageLiveLocation.php index c2da048..f66d301 100644 --- a/src/TgBotLib/Methods/StopMessageLiveLocation.php +++ b/src/TgBotLib/Methods/StopMessageLiveLocation.php @@ -6,6 +6,7 @@ use TgBotLib\Bot; use TgBotLib\Enums\Methods; use TgBotLib\Interfaces\ObjectTypeInterface; + use TgBotLib\Objects\Message; class StopMessageLiveLocation extends Method { @@ -13,7 +14,7 @@ /** * @inheritDoc */ - public static function execute(Bot $bot, array $parameters = []): mixed + public static function execute(Bot $bot, array $parameters = []): Message { if (isset($parameters['reply_markup'])) { @@ -27,7 +28,7 @@ } } - return self::executeCurl(self::buildPost($bot, Methods::STOP_MESSAGE_LIVE_LOCATION->value, $parameters)); + return Message::fromArray(self::executeCurl(self::buildPost($bot, Methods::STOP_MESSAGE_LIVE_LOCATION->value, $parameters))); } /**