fix Bug 61712

This commit is contained in:
pavelbannov 2023-03-22 23:52:59 +03:00
parent 6a2b6fc46c
commit d1213f7b04

View File

@ -172,10 +172,15 @@ public class TelegramHelper
public TelegramBotClient InitClient(string token, string proxy)
{
if (string.IsNullOrEmpty(proxy))
{
return new TelegramBotClient(token);
}
var httpClient = _httpClientFactory.CreateClient();
httpClient.BaseAddress = new Uri(proxy);
return string.IsNullOrEmpty(proxy) ? new TelegramBotClient(token) : new TelegramBotClient(token, httpClient);
return new TelegramBotClient(token, httpClient);
}
}