Enhance execute method to handle boolean result
This commit is contained in:
parent
4dfa3f3c59
commit
02ce45a643
1 changed files with 9 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue