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
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace App\Library\VK\Mapper;
class AttachmentMapper
{
public function map(array $attachments = []): array
{
$photos = [];
foreach ($attachments as $attachment) {
if( ($attachment['type'] === 'photo') && $attachment['photo']['sizes'] ) {
$photos[] = end($attachment['photo']['sizes'])['url'];
}
}
return $photos;
}
}