mirror of
https://github.com/openvk/openvk
synced 2024-12-23 09:01:15 +03:00
VKAPI: Add the ability to publish posts only with media
This commit is contained in:
parent
a81e9ac704
commit
dd236c0034
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
$this->requireUser();
|
||||||
|
|
||||||
|
@ -167,6 +167,9 @@ final class Wall extends VKAPIRequestHandler
|
||||||
$this->fail(-156, "The media file is corrupted or too large ");
|
$this->fail(-156, "The media file is corrupted or too large ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($message) && !$photo && !$video)
|
||||||
|
$this->fail(100, "Required parameter 'message' missing.");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$post = new Post;
|
$post = new Post;
|
||||||
$post->setOwner($this->getUser()->getId());
|
$post->setOwner($this->getUser()->getId());
|
||||||
|
|
Loading…
Reference in a new issue