Exemplo n.º 1
0
        public IPrepearedBotBuilder RegisterCommand <TCommand, TCondition>()
            where TCommand : IBotCommand
            where TCondition : ICommandCondition, new()
        {
            var commandInfo = CreateCommandInfo <TCommand>();
            var condition   = CreateCommandCondition <TCondition>();

            RegisterCommand(condition, commandInfo);

            _logger.Info($"Command {commandInfo} registered.");

            return(this);
        }
Exemplo n.º 2
0
        public BotBuilder(IUnityContainer container)
        {
            _logger = ResolveLogger(container);

            _bot        = container.Resolve <Bot>();
            _bot.Logger = _logger;

            _logger.Info("Bot resolved");
        }