diff --git a/src/TgBotLib/Enums/Methods.php b/src/TgBotLib/Enums/Methods.php index feb5f58..7fa5fb8 100644 --- a/src/TgBotLib/Enums/Methods.php +++ b/src/TgBotLib/Enums/Methods.php @@ -91,6 +91,7 @@ use TgBotLib\Methods\SetMyName; use TgBotLib\Methods\SetMyShortDescription; use TgBotLib\Methods\SetWebhook; + use TgBotLib\Methods\StopMessageLiveLocation; use TgBotLib\Methods\UnbanChatMember; use TgBotLib\Methods\UnbanChatSenderChat; use TgBotLib\Methods\UnhideGeneralForumTopic; @@ -194,6 +195,7 @@ case EDIT_MESSAGE_CAPTION = 'editMessageCaption'; case EDIT_MESSAGE_MEDIA = 'editMessageMedia'; case EDIT_MESSAGE_LIVE_LOCATION = 'editMessageLiveLocation'; + case STOP_MESSAGE_LIVE_LOCATION = 'stopMessageLiveLocation'; /** * Executes a command on the provided bot with the given parameters. @@ -300,6 +302,7 @@ self::EDIT_MESSAGE_CAPTION => EditMessageCaption::execute($bot, $parameters), self::EDIT_MESSAGE_MEDIA => EditMessageMedia::execute($bot, $parameters), self::EDIT_MESSAGE_LIVE_LOCATION => EditMessageLiveLocation::execute($bot, $parameters), + self::STOP_MESSAGE_LIVE_LOCATION => StopMessageLiveLocation::execute($bot, $parameters), }; } } diff --git a/src/TgBotLib/Methods/StopMessageLiveLocation.php b/src/TgBotLib/Methods/StopMessageLiveLocation.php new file mode 100644 index 0000000..c2da048 --- /dev/null +++ b/src/TgBotLib/Methods/StopMessageLiveLocation.php @@ -0,0 +1,54 @@ +toArray()); + } + elseif (is_array($parameters['reply_markup'])) + { + $parameters['reply_markup'] = json_encode($parameters['reply_markup']); + } + } + + return self::executeCurl(self::buildPost($bot, Methods::STOP_MESSAGE_LIVE_LOCATION->value, $parameters)); + } + + /** + * @inheritDoc + */ + public static function getRequiredParameters(): ?array + { + return null; + } + + /** + * @inheritDoc + */ + public static function getOptionalParameters(): ?array + { + return [ + 'business_connection_id', + 'chat_id', + 'message_id', + 'inline_message_id', + 'reply_markup' + ]; + } + } \ No newline at end of file