From 22ea4c6de8972f0630c6a5e4c33b7393c5e69c50 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Wed, 8 Mar 2023 20:10:09 +0100 Subject: [PATCH] update doc --- .github/dev.yml | 2 +- .github/release.yml | 2 +- EXAMPLES.md | 5 +++-- FAQ.md | 2 +- src/TL.Schema.cs | 8 ++++---- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/dev.yml b/.github/dev.yml index ca7837f..e53e55a 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -2,7 +2,7 @@ pr: none trigger: - master -name: 3.2.3-dev.$(Rev:r) +name: 3.3.1-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/.github/release.yml b/.github/release.yml index 8d4f504..c5423ff 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -1,7 +1,7 @@ pr: none trigger: none -name: 3.2.$(Rev:r) +name: 3.3.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/EXAMPLES.md b/EXAMPLES.md index ff7700d..34ab979 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -160,10 +160,10 @@ foreach (var participant in participants.participants) // This is the better way *Note: It is not possible to list only the Deleted Accounts. Those will be automatically removed by Telegram from your group after a while* -## Fetch all messages (history) from a chat +## Fetch all messages (history) from a chat/user ```csharp var chats = await client.Messages_GetAllChats(); -InputPeer peer = chats.chats[1234567890]; // the chat we want +InputPeer peer = chats.chats[1234567890]; // the chat (or User) we want for (int offset_id = 0; ;) { var messages = await client.Messages_GetHistory(peer, offset_id); @@ -180,6 +180,7 @@ for (int offset_id = 0; ;) } ``` Notes: +- `peer` can also be a User, obtained through methods like [`Messages_GetAllDialogs`](#list-dialogs) - To stop at a specific msg ID, use Messages_GetHistory `min_id` argument. For example, `min_id: dialog.read_inbox_max_id` - To mark the message history as read, use: `await client.ReadHistory(peer);` diff --git a/FAQ.md b/FAQ.md index 42b6f8e..c879365 100644 --- a/FAQ.md +++ b/FAQ.md @@ -202,7 +202,7 @@ If Telegram servers decide to shutdown this secondary connection, it's not an is This should be transparent and pending API calls should automatically be resent upon reconnection. You can choose to increase `MaxAutoReconnects` if it happens too often because your Internet connection is unstable. -3) If you reach `MaxAutoReconnects` disconnections, then the **OnUpdate** event handler will receive a `ReactorError` object to notify you of the problem. +3) If you reach `MaxAutoReconnects` disconnections, then the **OnUpdate** event handler will receive a `ReactorError` object to notify you of the problem, and pending API calls throw the network IOException. In this case, the recommended action would be to dispose the client and recreate one diff --git a/src/TL.Schema.cs b/src/TL.Schema.cs index a62ef21..977e840 100644 --- a/src/TL.Schema.cs +++ b/src/TL.Schema.cs @@ -114,17 +114,17 @@ namespace TL /// Object defines a contact from the user's phone book. See Derived classes: public abstract class InputContact : IObject { } - /// Phone contact. The client_id is just an arbitrary contact ID: it should be set, for example, to an incremental number when using Contacts_ImportContacts, in order to retry importing only the contacts that weren't imported successfully. See + /// Phone contact. See [TLDef(0xF392B7F4)] public class InputPhoneContact : InputContact { - /// User identifier on the client + /// An arbitrary 64-bit integer: it should be set, for example, to an incremental number when using Contacts_ImportContacts, in order to retry importing only the contacts that weren't imported successfully, according to the client_ids returned in .retry_contacts. public long client_id; /// Phone number public string phone; - /// Contact's first name + /// Contact's first name public string first_name; - /// Contact's last name + /// Contact's last name public string last_name; }