示例#1
0
        public static IBotClient GetBotClient(string secretOrToken)
        {
            switch (BotClientSettings.ClientType)
            {
            case BotClientType.Default:
                return(new DefaultBotClient(secretOrToken));

            case BotClientType.Custom:
                if (BotClientSettings.CustomBotClientFactoryMethod == null)
                {
                    throw new InvalidOperationException("Custom bot client selected but one hasn't been set");
                }
                return(BotClientSettings.CustomBotClientFactoryMethod(secretOrToken));

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
示例#2
0
 public DefaultBotClient(IDirectLineClient directLineClient, BotClientSettings settings, ILogger <DefaultBotClient> logger)
 {
     _settings         = settings;
     _directLineClient = directLineClient;
     _logger           = logger;
 }