<?php

declare(strict_types=1);

namespace App\Handler\Update;

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

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

    public function handle(UpdateInterface $update): void
    {
        if (!$update instanceof DialogRemovedFromChatUpdate) {
            return;
        }
        $this->logger->info('dialog removed', [
            'chat_id' => $update->chatId,
            'by_user_id' => $update->user->userId,
        ]);
    }
}
