From 2047154d2651e5cc730e475b3aabdff8aad12e27 Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Tue, 15 Nov 2022 16:20:00 +0100 Subject: [PATCH] doc --- .github/dev.yml | 2 +- README.md | 4 ++-- src/Client.Helpers.cs | 5 +++-- src/Client.cs | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/dev.yml b/.github/dev.yml index 4352170..d26fff4 100644 --- a/.github/dev.yml +++ b/.github/dev.yml @@ -2,7 +2,7 @@ pr: none trigger: - master -name: 3.1.2-dev.$(Rev:r) +name: 3.1.3-dev.$(Rev:r) pool: vmImage: ubuntu-latest diff --git a/README.md b/README.md index 436378c..b4369aa 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -[![NuGet version](https://img.shields.io/nuget/v/WTelegramClient)](https://www.nuget.org/packages/WTelegramClient/) +[![NuGet version](https://img.shields.io/nuget/v/WTelegramClient?color=00508F)](https://www.nuget.org/packages/WTelegramClient/) [![Build Status](https://img.shields.io/azure-devops/build/wiz0u/WTelegramClient/7)](https://dev.azure.com/wiz0u/WTelegramClient/_build?definitionId=7) [![API Layer](https://img.shields.io/badge/API_Layer-148-blueviolet)](https://corefork.telegram.org/methods) [![dev nuget](https://img.shields.io/badge/dynamic/json?color=ffc040&label=dev%20nuget&query=%24.versions%5B0%5D&url=https%3A%2F%2Fpkgs.dev.azure.com%2Fwiz0u%2F81bd92b7-0bb9-4701-b426-09090b27e037%2F_packaging%2F46ce0497-7803-4bd4-8c6c-030583e7c371%2Fnuget%2Fv3%2Fflat2%2Fwtelegramclient%2Findex.json)](https://dev.azure.com/wiz0u/WTelegramClient/_artifacts/feed/WTelegramClient/NuGet/WTelegramClient) -[![Support Chat](https://img.shields.io/badge/Chat_with_us-on_Telegram-0088cc)](https://t.me/WTelegramClient) +[![Support Chat](https://img.shields.io/badge/Contact_us-on_Telegram-238EC2)](https://t.me/WTelegramClient) [![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](http://t.me/WTelegramBot?start=donate) ## _Telegram Client API library written 100% in C# and .NET Standard_ diff --git a/src/Client.Helpers.cs b/src/Client.Helpers.cs index b809f94..3ef85f2 100644 --- a/src/Client.Helpers.cs +++ b/src/Client.Helpers.cs @@ -16,7 +16,7 @@ namespace WTelegram partial class Client { #region Collect Access Hash system - /// Enable the collection of id/access_hash pairs (experimental) + /// Enable the collection of id/access_hash pairs (experimental)
See
public bool CollectAccessHash { get; set; } public IEnumerable> AllAccessHashesFor() where T : IObject => _accessHashes.GetValueOrDefault(typeof(T)); private readonly Dictionary> _accessHashes = new(); @@ -25,10 +25,11 @@ namespace WTelegram /// Retrieve the access_hash associated with this id (for a TL class) if it was collected /// This requires to be set to first. - ///
See Examples/Program_CollectAccessHash.cs for how to use this
+ /// See Examples/Program_CollectAccessHash.cs for how to use this /// a TL object class. For example User, Channel or Photo public long GetAccessHashFor(long id) where T : IObject { + if (!CollectAccessHash) Helpers.Log(4, "GetAccessHashFor doesn't do what you think. See https://github.com/wiz0u/WTelegramClient/blob/master/FAQ.md#access-hash"); lock (_accessHashes) return _accessHashes.GetOrCreate(typeof(T)).TryGetValue(id, out var access_hash) ? access_hash : 0; } diff --git a/src/Client.cs b/src/Client.cs index e9506ae..891764a 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -49,7 +49,7 @@ namespace WTelegram public bool Disconnected => _tcpClient != null && !(_tcpClient.Client?.Connected ?? false); /// ID of the current logged-in user or 0 public long UserId => _session.UserId; - /// Info about the current logged-in user + /// Info about the current logged-in user. This is filled after a successful (re)login public User User { get; private set; } private Func _config;