mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-23 10:13:18 +00:00
Removed deprecated DataAttachment
This commit is contained in:
@@ -15,5 +15,4 @@ enum AttachmentType: string
|
||||
case InlineKeyboard = 'inline_keyboard';
|
||||
case Location = 'location';
|
||||
case Share = 'share';
|
||||
case Data = 'data';
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Reply\SendContactBut
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Reply\SendGeoLocationButton;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Reply\SendMessageButton;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\ContactAttachment;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\DataAttachment;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\FileAttachment;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\InlineKeyboardAttachment;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\LocationAttachment;
|
||||
@@ -259,7 +258,6 @@ readonly class ModelFactory
|
||||
AttachmentType::InlineKeyboard => InlineKeyboardAttachment::fromArray($data),
|
||||
AttachmentType::Location => LocationAttachment::fromArray($data),
|
||||
AttachmentType::Share => ShareAttachment::fromArray($data),
|
||||
AttachmentType::Data => DataAttachment::fromArray($data),
|
||||
default => throw new LogicException('Unknown or unsupported attachment type: ' . ($data['type'] ?? 'none')),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace BushlanovDev\MaxMessengerBot\Models\Attachments;
|
||||
|
||||
use BushlanovDev\MaxMessengerBot\Enums\AttachmentType;
|
||||
|
||||
/**
|
||||
* Represents an attachment containing a payload from a SendMessageButton.
|
||||
*/
|
||||
final readonly class DataAttachment extends AbstractAttachment
|
||||
{
|
||||
/**
|
||||
* @param string $data The payload from the button.
|
||||
*/
|
||||
public function __construct(public string $data)
|
||||
{
|
||||
parent::__construct(AttachmentType::Data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user