SendMessage method add recipient

This commit is contained in:
Alex
2025-07-13 15:01:05 +03:00
parent c8f87c70b6
commit 1ca860604c
7 changed files with 100 additions and 2 deletions
+4
View File
@@ -10,10 +10,14 @@ namespace BushlanovDev\MaxMessengerBot\Models;
final readonly class Message extends AbstractModel
{
/**
* @param int $timestamp Unix-time when message was created.
* @param MessageBody $body Body of created message. Text + attachments.
* @param Recipient $recipient Message recipient. Could be user or chat.
*/
public function __construct(
public int $timestamp,
public MessageBody $body,
public Recipient $recipient,
) {
}
}
+25
View File
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);
namespace BushlanovDev\MaxMessengerBot\Models;
use BushlanovDev\MaxMessengerBot\Enums\ChatType;
/**
* Message recipient. Could be user or chat.
*/
final readonly class Recipient extends AbstractModel
{
/**
* @param ChatType $chatType Chat type (dialog, chat or channel).
* @param int|null $userId User identifier, if message was sent to user.
* @param int|null $chatId Chat identifier.
*/
public function __construct(
public ChatType $chatType,
public ?int $userId,
public ?int $chatId,
) {
}
}