public AdminMiddleware(IMiddleware next, AdminPlugin adminPlugin, SchedulePlugin schedulePlugin, ISlackWrapper slackWrapper) : base(next) { _adminPlugin = adminPlugin; _schedulePlugin = schedulePlugin; _slackWrapper = slackWrapper; HandlerMappings = new[] { new HandlerMapping { ValidHandles = new [] { "admin pin" }, EvaluatorFunc = PinHandler }, new HandlerMapping { ValidHandles = new [] { "admin schedules list" }, EvaluatorFunc = SchedulesListHandler }, new HandlerMapping { ValidHandles = new [] { "admin schedules delete" }, EvaluatorFunc = DeleteSchedulesHandler }, new HandlerMapping { ValidHandles = new [] { "admin channels" }, EvaluatorFunc = ChannelsHandler } }; }
public void Start() { INoobotContainer container = _containerGenerator.Generate(); _slackWrapper = container.GetSlackConnector(); Console.WriteLine("Connecting..."); _slackWrapper .Connect() .ContinueWith(task => { if (task.IsCompleted && !task.IsFaulted) { _plugins = container.GetPlugins(); foreach (IPlugin plugin in _plugins) { plugin.Start(); } container.GetInstance <StatsPlugin>().RecordStat("Connected since", DateTime.Now.ToString("G")); } else { Console.WriteLine($"Error connecting to Slack: {task.Exception}"); } }); }
public void Start() { INoobotContainer container = _containerGenerator.Generate(); _slackWrapper = container.GetSlackConnector(); Console.WriteLine("Connecting..."); _slackWrapper .Connect() .ContinueWith(task => { if (task.IsCompleted && !task.IsFaulted) { _plugins = container.GetPlugins(); foreach (IPlugin plugin in _plugins) { plugin.Start(); } } else { Console.WriteLine("Error connecting to Slack: {0}", task.Exception); } }); }
public SchedulePlugin(StoragePlugin storagePlugin, ISlackWrapper slackWrapper, StatsPlugin statsPlugin) { _storagePlugin = storagePlugin; _slackWrapper = slackWrapper; _statsPlugin = statsPlugin; }
public PingPlugin(ISlackWrapper slackWrapper) { _slackWrapper = slackWrapper; }
public PingPlugin(ISlackWrapper slackWrapper, StoragePlugin storagePlugin) { _slackWrapper = slackWrapper; _storagePlugin = storagePlugin; }