public void Install(IWindsorContainer container, IConfigurationStore store) { var botWorker = new BotWorker(container.Resolve <Database.UserContext>()); botWorker.Instance.OnMessage += botWorker.HandleMessage; botWorker.Instance.OnCallbackQuery += botWorker.HandleCallbackQuery; var userContext = container.Resolve <Database.UserContext>(); botWorker.AvailableSlashCommandList.ToList().ForEach(sc => { sc.BotWorker = botWorker; sc.UserContext = userContext; }); botWorker.ProfileCreatingAskActions.ToList().ForEach(pcaa => pcaa.BotWorker = botWorker); container.Register(Component.For <BotWorker>() .Instance(botWorker)); botWorker.Instance.StartReceiving(); }
public BotWorker(UserContext UserContext) { this.UserContext = UserContext; BotWorker.Create(); }