mirror of
https://github.com/Jetsparrow/jetherald.git
synced 2026-01-21 07:56:09 +03:00
Make Telegram.UseProxy logical
This commit is contained in:
parent
a8485edcf9
commit
536d315341
@ -31,15 +31,15 @@ namespace JetHerald
|
|||||||
public async Task Init()
|
public async Task Init()
|
||||||
{
|
{
|
||||||
if (Config.UseProxy)
|
if (Config.UseProxy)
|
||||||
{
|
|
||||||
Client = new TelegramBotClient(Config.ApiKey);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
var httpProxy = new WebProxy(Config.ProxyUrl)
|
var httpProxy = new WebProxy(Config.ProxyUrl)
|
||||||
{ Credentials = new NetworkCredential(Config.ProxyLogin, Config.ProxyPassword) };
|
{ Credentials = new NetworkCredential(Config.ProxyLogin, Config.ProxyPassword) };
|
||||||
Client = new TelegramBotClient(Config.ApiKey, httpProxy);
|
Client = new TelegramBotClient(Config.ApiKey, httpProxy);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Client = new TelegramBotClient(Config.ApiKey);
|
||||||
|
}
|
||||||
Me = await Client.GetMeAsync();
|
Me = await Client.GetMeAsync();
|
||||||
|
|
||||||
Commands = new ChatCommandRouter(Me.Username, Log);
|
Commands = new ChatCommandRouter(Me.Username, Log);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user