diff --git a/VKAPI/Handlers/Wall.php b/VKAPI/Handlers/Wall.php index cb8a1ca2..530c8aa4 100644 --- a/VKAPI/Handlers/Wall.php +++ b/VKAPI/Handlers/Wall.php @@ -110,7 +110,7 @@ final class Wall extends VKAPIRequestHandler ]; } - function post(string $owner_id, string $message, int $from_group = 0, int $signed = 0): object + function post(string $owner_id, string $message = "", int $from_group = 0, int $signed = 0): object { $this->requireUser(); @@ -167,6 +167,9 @@ final class Wall extends VKAPIRequestHandler $this->fail(-156, "The media file is corrupted or too large "); } + if(empty($message) && !$photo && !$video) + $this->fail(100, "Required parameter 'message' missing."); + try { $post = new Post; $post->setOwner($this->getUser()->getId());