mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-28 19:18:02 +00:00
SendMessage method add recipient
This commit is contained in:
@@ -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,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user