diff --git a/Examples/Program_GetAllChats.cs b/Examples/Program_GetAllChats.cs index 4f532d6..5320cc0 100644 --- a/Examples/Program_GetAllChats.cs +++ b/Examples/Program_GetAllChats.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using TL; diff --git a/src/Client.cs b/src/Client.cs index 3adec35..194e01d 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -111,6 +111,7 @@ namespace WTelegram private static string AskConfig(string config) { + if (config == "api_id") Console.WriteLine("You can obtain your api_id/api_hash at https://my.telegram.org/apps"); Console.Write($"Enter {config.Replace('_', ' ')}: "); return Console.ReadLine(); } @@ -885,6 +886,7 @@ namespace WTelegram /// Detail about the logged bot public async Task LoginBotIfNeeded() { + await ConnectAsync(); string botToken = Config("bot_token"); if (_session.User != null) { @@ -919,6 +921,7 @@ namespace WTelegram /// Detail about the logged user public async Task LoginUserIfNeeded(CodeSettings settings = null) { + await ConnectAsync(); string phone_number = null; if (_session.User != null) {