public void Start() { AppDomain.CurrentDomain.ProcessExit += this.ProcessExitHandler; Console.CancelKeyPress += this.ConsoleOnCancelKeyPress; IServiceCollection serviceBuilder = new ServiceCollection() .AddSingleton <ISpotifyBase, SpotifyBase>(); ILogger test = this.GetLogger(serviceBuilder); ContainerFactory containerFactory = new ContainerFactory(this._configuration, this._configReader, test); INoobotContainer container = containerFactory.CreateContainer(); this._slackBotCore = container.GetNoobotCore(); this._slackBotCore .Connect() .ContinueWith(task => { if (!task.IsCompleted || task.IsFaulted) { Console.WriteLine($"Error connecting to Slack: {task.Exception}"); } }) .GetAwaiter() .GetResult(); _quitEvent.WaitOne(); //serviceBuilder.BuildServiceProvider(); }
public HelpMiddleware(IMiddleware next, ISlackBotCore slackBotCore) : base(next) { this._slackBotCore = slackBotCore; this.HandlerMappings = new[] { new HandlerMapping { ValidHandles = new IValidHandle[] { new StartsWithHandle("help") }, Description = "Returns supported commands and descriptions of how to use them", EvaluatorFunc = this.HelpHandler } }; }