public void Start() { IContainerFactory containerFactory = new ContainerFactory(_configuration, _configReader, LogManager.GetLogger(GetType())); INoobotContainer container = containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); Console.WriteLine("Connecting..."); _noobotCore .Connect() .ContinueWith(task => { if (!task.IsCompleted || task.IsFaulted) { Console.WriteLine($"Error connecting to Slack: {task.Exception}"); } Settings.ChannelList = _noobotCore.ListChannels(); var lastRun = DateTime.UtcNow; while (true) { if (lastRun.AddSeconds(1) <= DateTime.UtcNow) { var check = new MunkCheck(); check.CheckForEvents(_noobotCore); lastRun = DateTime.UtcNow; } } }) .Wait(); }
public void Setup() { var containerFactory = new ContainerFactory(new ToolboxConfiguration(), new ConfigReader(), NoobotWrapper.GetLogger()); _container = containerFactory.CreateContainer(); _noobotCore = _container.GetNoobotCore(); _noobotCore.Connect().Wait(TimeSpan.FromMinutes(1)); }
public void Setup() { var containerFactory = new ContainerFactory(new ToolboxConfiguration(), new JsonConfigReader(), NoobotWrapper.GetLogger()); _container = containerFactory.CreateContainer(); _noobotCore = _container.GetNoobotCore(); _noobotCore.Connect().Wait(TimeSpan.FromMinutes(1)); }
public void Setup() { File.Delete(Path.Combine(Environment.CurrentDirectory, "data/schedules.json")); var containerFactory = new ContainerFactory(new SchedulerConfig(), new ConfigReader(), NoobotWrapper.GetLogger()); _container = containerFactory.CreateContainer(); _noobotCore = _container.GetNoobotCore(); _noobotCore.Connect().Wait(TimeSpan.FromMinutes(1)); }
public async Task StartAsync(CancellationToken cancellationToken) { IContainerFactory containerFactory = new ContainerFactory(_botConfiguration, _configReader, LogManager.GetLogger(GetType())); INoobotContainer container = containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); _logger.LogInformation("Connecting.."); await _noobotCore.Connect(); }
private static async Task RunBot() { var environmentReader = new EnvironmentReader(); var botConfiguration = new BotConfiguration(environmentReader); var containerFactory = new ContainerFactory(botConfiguration, environmentReader, GetLogger()); var container = containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); await _noobotCore.Connect(); }
private static async Task RunNoobot() { var containerFactory = new ContainerFactory( new ConfigurationBase(), JsonConfigReader.DefaultLocation(), GetLogger()); INoobotContainer container = containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); await _noobotCore.Connect(); }
private static async Task RunNoobot() { var containerFactory = new ContainerFactory( new MiddlewareConfiguration(), new JsonConfigReader(_noobotConfigFilePath), GetLogger()); INoobotContainer container = containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); await _noobotCore.Connect(); }
public void Start() { Console.WriteLine("Connecting..."); _noobotCore .Connect() .ContinueWith(task => { if (!task.IsCompleted || task.IsFaulted) { Console.WriteLine($"Error connecting to Slack: {task.Exception}"); } }) .Wait(); }
public void Start() { IContainerFactory containerFactory = new ContainerFactory(_configuration, _configReader, new ConsoleLog()); INoobotContainer container = containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); Console.WriteLine("Connecting..."); _noobotCore .Connect() .ContinueWith(task => { if (!task.IsCompleted || task.IsFaulted) { Console.WriteLine($"Error connecting to Slack: {task.Exception}"); } }); }
public INoobotHost Start() { INoobotContainer container = _containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); Console.WriteLine("Connecting..."); _noobotCore .Connect() .ContinueWith(task => { if (!task.IsCompleted || task.IsFaulted) { Console.WriteLine($"Error connecting to Slack: {task.Exception}"); } }); return this; }
public INoobotHost Start() { INoobotContainer container = _containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); Console.WriteLine("Connecting..."); _noobotCore .Connect() .ContinueWith(task => { if (!task.IsCompleted || task.IsFaulted) { Console.WriteLine($"Error connecting to Slack: {task.Exception}"); } }); return(this); }
public void Start(ILog log) { IContainerFactory containerFactory = new ContainerFactory(_configuration, _configReader, log); INoobotContainer container = containerFactory.CreateContainer(); _noobotCore = container.GetNoobotCore(); _noobotCore .Connect() .ContinueWith(task => { if (!task.IsCompleted || task.IsFaulted) { Debug.WriteLine($"Error connecting to Slack: {task.Exception}"); } }) .GetAwaiter() .GetResult(); }
public async Task StartAsync(CancellationToken cancellationToken) { await _noobotCore.Connect(); }