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",