예제 #1
0
        public IActionResult StopBot()
        {
            if (!_bot.IsRunning())
            {
                return(BadRequest("Bot is not running."));
            }

            _bot.Stop();
            return(RedirectToAction("Index", "Home"));
        }
예제 #2
0
        public Task ToggleBotConnection()
        {
            if (_bot.IsRunning())
            {
                _bot.Stop();
            }
            else
            {
                _bot.Connect();
            }

            return(Task.CompletedTask);
        }