示例#1
0
        internal LineBot(ILineConfiguration configuration, HttpClient?client, ILineBotLogger?logger)
        {
            Guard.NotNull(nameof(configuration), configuration);

            if (string.IsNullOrWhiteSpace(configuration.ChannelAccessToken))
            {
                throw new ArgumentException($"The {nameof(configuration.ChannelAccessToken)} cannot be null or whitespace.", nameof(configuration));
            }

            if (string.IsNullOrWhiteSpace(configuration.ChannelSecret))
            {
                throw new ArgumentException($"The {nameof(configuration.ChannelSecret)} cannot be null or whitespace.", nameof(configuration));
            }

            _logger             = logger ?? new EmptyLineBotLogger();
            _client             = client ?? HttpClientFactory.Create(configuration, _logger);
            _signatureValidator = new SignatureValidator(configuration);
        }