diff --git a/.github/dev.yml b/.github/dev.yml index bc59557..f9d623c 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -2,7 +2,7 @@ pr: none trigger: - master -name: 2.1.1-dev.$(Rev:r) +name: 2.1.2-dev.$(Rev:r) pool: vmImage: ubuntu-latest @@ -36,4 +36,3 @@ steps: nuGetFeedType: 'internal' publishVstsFeed: 'WTelegramClient/WTelegramClient' - diff --git a/Examples/Program_CollectAccessHash.cs b/Examples/Program_CollectAccessHash.cs index 4ed535f..055e6b6 100644 --- a/Examples/Program_CollectAccessHash.cs +++ b/Examples/Program_CollectAccessHash.cs @@ -32,7 +32,6 @@ namespace WTelegramClientTest } Console.WriteLine("Connecting to Telegram..."); - await client.ConnectAsync(); await client.LoginUserIfNeeded(); var durovAccessHash = client.GetAccessHashFor(DurovID); diff --git a/Examples/Program_DownloadSavedMedia.cs b/Examples/Program_DownloadSavedMedia.cs index d1004b9..9ca7905 100644 --- a/Examples/Program_DownloadSavedMedia.cs +++ b/Examples/Program_DownloadSavedMedia.cs @@ -14,7 +14,6 @@ namespace WTelegramClientTest { Console.WriteLine("The program will download photos/medias from messages you send/forward to yourself (Saved Messages)"); using var client = new WTelegram.Client(Environment.GetEnvironmentVariable); - await client.ConnectAsync(); var user = await client.LoginUserIfNeeded(); client.Update += Client_Update; Console.ReadKey(); diff --git a/Examples/Program_GetAllChats.cs b/Examples/Program_GetAllChats.cs index bcd0cf4..b39e31f 100644 --- a/Examples/Program_GetAllChats.cs +++ b/Examples/Program_GetAllChats.cs @@ -26,11 +26,10 @@ namespace WTelegramClientTest static async Task Main(string[] _) { using var client = new WTelegram.Client(Config); - await client.ConnectAsync(); var user = await client.LoginUserIfNeeded(); Console.WriteLine($"We are logged-in as {user.username ?? user.first_name + " " + user.last_name} (id {user.id})"); - var chats = await client.Messages_GetAllChats(null); // chats = groups/channels (does not include users dialogs) + var chats = await client.Messages_GetAllChats(); // chats = groups/channels (does not include users dialogs) Console.WriteLine("This user has joined the following:"); foreach (var (id, chat) in chats.chats) switch (chat) diff --git a/Examples/Program_ListenUpdates.cs b/Examples/Program_ListenUpdates.cs index fb6977f..1a375c6 100644 --- a/Examples/Program_ListenUpdates.cs +++ b/Examples/Program_ListenUpdates.cs @@ -25,7 +25,7 @@ namespace WTelegramClientTest // Note that on login Telegram may sends a bunch of updates/messages that happened in the past and were not acknowledged Console.WriteLine($"We are logged-in as {My.username ?? My.first_name + " " + My.last_name} (id {My.id})"); // We collect all infos about the users/chats so that updates can be printed with their names - var dialogsBase = await Client.Messages_GetDialogs(default, 0, null, 0, 0); // dialogs = groups/channels/users + var dialogsBase = await Client.Messages_GetDialogs(); // dialogs = groups/channels/users if (dialogsBase is Messages_Dialogs dialogs) while (dialogs.dialogs.Length != 0) { @@ -34,7 +34,7 @@ namespace WTelegramClientTest var lastDialog = dialogs.dialogs[^1]; var lastMsg = dialogs.messages.LastOrDefault(m => m.Peer.ID == lastDialog.Peer.ID && m.ID == lastDialog.TopMessage); var offsetPeer = dialogs.UserOrChat(lastDialog).ToInputPeer(); - dialogs = (Messages_Dialogs)await Client.Messages_GetDialogs(lastMsg?.Date ?? default, lastDialog.TopMessage, offsetPeer, 500, 0); + dialogs = (Messages_Dialogs)await Client.Messages_GetDialogs(lastMsg?.Date ?? default, lastDialog.TopMessage, offsetPeer); } Console.ReadKey(); }