Exemplo n.º 1
0
        public TelegramMessengerLogger(string name, TelegramMessengerLoggerConfiguration config)
        {
            _name   = name;
            _config = config;

            if (_config.UseSocks5)
            {
                var httpClientHandler = new HttpClientHandler
                {
                    Proxy    = new HttpToSocks5Proxy(_config.Socks5Host, _config.Socks5Port),
                    UseProxy = true
                };
                var httpClient = new HttpClient(httpClientHandler);

                _botClient = new TelegramBotClient(_config.TelegramToken, httpClient);
            }

            _botClient = new TelegramBotClient(_config.TelegramToken);
        }
Exemplo n.º 2
0
 public TelegramMessengerLoggerProvider(TelegramMessengerLoggerConfiguration config)
 {
     _config = config;
 }