diff --git a/.github/dev.yml b/.github/dev.yml
index def4305..2b26cff 100644
--- a/.github/dev.yml
+++ b/.github/dev.yml
@@ -2,7 +2,7 @@ pr: none
trigger:
- master
-name: 2.5.2-dev.$(Rev:r)
+name: 2.5.3-dev.$(Rev:r)
pool:
vmImage: ubuntu-latest
diff --git a/FAQ.md b/FAQ.md
index b42ca53..a00a912 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -132,7 +132,16 @@ Here are some advices from [another similar library](https://github.com/gotd/td/
* Do not abuse, spam or use it for other suspicious activities.
* Implement a rate limiting system.
-If your client displays Telegram channels to the user, you have to support and display [official sponsored messages](https://core.telegram.org/api/sponsored-messages).
+Some additional advices from me:
+
+5. Avoid repetitive polling or repetitive sequence of actions/requests: Save the initial results of your queries, and update those results when you're informed of a change through `Update` events.
+6. If a phone number is brand new, it will be closely monitored by Telegram for abuse, and it can even already be considered a bad user due to bad behavior from the previous owner of that phone number (which may happens often with VoIP or other easy-to-buy-online numbers, so expect fast ban)
+7. You may want to use your new phone number account with an official Telegram client and act like a normal user for some time (some weeks/months), before using it for automation with WTelegramClient.
+8. When creating a new API ID/Hash, I recommend you use your own phone number with long history of normal Telegram usage, rather than a brand new phone number with short history.
+In particular, DON'T create an API ID/Hash for every phone numbers you will control. One API ID/Hash represents your application, which can be used to control several user accounts.
+9. If you actually do use the library to spam, scam, or other stuff annoying to everybody, GTFO and don't cry that you got banned using WTelegramClient. Some people don't seem to realize by themselves that what they plan to do with the library is actually negative for the community and are surprised that they got caught.
+We don't support such use of the library, and will not help people asking for support if we suspect them of mass-user manipulation.
+10. If your client displays Telegram channels to your users, you have to support and display [official sponsored messages](https://core.telegram.org/api/sponsored-messages).
#### 9. Why the error `CHAT_ID_INVALID`?
diff --git a/src/Client.Helpers.cs b/src/Client.Helpers.cs
index 9fc14e0..2cca82b 100644
--- a/src/Client.Helpers.cs
+++ b/src/Client.Helpers.cs
@@ -18,9 +18,11 @@ namespace WTelegram
#region Collect Access Hash system
/// Enable the collection of id/access_hash pairs (experimental)
public bool CollectAccessHash { get; set; }
- readonly Dictionary> _accessHashes = new();
- public IEnumerable> AllAccessHashesFor() where T : IObject
- => _accessHashes.GetValueOrDefault(typeof(T));
+ public IEnumerable> AllAccessHashesFor() where T : IObject => _accessHashes.GetValueOrDefault(typeof(T));
+ private readonly Dictionary> _accessHashes = new();
+ private static readonly FieldInfo userFlagsField = typeof(User).GetField("flags");
+ private static readonly FieldInfo channelFlagsField = typeof(Channel).GetField("flags");
+
/// 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
@@ -35,8 +37,6 @@ namespace WTelegram
lock (_accessHashes)
_accessHashes.GetOrCreate(typeof(T))[id] = access_hash;
}
- static readonly FieldInfo userFlagsField = typeof(User).GetField("flags");
- static readonly FieldInfo channelFlagsField = typeof(Channel).GetField("flags");
internal void CollectField(FieldInfo fieldInfo, object obj, object access_hash)
{
if (fieldInfo.Name != "access_hash") return;
@@ -55,6 +55,11 @@ namespace WTelegram
#endregion
#region Client TL Helpers
+ /// Used to indicate progression of file download/upload
+ /// transmitted bytes
+ /// total size of file in bytes, or 0 if unknown
+ public delegate void ProgressCallback(long transmitted, long totalSize);
+
/// Helper function to upload a file to Telegram
/// Path to the file to upload
/// (optional) Callback for tracking the progression of the transfer
diff --git a/src/Client.cs b/src/Client.cs
index bb6e5a6..585b230 100644
--- a/src/Client.cs
+++ b/src/Client.cs
@@ -51,10 +51,6 @@ namespace WTelegram
/// ID of the current logged-in user or 0
public long UserId => _session.UserId;
- /// Used to indicate progression of file download/upload
- /// total size of file in bytes, or 0 if unknown
- public delegate void ProgressCallback(long transmitted, long totalSize);
-
private readonly Func _config;
private readonly Session _session;
private string _apiHash;