using Managing.Application.Abstractions;
using Managing.Application.ManageBot.Commands;
using MediatR;

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

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

        public Task<string> Handle(RestartBotCommand request, CancellationToken cancellationToken)
        {
            return _botService.RestartBot(request.Name);
        }
    }
}