Added BotRemovedFromChatUpdate & ChatTitleChangedUpdate & MessageChatCreatedUpdate & UserAddedToChatUpdate & UserRemovedFromChatUpdate

This commit is contained in:
Alex
2025-07-25 08:34:38 +03:00
parent d5b950bcd9
commit 06492a698f
16 changed files with 1013 additions and 42 deletions
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace BushlanovDev\MaxMessengerBot\Models\Updates;
use BushlanovDev\MaxMessengerBot\Enums\UpdateType;
use BushlanovDev\MaxMessengerBot\Models\User;
/**
* You will receive this update when a user has been added to a chat where the bot is an administrator.
*/
final readonly class UserAddedToChatUpdate extends AbstractUpdate
{
/**
* @param int $timestamp Unix-time when the event has occurred.
* @param int $chatId Chat identifier where the event has occurred.
* @param User $user User who was added to the chat.
* @param int|null $inviterId User who added the new user to the chat.
* Can be `null` if the user joined via a link.
* @param bool $isChannel Indicates whether the user has been added to a channel or not.
*/
public function __construct(
int $timestamp,
public int $chatId,
public User $user,
public ?int $inviterId,
public bool $isChannel,
) {
parent::__construct(UpdateType::UserAdded, $timestamp);
}
}