From 9cc164b9ec9700d0b95518030ff0c7fbb7ee6085 Mon Sep 17 00:00:00 2001 From: Wizou Date: Wed, 15 Dec 2021 20:55:24 +0100 Subject: [PATCH] updated ReadMe --- README.md | 3 ++- src/Client.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ef0c67c..847f343 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ # 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: ```csharp diff --git a/src/Client.cs b/src/Client.cs index 4b5ee27..550050c 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -1168,7 +1168,7 @@ namespace WTelegram public Task 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; - mimeType ??= Path.GetExtension(filename).ToLowerInvariant() switch + mimeType ??= Path.GetExtension(filename)?.ToLowerInvariant() switch { ".jpg" or ".jpeg" or ".png" or ".bmp" => "photo", ".gif" => "image/gif",