public IActionResult StopBot() { if (!_bot.IsRunning()) { return(BadRequest("Bot is not running.")); } _bot.Stop(); return(RedirectToAction("Index", "Home")); }
public Task ToggleBotConnection() { if (_bot.IsRunning()) { _bot.Stop(); } else { _bot.Connect(); } return(Task.CompletedTask); }