public IActionResult Authentication() { var accounts = _botCredentials.GetAllAccounts(); var model = new BotAuthViewModel { SavedBotAccounts = accounts.Select(Mapper.Map <BotAccountViewModel>), BotIsRunning = _bot.IsRunning() }; return(View(model)); }
public IActionResult Global() { if (!_bot.IsRunning()) { return(RedirectToAction("Authentication", "Bot")); } var model = new ChatViewModel { AvailableServers = _bot.GetAvailableServers().Select(Mapper.Map <ServerDetailViewModel>), MessageBuffer = new List <ChatMessageViewModel>() }; return(View(model)); }
public Task ToggleBotConnection() { if (_bot.IsRunning()) { _bot.Stop(); } else { _bot.Connect(); } return(Task.CompletedTask); }
public IActionResult Index() { var model = new OverviewViewModel { BotIsRunning = _bot.IsRunning(), LogBuffer = _logger.GetLatest(10) }; var botAccount = _bot.GetActiveBotAccount(); if (botAccount != null) { model.ActiveAccount = new BotAccountViewModel { AvatarUrl = botAccount.AvatarUrl, Name = botAccount.Name }; } return(View(model)); }