mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-04-21 06:13:57 +00:00
doc
This commit is contained in:
parent
61510465d2
commit
2047154d26
4 changed files with 7 additions and 6 deletions
2
.github/dev.yml
vendored
2
.github/dev.yml
vendored
|
|
@ -2,7 +2,7 @@ pr: none
|
||||||
trigger:
|
trigger:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
name: 3.1.2-dev.$(Rev:r)
|
name: 3.1.3-dev.$(Rev:r)
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-latest
|
vmImage: ubuntu-latest
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
[](https://www.nuget.org/packages/WTelegramClient/)
|
[](https://www.nuget.org/packages/WTelegramClient/)
|
||||||
[](https://dev.azure.com/wiz0u/WTelegramClient/_build?definitionId=7)
|
[](https://dev.azure.com/wiz0u/WTelegramClient/_build?definitionId=7)
|
||||||
[](https://corefork.telegram.org/methods)
|
[](https://corefork.telegram.org/methods)
|
||||||
[](https://dev.azure.com/wiz0u/WTelegramClient/_artifacts/feed/WTelegramClient/NuGet/WTelegramClient)
|
[](https://dev.azure.com/wiz0u/WTelegramClient/_artifacts/feed/WTelegramClient/NuGet/WTelegramClient)
|
||||||
[](https://t.me/WTelegramClient)
|
[](https://t.me/WTelegramClient)
|
||||||
[](http://t.me/WTelegramBot?start=donate)
|
[](http://t.me/WTelegramBot?start=donate)
|
||||||
|
|
||||||
## _Telegram Client API library written 100% in C# and .NET Standard_
|
## _Telegram Client API library written 100% in C# and .NET Standard_
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ namespace WTelegram
|
||||||
partial class Client
|
partial class Client
|
||||||
{
|
{
|
||||||
#region Collect Access Hash system
|
#region Collect Access Hash system
|
||||||
/// <summary>Enable the collection of id/access_hash pairs (experimental)</summary>
|
/// <summary>Enable the collection of id/access_hash pairs (experimental)<br/>See <see href="https://github.com/wiz0u/WTelegramClient/blob/master/FAQ.md#access-hash"/></summary>
|
||||||
public bool CollectAccessHash { get; set; }
|
public bool CollectAccessHash { get; set; }
|
||||||
public IEnumerable<KeyValuePair<long, long>> AllAccessHashesFor<T>() where T : IObject => _accessHashes.GetValueOrDefault(typeof(T));
|
public IEnumerable<KeyValuePair<long, long>> AllAccessHashesFor<T>() where T : IObject => _accessHashes.GetValueOrDefault(typeof(T));
|
||||||
private readonly Dictionary<Type, Dictionary<long, long>> _accessHashes = new();
|
private readonly Dictionary<Type, Dictionary<long, long>> _accessHashes = new();
|
||||||
|
|
@ -25,10 +25,11 @@ namespace WTelegram
|
||||||
|
|
||||||
/// <summary>Retrieve the access_hash associated with this id (for a TL class) if it was collected</summary>
|
/// <summary>Retrieve the access_hash associated with this id (for a TL class) if it was collected</summary>
|
||||||
/// <remarks>This requires <see cref="CollectAccessHash"/> to be set to <see langword="true"/> first.
|
/// <remarks>This requires <see cref="CollectAccessHash"/> to be set to <see langword="true"/> first.
|
||||||
/// <br/>See <see href="https://github.com/wiz0u/WTelegramClient/tree/master/Examples/Program_CollectAccessHash.cs">Examples/Program_CollectAccessHash.cs</see> for how to use this</remarks>
|
/// <para>See <see href="https://github.com/wiz0u/WTelegramClient/tree/master/Examples/Program_CollectAccessHash.cs">Examples/Program_CollectAccessHash.cs</see> for how to use this</para></remarks>
|
||||||
/// <typeparam name="T">a TL object class. For example User, Channel or Photo</typeparam>
|
/// <typeparam name="T">a TL object class. For example User, Channel or Photo</typeparam>
|
||||||
public long GetAccessHashFor<T>(long id) where T : IObject
|
public long GetAccessHashFor<T>(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)
|
lock (_accessHashes)
|
||||||
return _accessHashes.GetOrCreate(typeof(T)).TryGetValue(id, out var access_hash) ? access_hash : 0;
|
return _accessHashes.GetOrCreate(typeof(T)).TryGetValue(id, out var access_hash) ? access_hash : 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ namespace WTelegram
|
||||||
public bool Disconnected => _tcpClient != null && !(_tcpClient.Client?.Connected ?? false);
|
public bool Disconnected => _tcpClient != null && !(_tcpClient.Client?.Connected ?? false);
|
||||||
/// <summary>ID of the current logged-in user or 0</summary>
|
/// <summary>ID of the current logged-in user or 0</summary>
|
||||||
public long UserId => _session.UserId;
|
public long UserId => _session.UserId;
|
||||||
/// <summary>Info about the current logged-in user</summary>
|
/// <summary>Info about the current logged-in user. This is filled after a successful (re)login</summary>
|
||||||
public User User { get; private set; }
|
public User User { get; private set; }
|
||||||
|
|
||||||
private Func<string, string> _config;
|
private Func<string, string> _config;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue