Skip to content

Commit

Permalink
Forgot about logger tg bot
Browse files Browse the repository at this point in the history
  • Loading branch information
realwoopee committed Aug 22, 2021
1 parent 3736b69 commit 2cbeacb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 0 additions & 2 deletions dotnet-app/APIL/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ public Startup(IConfiguration configuration)

_appConfig = new AppConfiguration(Configuration);

IWebProxy proxy = null;

if (_appConfig.UseSocks5)
{
var httpClientHandler = new HttpClientHandler
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Net.Http;
using Microsoft.Extensions.Logging;
using MihaZupan;
using Telegram.Bot;
Expand All @@ -18,15 +19,19 @@ public TelegramMessengerLogger(string name, TelegramMessengerLoggerConfiguration
_name = name;
_config = config;

HttpToSocks5Proxy proxy = null;
if (_config.UseSocks5)
{
proxy = new HttpToSocks5Proxy(_config.Socks5Host, _config.Socks5Port);
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,
proxy);
_botClient = new TelegramBotClient(_config.TelegramToken);
}

public IDisposable BeginScope<TState>(TState state) => null;
Expand Down

0 comments on commit 2cbeacb

Please sign in to comment.