using Managing.Application.Abstractions;
using Managing.Application.ManageBot.Commands;
using MediatR;
using static Managing.Common.Enums;

namespace Managing.Application.ManageBot
{
    public class RestartBotCommandHandler : IRequestHandler<RestartBotCommand, BotStatus>
    {
        private readonly IBotService _botService;

        public RestartBotCommandHandler(IBotService botService)
        {
            _botService = botService;
        }

        public async Task<BotStatus> Handle(RestartBotCommand request, CancellationToken cancellationToken)
        {
            return await _botService.RestartBot(request.Identifier);
        }
    }
}