mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-24 16:26:51 +00:00
SendMessage method add sender
This commit is contained in:
@@ -13,11 +13,15 @@ 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.
|
||||
* @param Sender|null $sender User who sent this message. Can be null if message has been posted on behalf of a channel.
|
||||
* @param string|null $url Message public URL. Can be null for dialogs or non-public chats/channels.
|
||||
*/
|
||||
public function __construct(
|
||||
public int $timestamp,
|
||||
public MessageBody $body,
|
||||
public Recipient $recipient,
|
||||
public ?Sender $sender,
|
||||
public ?string $url,
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace BushlanovDev\MaxMessengerBot\Models;
|
||||
|
||||
/**
|
||||
* User who sent this message.
|
||||
*/
|
||||
final readonly class Sender extends AbstractModel
|
||||
{
|
||||
/**
|
||||
* @param int $userId Users identifier.
|
||||
* @param string $firstName Users first name.
|
||||
* @param string|null $lastName Users last name.
|
||||
* @param string|null $username Unique public user name. Can be null if user is not accessible or it is not set.
|
||||
* @param bool $isBot Is the user a bot.
|
||||
* @param int $lastActivityTime Time of last user activity in Max (Unix timestamp in milliseconds). Can be outdated if user disabled its "online" status in settings.
|
||||
*/
|
||||
public function __construct(
|
||||
public int $userId,
|
||||
public string $firstName,
|
||||
public ?string $lastName,
|
||||
public ?string $username,
|
||||
public bool $isBot,
|
||||
public int $lastActivityTime,
|
||||
) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user