From 4946322045610722aa8acc0c1f166e2a2cc3dca5 Mon Sep 17 00:00:00 2001
From: Wizou <11647984+wiz0u@users.noreply.github.com>
Date: Fri, 12 Jul 2024 14:34:30 +0200
Subject: [PATCH] No need to escape MarkdownV2 chars in code sections
---
.github/dev.yml | 2 +-
FAQ.md | 6 ++++--
README.md | 8 +++++---
src/Services.cs | 3 ++-
src/UpdateManager.cs | 2 +-
5 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/.github/dev.yml b/.github/dev.yml
index d13b28d..542e9d0 100644
--- a/.github/dev.yml
+++ b/.github/dev.yml
@@ -1,7 +1,7 @@
pr: none
trigger: [ master ]
-name: 4.1.4-dev.$(Rev:r)
+name: 4.1.5-dev.$(Rev:r)
pool:
vmImage: ubuntu-latest
diff --git a/FAQ.md b/FAQ.md
index c6d398d..8a5a040 100644
--- a/FAQ.md
+++ b/FAQ.md
@@ -59,8 +59,9 @@ You also need to obtain their `access_hash` which is specific to the resource yo
This serves as a proof that the logged-in user is entitled to access that channel/user/photo/document/...
(otherwise, anybody with the ID could access it)
+> [!IMPORTANT]
> A small private group `Chat` don't need an access_hash and can be queried using their `chat_id` only.
-However most common chat groups are not `Chat` but a `Channel` supergroup (without the `broadcast` flag). See [Terminology in ReadMe](README.md#terminology).
+However most common chat groups are not `Chat` but a `Channel` supergroup (without the `broadcast` flag). See [Terminology in ReadMe](README.md#terminology).
Some TL methods only applies to private `Chat`, some only applies to `Channel` and some to both.
The `access_hash` must usually be provided within the `Input...` structure you pass in argument to an API method (`InputPeer`, `InputChannel`, `InputUser`, etc...).
@@ -108,7 +109,8 @@ To fix this, you should also switch to using the [WTelegramClient Nuget package]
You can get these kind of problems if you abuse Telegram [Terms of Service](https://telegram.org/tos), or the [API Terms of Service](https://core.telegram.org/api/terms), or make excessive requests.
You can try to wait more between the requests, wait for a day or two to see if the requests become possible again.
->ℹ️ For FLOOD_WAIT_X with X < 60 seconds (see `client.FloodRetryThreshold`), WTelegramClient will automatically wait the specified delay and retry the request for you.
+> [!NOTE]
+> For FLOOD_WAIT_X with X < 60 seconds (see `client.FloodRetryThreshold`), WTelegramClient will automatically wait the specified delay and retry the request for you.
For longer delays, you can catch the thrown `RpcException` and check the value of property X.
An account that was restricted due to reported spam might receive PEER_FLOOD errors. Read [Telegram Spam FAQ](https://telegram.org/faq_spam) to learn more.
diff --git a/README.md b/README.md
index a092718..dba86c5 100644
--- a/README.md
+++ b/README.md
@@ -10,8 +10,9 @@ All the Telegram Client APIs (MTProto) are supported so you can do everything th
This ReadMe is a **quick but important tutorial** to learn the fundamentals about this library. Please read it all.
->⚠️ This library requires understanding advanced C# techniques such as **asynchronous programming** or **subclass pattern matching**...
->If you are a beginner in C#, starting a project based on this library might not be a great idea.
+> [!IMPORTANT]
+> This library requires understanding advanced C# techniques such as **asynchronous programming** or **subclass pattern matching**...
+> If you are a beginner in C#, starting a project based on this library might not be a great idea.
# How to use
@@ -114,7 +115,8 @@ See [WinForms example](https://wiz0u.github.io/WTelegramClient/Examples/WinForms
# Example of API call
->ℹ️ The Telegram API makes extensive usage of base and derived classes, so be ready to use the various C# syntaxes
+> [!NOTE]
+> The Telegram API makes extensive usage of base and derived classes, so be ready to use the various C# syntaxes
to check/cast base classes into the more useful derived classes (`is`, `as`, `case DerivedType` )
All the Telegram API classes/methods are fully documented through Intellisense: Place your mouse over a class/method name,
diff --git a/src/Services.cs b/src/Services.cs
index 74c5cfc..16be5c9 100644
--- a/src/Services.cs
+++ b/src/Services.cs
@@ -297,7 +297,8 @@ namespace TL
{
case '_': case '*': case '~': case '`': case '#': case '+': case '-': case '=': case '.': case '!':
case '[': case ']': case '(': case ')': case '{': case '}': case '>': case '|': case '\\':
- sb.Insert(i++, '\\');
+ if (closings.Count == 0 || closings[0].md[0] != '`')
+ sb.Insert(i++, '\\');
break;
}
}
diff --git a/src/UpdateManager.cs b/src/UpdateManager.cs
index 5bf0b0e..b9ee9db 100644
--- a/src/UpdateManager.cs
+++ b/src/UpdateManager.cs
@@ -9,7 +9,7 @@ using TL;
namespace WTelegram
{
- public class UpdateManager : IPeerResolver
+ public class UpdateManager
{
/// Collected info about Users (only if using the default collector)
public readonly Dictionary Users;