private void OnMessageReceived(PrivateMessage message) { var command = new BotCommand { Channel = message.Channel, From = message.From, Message = message.Message }; SendCommandToBotsAsync(command).ContinueWith(PublishUnhandledException); }
public async Task HandleAsync(BotCommand command) { var response = await _responder.HandleAsync(command); if (response != null) { EventHappened.Invoke(new BotEvent { Channel = command.Channel, Message = response }); } }
protected Task SendCommandToBotsAsync(BotCommand command) { return(_aggregateBot.HandleAsync(command)); }
public Task HandleAsync(BotCommand command) { var tasks = _bots.Select(b => b.HandleAsync(command)); return(Task.WhenAll(tasks)); }
public Task HandleAsync(BotCommand command) { return(Task.CompletedTask); }