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

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

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

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