updated ReadMe

This commit is contained in:
Wizou 2021-12-15 20:55:24 +01:00
parent 6e4b90710a
commit 9cc164b9ec
2 changed files with 3 additions and 2 deletions

View file

@ -9,7 +9,8 @@
# How to use # How to use
>⚠️ This library relies on asynchronous C# programming (`async/await`) so make sure you are familiar with this before proceeding. >⚠️ This library relies on asynchronous C# programming (`async/await`) so make sure you are familiar with this advanced topic before proceeding.
>If you are a beginner in C#, making a project based on this library might not be a great idea.
After installing WTelegramClient through Nuget, your first Console program will be as simple as: After installing WTelegramClient through Nuget, your first Console program will be as simple as:
```csharp ```csharp

View file

@ -1168,7 +1168,7 @@ namespace WTelegram
public Task<Message> SendMediaAsync(InputPeer peer, string caption, InputFileBase mediaFile, string mimeType = null, int reply_to_msg_id = 0, MessageEntity[] entities = null, DateTime schedule_date = default) public Task<Message> SendMediaAsync(InputPeer peer, string caption, InputFileBase mediaFile, string mimeType = null, int reply_to_msg_id = 0, MessageEntity[] entities = null, DateTime schedule_date = default)
{ {
var filename = mediaFile is InputFile iFile ? iFile.name : (mediaFile as InputFileBig)?.name; var filename = mediaFile is InputFile iFile ? iFile.name : (mediaFile as InputFileBig)?.name;
mimeType ??= Path.GetExtension(filename).ToLowerInvariant() switch mimeType ??= Path.GetExtension(filename)?.ToLowerInvariant() switch
{ {
".jpg" or ".jpeg" or ".png" or ".bmp" => "photo", ".jpg" or ".jpeg" or ".png" or ".bmp" => "photo",
".gif" => "image/gif", ".gif" => "image/gif",