Skip to content

Commit 222d24c

Browse files
committed
updated Intellisense / doc
1 parent 983c9a4 commit 222d24c

9 files changed

+235
-178
lines changed

EXAMPLES.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ More examples can also be found in the [Examples folder](Examples) and in answer
2626
var resolved = await client.Contacts_ResolveUsername("MyEch0_Bot"); // username without the @
2727
await client.SendMessageAsync(resolved, "/start");
2828
```
29-
*Note: This also works if the @username points to a channel/group, but you must already have joined that channel before posting there.
29+
*Note: This also works if the @username points to a channel/group, but you must already have joined that channel before sending a message to it.
3030
If the username is invalid/unused, the API call raises an exception.*
3131

3232
<a name="msg-by-phone"></a>
@@ -210,7 +210,7 @@ for (int offset = 0; ;)
210210
```
211211

212212
For big Channel/Group, Telegram servers might limit the number of members you can obtain with the normal above method.
213-
In this case, you can use this helper method, but it can take several minutes to complete:
213+
In this case, you can use the following helper method, but it can take several minutes to complete:
214214
```csharp
215215
var chats = await client.Messages_GetAllChats();
216216
var channel = (Channel)chats.chats[1234567890]; // the channel we want
@@ -233,7 +233,7 @@ To use them, you need to extract the `HASH` part from the URL and then you can u
233233
```csharp
234234
var chatInvite = await client.Messages_CheckChatInvite("HASH"); // optional: get information before joining
235235
await client.Messages_ImportChatInvite("HASH"); // join the channel/group
236-
// Note: This works also with invite links of public channel/group
236+
// Note: This works also with hash invite links of public channel/group
237237
```
238238

239239
<a name="add-members"></a>
@@ -319,7 +319,7 @@ Your event handler implementation can either return `Task.CompletedTask` or be a
319319
See [Examples/Program_ListenUpdates.cs](Examples/Program_ListenUpdates.cs).
320320

321321
<a name="monitor-msg"></a>
322-
### Monitor new messages being posted in chats
322+
### Monitor new messages being posted in chats in real-time
323323

324324
You have to handle `client.OnUpdate` events containing an `UpdateNewMessage`.
325325

Examples/Program_Heroku.cs

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Threading.Tasks;
77
using TL;
88

9-
// This is an example userbot designed to run on a free Heroku account with a free PostgreSQL database for session storage
9+
// This is an example userbot designed to run on a Heroku account with a PostgreSQL database for session storage
1010
// This userbot simply answer "Pong" when someone sends him a "Ping" private message (or in Saved Messages)
1111
// To use/install/deploy this userbot, follow the steps at the end of this file
1212
// When run locally, close the window or type ALT-F4 to exit cleanly and save session (similar to Heroku SIGTERM)
@@ -126,8 +126,8 @@ public override void Flush() { }
126126

127127
/******************************************************************************************************************************
128128
HOW TO USE AND DEPLOY THIS EXAMPLE HEROKU USERBOT:
129-
- From your free Heroku.com account dashboard, create a new app (Free)
130-
- Navigate to the app Resources and add the add-on "Heroku Postgres" (Hobby Dev - Free)
129+
- From your Heroku.com account dashboard, create a new app
130+
- Navigate to the app Resources and add the add-on "Heroku Postgres"
131131
- Navigate to the app Settings, click Reveal Config Vars and save the Heroku git URL and the value of DATABASE_URL
132132
- Add a new var named "api_hash" with your api hash obtained from https://my.telegram.org/apps
133133
- Add a new var named "phone_number" with the phone_number of the user this userbot will manage
@@ -146,9 +146,7 @@ public override void Flush() { }
146146
- Paste inside the line you copied, and replace the initial "web" with "worker:" (don't forget the colon)
147147
- Commit and push the Git changes to Heroku. Wait until the deployment is complete.
148148
- Verify that the Resources "web" line has changed to "worker" and is enabled (use the pencil icon if necessary)
149-
- Now your userbot should be running 24/7. Note however that a full month of usage is 31*24 = 744 dyno hours.
150-
By default a free account gets 550 free dyno hours per month after which your app is stopped. If you register
151-
a credit card with your account, 450 additional free dyno hours are offered at no charge, which should be enough for 24/7
149+
- Now your userbot should be running 24/7.
152150
- To prevent AUTH_KEY_DUPLICATED issues, set a SESSION_NAME env variable in your local VS project with a value like "PC"
153151
DISCLAIMER: I'm not affiliated nor expert with Heroku, so if you have any problem with the above I might not be able to help
154152
******************************************************************************************************************************/

FAQ.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ You can verify this is your issue by looking at [WTelegram logs](EXAMPLES.md#log
8787
This wrong-server problem typically happens when you use WTelegramClient Github source project in your application in DEBUG builds.
8888
It is **not recommended** to use WTelegramClient in source code form.
8989
Instead, you should use the Nuget manager to **install package WTelegramClient** into your application.
90+
*And remember to delete the WTelegram.session file to force a new login on the correct server.*
9091

9192
If you use the Github source project in an old .NET Framework 4.x or .NET Core x.x application, you may also experience the following error
9293
> System.TypeInitializationException (FileNotFoundException for "System.Text.Json Version=5.0.0.0 ...")
@@ -163,7 +164,7 @@ That object must be created with both fields `channel_id` and `access_hash` corr
163164
There can be several reasons why `chats.chats[id]` raise an error:
164165
- The user account you're currently logged-in as has not joined this particular chat.
165166
API method [Messages_GetAllChats](https://corefork.telegram.org/method/messages.getAllChats) will only return those chat groups/channels the user is in, not all Telegram chat groups.
166-
- You're trying to use a Telegram.Bot (or TDLib) numerical ID, like -1001234567890
167+
- You're trying to use a Bot API (or TDLib) numerical ID, like -1001234567890
167168
Telegram Client API don't use these kind of IDs for chats. Remove the -100 prefix and try again with the rest (1234567890).
168169
- You're trying to use a user ID instead of a chat ID.
169170
Private messages with a user are not called "chats". See [Terminology in ReadMe](README.md#terminology).
@@ -232,7 +233,7 @@ If you need your userbot to run 24/7, you would typically design your userbot as
232233
and hosted online on any [VPS Hosting](https://www.google.com/search?q=vps+hosting) (Virtual Private Server).
233234
Pure WebApp hosts might not be adequate as they will recycle (stop) your app if there is no incoming HTTP requests.
234235

235-
There are many cheap VPS Hosting offers available, and some even have free tier, like Heroku:
236+
There are many cheap VPS Hosting offers available, for example Heroku:
236237
See [Examples/Program_Heroku.cs](Examples/Program_Heroku.cs) for such an implementation and the steps to host/deploy it.
237238

238239
<a name="troubleshoot"></a>

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![API Layer](https://img.shields.io/badge/API_Layer-144-blueviolet)](https://corefork.telegram.org/methods)
44
[![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)
55
[![Support Chat](https://img.shields.io/badge/Chat_with_us-on_Telegram-0088cc)](https://t.me/WTelegramClient)
6-
[![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](http://wizou.fr/donate.html)
6+
[![Donate](https://img.shields.io/badge/Help_this_project:-Donate-ff4444)](http://t.me/WTelegramBot?start=donate)
77

88
## _Telegram Client API library written 100% in C# and .NET Standard_
99

@@ -36,7 +36,7 @@ If the verification succeeds but the phone number is unknown to Telegram, the us
3636
If the account already exists and has enabled two-step verification (2FA) a **password** might be required.
3737
All these login scenarios are handled automatically within the call to `LoginUserIfNeeded`.
3838

39-
And that's it, you now have access to the **[full range of Telegram Client APIs](https://corefork.telegram.org/methods)**.
39+
After login, you now have access to the **[full range of Telegram Client APIs](https://corefork.telegram.org/methods)**.
4040
All those API methods require `using TL;` namespace and are called with an underscore instead of a dot in the method name, like this: `await client.Method_Name(...)`
4141

4242
# Saved session
@@ -162,4 +162,4 @@ Please don't use this library for Spam or Scam. Respect Telegram [Terms of Servi
162162
Developers feedback is welcome in the Telegram support group [@WTelegramClient](https://t.me/WTelegramClient)
163163
You can also check our [📖 Frequently Asked Questions](https://github.com/wiz0u/WTelegramClient/blob/master/FAQ.md) for more help and troubleshooting guide.
164164

165-
If you like this library, please [consider a donation](http://wizou.fr/donate.html).❤ This will help the project keep going.
165+
If you like this library, please [consider a donation](http://t.me/WTelegramBot?start=donate).❤ This will help the project keep going.

src/Client.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace WTelegram
2222
public partial class Client : IDisposable
2323
{
2424
/// <summary>This event will be called when unsollicited updates/messages are sent by Telegram servers</summary>
25-
/// <remarks>Make your handler <see langword="async"/>, or return <see cref="Task.CompletedTask"></see><br/>See <see href="https://github.com/wiz0u/WTelegramClient/blob/master/Examples/Program_ListenUpdates.cs">Examples/Program_ListenUpdate.cs</see> for how to use this</remarks>
25+
/// <remarks>Make your handler <see langword="async"/>, or return <see cref="Task.CompletedTask"/> or <see langword="null"/><br/>See <see href="https://github.com/wiz0u/WTelegramClient/blob/master/Examples/Program_ListenUpdates.cs">Examples/Program_ListenUpdate.cs</see> for how to use this</remarks>
2626
public event Func<IObject, Task> OnUpdate;
2727
/// <summary>Used to create a TcpClient connected to the given address/port, or throw an exception on failure</summary>
2828
public TcpFactory TcpHandler { get; set; } = DefaultTcpHandler;

0 commit comments

Comments
 (0)