<?php

declare(strict_types=1);

namespace App\Handler\Update;

use App\Handler\AbstractUpdateHandler;
use Pkirillw\MaxBotApi\Api;
use Pkirillw\MaxBotApi\Scheme\Update\UpdateInterface;
use Pkirillw\MaxBotApi\Scheme\Update\UserRemovedFromChatUpdate;
use Psr\Log\LoggerInterface;

final class UserRemovedFromChatHandler extends AbstractUpdateHandler
{
    public function updateClass(): string { return \Pkirillw\MaxBotApi\Scheme\Update\UserRemovedFromChatUpdate::class; }

    public function handle(UpdateInterface $update): void
    {
        if (!$update instanceof UserRemovedFromChatUpdate) {
            return;
        }
        $this->logger->info('user removed from chat', [
            'chat_id' => $update->chatId,
            'removed_user_id' => $update->user->userId,
            'by_admin_id' => $update->adminId,
        ]);
    }
}
