Added VKBot

This commit is contained in:
amikhaylov
2026-05-28 02:16:26 +03:00
parent 20450c4ede
commit e90314f18b
16 changed files with 464 additions and 5 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace App\Library\VK\Resources;
use App\Library\VK\VkApiClient;
class WallResource
{
public function __construct(private VkApiClient $api) {}
public function get(string $domain, int $count = 50, int $offset = 0): array
{
$result = $this->api->call('wall.get', [
'domain' => $domain,
'offset' => $offset,
'count' => $count,
'copy_history_depth' => 10
]);
return $result['response'] ?? [ 'count' => 0, 'items' => [] ];
}
// id = '-93243530_2113'
public function getById(string $id): array
{
$result = $this->api->call('wall.getById',
[
'posts' => [ $id ],
'copy_history_depth' => 10
]);
return $result['response'] ?? [ 'items' => [] ];
}
}